diff options
Diffstat (limited to 'uisimulator/x11/button-x11.c')
-rw-r--r-- | uisimulator/x11/button-x11.c | 16 |
1 files changed, 6 insertions, 10 deletions
diff --git a/uisimulator/x11/button-x11.c b/uisimulator/x11/button-x11.c index d1310d71e2..c838677778 100644 --- a/uisimulator/x11/button-x11.c +++ b/uisimulator/x11/button-x11.c | |||
@@ -63,19 +63,14 @@ int button_set_release(int newmask) | |||
63 | */ | 63 | */ |
64 | 64 | ||
65 | /* from uibasic.c */ | 65 | /* from uibasic.c */ |
66 | extern int screenhack_handle_events (void); | 66 | extern int screenhack_handle_events(bool *release); |
67 | 67 | ||
68 | static int get_raw_button (void) | 68 | static int get_raw_button (void) |
69 | { | 69 | { |
70 | int k; | 70 | int k; |
71 | static int next = 0; | 71 | bool release=false; /* is this a release event */ |
72 | if ( next ) { | ||
73 | k = next; | ||
74 | next = 0; | ||
75 | return k; | ||
76 | } | ||
77 | 72 | ||
78 | switch(screenhack_handle_events()) | 73 | switch(screenhack_handle_events(&release)) |
79 | { | 74 | { |
80 | case XK_KP_Left: | 75 | case XK_KP_Left: |
81 | case XK_Left: | 76 | case XK_Left: |
@@ -153,8 +148,9 @@ static int get_raw_button (void) | |||
153 | break; | 148 | break; |
154 | } | 149 | } |
155 | 150 | ||
156 | if ( k ) | 151 | if ( release ) |
157 | next = k | BUTTON_REL; | 152 | /* return a release event */ |
153 | k |= BUTTON_REL; | ||
158 | 154 | ||
159 | return k; | 155 | return k; |
160 | } | 156 | } |