Search
lxdream.org :: lxdream/src/gtkui/gtk_win.c :: diff
lxdream 0.9.1
released Jun 29
Download Now
filename src/gtkui/gtk_win.c
changeset 849:bbe26d798fc2
prev843:7936c1162ce9
next850:28782ebbd01d
author nkeynes
date Mon Sep 08 05:13:51 2008 +0000 (12 years ago)
permissions -rw-r--r--
last change Refactor mouse event management - button events are now usable for controllers
file annotate diff log raw
1.1 --- a/src/gtkui/gtk_win.c Tue Sep 02 23:24:47 2008 +0000
1.2 +++ b/src/gtkui/gtk_win.c Mon Sep 08 05:13:51 2008 +0000
1.3 @@ -132,9 +132,10 @@
1.4 int32_t y = (int32_t)event->y;
1.5 if( win->is_grabbed &&
1.6 (x != win->mouse_x || y != win->mouse_y) ) {
1.7 - uint32_t buttons = (event->state >> 8)&0x1F;
1.8 - input_event_mouse( buttons, x - win->mouse_x, y - win->mouse_y, FALSE );
1.9 + input_event_mousemove( x - win->mouse_x, y - win->mouse_y, FALSE );
1.10 video_window_center_pointer(win);
1.11 + } else {
1.12 + input_event_mousemove( x, y, TRUE );
1.13 }
1.14 return TRUE;
1.15 }
1.16 @@ -143,12 +144,10 @@
1.17 gpointer user_data )
1.18 {
1.19 main_window_t win = (main_window_t)user_data;
1.20 - // Get the buttons from the event state, and add the pressed button
1.21 - uint32_t buttons = ((event->state >> 8) & 0x1F) | (1<<(event->button-1));
1.22 if( win->is_grabbed ) {
1.23 - input_event_mouse( buttons, 0, 0, FALSE );
1.24 + input_event_mousedown( event->button-1, 0, 0, FALSE );
1.25 } else {
1.26 - input_event_mouse( buttons, (int)event->x, (int)event->y, TRUE );
1.27 + input_event_mousedown( event->button-1, (int32_t)event->x, (int32_t)event->y, TRUE );
1.28 }
1.29 return TRUE;
1.30 }
1.31 @@ -157,14 +156,12 @@
1.32 gpointer user_data )
1.33 {
1.34 main_window_t win = (main_window_t)user_data;
1.35 - // Get the buttons from the event state, and remove the released button
1.36 - uint32_t buttons = ((event->state >> 8) & 0x1F) & (~(1<<(event->button-1)));
1.37 if( win->is_grabbed ) {
1.38 - input_event_mouse( buttons, 0, 0, FALSE );
1.39 + input_event_mouseup( event->button-1, 0, 0, FALSE );
1.40 } else if( win->use_grab) {
1.41 video_window_grab_display(win);
1.42 } else {
1.43 - input_event_mouse( buttons, (int)event->x, (int)event->y, TRUE );
1.44 + input_event_mouseup( event->button-1, (int32_t)event->x, (int32_t)event->y, TRUE );
1.45 }
1.46 return TRUE;
1.47 }
.