LWJGL 2.9.3 getY() for mouse events seems broken when using canvas

Started by laserlars, February 16, 2015, 21:33:49

Previous topic - Next topic

laserlars

Windows 7

Just upgraded from 2.8.2 to 2.9.3 and I noticed that when running LWJGL with a AWT-canvas the mouse
events always reports 0 for getY() - getX() works fine though. getEventY() doesn't work either - but you will get data if you use getEventDY();

spasi

I cannot reproduce this. Could you post more information or some code? What does your event loop look like? Do you use mouse grabbing?

TaylorR

@laserlars check out http://forum.lwjgl.org/index.php?topic=5471.0 2.9.3 contained a fix for mouse movements. Make sure your mouse reading is looping over all events.

@spasi please correct me on this, but if you use mouse grabbing you are safe to just make the collect call, i.e. getX(), but if you don't use grabbing its your responsibility to collect all input data via event loop, i.e. [LOOP]x += getEventX()[/LOOP]?

spasi

Quote from: TaylorR on February 24, 2015, 07:19:24@spasi please correct me on this, but if you use mouse grabbing you are safe to just make the collect call, i.e. getX(), but if you don't use grabbing its your responsibility to collect all input data via event loop, i.e. [LOOP]x += getEventX()[/LOOP]?

The difference is not related to mouse grabbing. Methods like getX() are just aggregates of the events that have occurred since the last time they were called. An event loop simply gives you the "history" of how you got there.

laserlars

Hi! Sorry for slow reply!

I threw out the code and switched to plain awt graphics 2d as I didn't really do any fancy stuff with GL anyway (just basic 2d) but I'm thinking of rendering again with GL.

I will check my git If I can roll-back. But It was really basic - and what suprised me was the fact that X worked fine but not Y. I will investigate when I get home from work!