fix OS X issue where mouse was moving on mouse scroll wheel events.

This commit is contained in:
kappaOne 2013-07-09 16:07:42 +01:00
parent 11a6a30391
commit cc14c026ef
1 changed files with 22 additions and 21 deletions

View File

@ -207,15 +207,8 @@ final class MacOSXNativeMouse extends EventQueue {
}
return;
}
if (grabbed) {
if ( dx != 0 || dy != 0 ) {
putMouseEventWithCoords((byte)-1, (byte)0, (int)dx, (int)-dy, 0, nanos);
addDelta(dx, dy);
}
} else {
setCursorPos(x, y, nanos);
}
if ( dz != 0 ) {
if ( dz != 0 ) { // if scroll wheel event
// if no vertical wheel events, then map the horizontal wheel event to it
if (dy == 0) dy = dx;
@ -223,5 +216,13 @@ final class MacOSXNativeMouse extends EventQueue {
accum_dz += wheel_amount;
putMouseEvent((byte)-1, (byte)0, wheel_amount, nanos);
}
else if (grabbed) {
if ( dx != 0 || dy != 0 ) {
putMouseEventWithCoords((byte)-1, (byte)0, (int)dx, (int)-dy, 0, nanos);
addDelta(dx, dy);
}
} else {
setCursorPos(x, y, nanos);
}
}
}