Search
lxdream.org :: lxdream/src/maple/mouse.c :: diff
lxdream 0.9.1
released Jun 29
Download Now
filename src/maple/mouse.c
changeset 839:51f1c4195790
prev838:9abb2fa58934
next848:34dc33c05106
author nkeynes
date Tue Sep 02 03:34:00 2008 +0000 (14 years ago)
permissions -rw-r--r--
last change Implement absolute positioning mouse mode when not grabbed
enable/disable grab on dreamcast start/stop where it's requested
by the controllers
file annotate diff log raw
1.1 --- a/src/maple/mouse.c Tue Sep 02 00:42:43 2008 +0000
1.2 +++ b/src/maple/mouse.c Tue Sep 02 03:34:00 2008 +0000
1.3 @@ -84,24 +84,26 @@
1.4 return MAPLE_DEVICE(dev);
1.5 }
1.6
1.7 -void mouse_input_callback( void *mdev, uint32_t buttons, int32_t x, int32_t y )
1.8 +void mouse_input_callback( void *mdev, uint32_t buttons, int32_t x, int32_t y, gboolean absolute )
1.9 {
1.10 mouse_device_t dev = (mouse_device_t)mdev;
1.11 - dev->buttons = 0xFF;
1.12 - if( buttons & 0x01 ) {
1.13 - dev->buttons &= ~BUTTON_LEFT;
1.14 + if( !absolute ) {
1.15 + dev->buttons = 0xFF;
1.16 + if( buttons & 0x01 ) {
1.17 + dev->buttons &= ~BUTTON_LEFT;
1.18 + }
1.19 + if( buttons & 0x02 ) {
1.20 + dev->buttons &= ~BUTTON_MIDDLE;
1.21 + }
1.22 + if( buttons & 0x04 ) {
1.23 + dev->buttons &= ~BUTTON_RIGHT;
1.24 + }
1.25 + if( buttons & 0x08 ) {
1.26 + dev->buttons &= ~BUTTON_THUMB;
1.27 + }
1.28 + dev->axis[0] += x;
1.29 + dev->axis[1] += y;
1.30 }
1.31 - if( buttons & 0x02 ) {
1.32 - dev->buttons &= ~BUTTON_MIDDLE;
1.33 - }
1.34 - if( buttons & 0x04 ) {
1.35 - dev->buttons &= ~BUTTON_RIGHT;
1.36 - }
1.37 - if( buttons & 0x08 ) {
1.38 - dev->buttons &= ~BUTTON_THUMB;
1.39 - }
1.40 - dev->axis[0] += x;
1.41 - dev->axis[1] += y;
1.42 }
1.43
1.44 void mouse_attach( maple_device_t dev )
.