LWJGL
May 22, 2013, 13:42:25 *
Welcome, Guest. Please login or register.
Did you miss your activation email?

Login with username, password and session length
News: LWJGL is now using GitHub
 
   Home   Help Search Login Register  



Pages: [1]
  Print  
Author Topic: [BUG]Mouse.getDX() returns 0;  (Read 2340 times)
Caironater
Newbie
*
Posts: 6


« on: October 23, 2011, 17:47:00 »

The topic says pretty much everything. getDY() returns 0 too.
Logged
kappa
Administrator
Nerdus Imperius
*****
Posts: 1112



« Reply #1 on: October 24, 2011, 01:52:58 »

That sounds like normal behaviour, it should only change when moving the mouse and will report the movement of the mouse since the last type Mouse.getDX() was called, so if it doesn't move it will be 0. Maybe you need Mouse.getX() instead?
Logged
Caironater
Newbie
*
Posts: 6


« Reply #2 on: October 24, 2011, 02:47:02 »

That sounds like normal behaviour, it should only change when moving the mouse and will report the movement of the mouse since the last type Mouse.getDX() was called, so if it doesn't move it will be 0. Maybe you need Mouse.getX() instead?

I'm moving the mouse.
But, seeing as I couldn't get it to work, I've just decided to use mouseX - prevMouseX instead :/
Logged
avm1979
Regular nerd
**
Posts: 90


WWW
« Reply #3 on: October 24, 2011, 09:41:00 »

You're not on a Mac by any chance, are you? I noticed that Mouse.getDX()/Mouse.getDY() worked fine on Windows and Linux, but always returned zero in OSX.

Actually, I don't 100% remember it was always 0 - I think it actually *wasn't*. It was usually 0, but occasionally you'd get some non-zero values, enough to make things twitch. Was about 2 years ago, so it's hard to remember exactly Smiley I do remember having to switch away from using it, though.
Logged

Caironater
Newbie
*
Posts: 6


« Reply #4 on: October 24, 2011, 15:18:59 »

You're not on a Mac by any chance, are you? I noticed that Mouse.getDX()/Mouse.getDY() worked fine on Windows and Linux, but always returned zero in OSX.

Actually, I don't 100% remember it was always 0 - I think it actually *wasn't*. It was usually 0, but occasionally you'd get some non-zero values, enough to make things twitch. Was about 2 years ago, so it's hard to remember exactly Smiley I do remember having to switch away from using it, though.

Nah, I'm using Windows 7 + LWJGL 2.8.1;
Logged
gutomarzagao
Newbie
*
Posts: 9


« Reply #5 on: February 21, 2012, 13:20:37 »

I'm using Windows 7 and getting the same problem.
And it's not always 0. If I move the mouse as fast as I can, it returns some values.
Logged
Matzon
Administrator
Demigod
*****
Posts: 2239



« Reply #6 on: February 21, 2012, 13:37:00 »

congratulations - you've acquired a mouse that shows the problem. Now debug it for us and provide a patch  Kiss
Logged

princec
Nerdus Imperius
*****
Posts: 1870



WWW
« Reply #7 on: February 21, 2012, 14:12:55 »

I wonder if running a loop as fast as possible - eg. for (;Wink { Display.update(); } - on a grabbed mouse in Windows wouldn't actually be expecting this behaviour, actually, having just been monkeying around in the code. The mouse is recentered every update(), which if you're running it at 1600Hz, means it probably never gets to move, and the movement is how we currently get the delta values.

I think we need a better way to get mouse deltas than this.

I seem to recall a long time ago when I first had JGLIB/LWJGL early alphas we used DirectInput for the mouse. Maybe we should look into using it again for delta values on Windows.

Cas Smiley
Logged

Matzon
Administrator
Demigod
*****
Posts: 2239



« Reply #8 on: February 21, 2012, 14:41:16 »

I think there could be an issue with this .. theoretically ... for people with the issue, does it also happen on sync(60) ?
Logged

sliders_alpha
Newbie
*
Posts: 2


« Reply #9 on: April 15, 2012, 06:32:02 »

I'm having the same bug D:

I'm under windows7 64b and using eclipse 32b with the last LWJGL.
it doesn't matter how fast I move the mouse it never returns anything.

It does happen on sync(60)
Logged
Pages: [1]
  Print  
 
Jump to:  

Powered by MySQL Powered by PHP Powered by SMF 1.1.18 | SMF © 2013, Simple Machines
SMFAds for Free Forums
Valid XHTML 1.0! Valid CSS!