Search
lxdream.org :: lxdream :: r781:88d48559380a
lxdream 0.9.1
released Jun 29
Download Now
changeset781:88d48559380a
parent780:4e4ea322cb84
child782:1af8b5ce627c
authornkeynes
dateMon Jul 28 11:21:12 2008 +0000 (11 years ago)
Scale the mouse deltas (when grabbed) to get the movement more reasonable (and fairly close to system)
src/drivers/video_osx.c
1.1 --- a/src/drivers/video_osx.c Mon Jul 28 10:13:13 2008 +0000
1.2 +++ b/src/drivers/video_osx.c Mon Jul 28 11:21:12 2008 +0000
1.3 @@ -30,6 +30,9 @@
1.4
1.5 #include "mac_keymap.h"
1.6
1.7 +#define MOUSE_X_SCALE 5
1.8 +#define MOUSE_Y_SCALE 5
1.9 +
1.10 static gboolean video_osx_init();
1.11 static void video_osx_shutdown();
1.12 static void video_osx_display_blank( uint32_t colour );
1.13 @@ -187,25 +190,25 @@
1.14 - (void)mouseMoved: (NSEvent *) event
1.15 {
1.16 if( isGrabbed ) {
1.17 - input_event_mouse( buttonMask, [event deltaX], [event deltaY] );
1.18 + input_event_mouse( buttonMask, [event deltaX] * MOUSE_X_SCALE, [event deltaY] * MOUSE_Y_SCALE );
1.19 }
1.20 }
1.21 - (void)mouseDragged: (NSEvent *) event
1.22 {
1.23 if( isGrabbed ) {
1.24 - input_event_mouse( buttonMask, [event deltaX], [event deltaY] );
1.25 + input_event_mouse( buttonMask, [event deltaX] * MOUSE_X_SCALE, [event deltaY] * MOUSE_Y_SCALE );
1.26 }
1.27 }
1.28 - (void)rightMouseDragged: (NSEvent *) event
1.29 {
1.30 if( isGrabbed ) {
1.31 - input_event_mouse( buttonMask, [event deltaX], [event deltaY] );
1.32 + input_event_mouse( buttonMask, [event deltaX] * MOUSE_X_SCALE, [event deltaY] * MOUSE_Y_SCALE );
1.33 }
1.34 }
1.35 - (void)otherMouseDragged: (NSEvent *) event
1.36 {
1.37 if( isGrabbed ) {
1.38 - input_event_mouse( buttonMask, [event deltaX], [event deltaY] );
1.39 + input_event_mouse( buttonMask, [event deltaX] * MOUSE_X_SCALE, [event deltaY] * MOUSE_Y_SCALE );
1.40 }
1.41 }
1.42
.