summaryrefslogtreecommitdiff
path: root/uisimulator/x11/button-x11.c
diff options
context:
space:
mode:
Diffstat (limited to 'uisimulator/x11/button-x11.c')
-rw-r--r--uisimulator/x11/button-x11.c13
1 files changed, 12 insertions, 1 deletions
diff --git a/uisimulator/x11/button-x11.c b/uisimulator/x11/button-x11.c
index 43b33fa305..8187125dff 100644
--- a/uisimulator/x11/button-x11.c
+++ b/uisimulator/x11/button-x11.c
@@ -49,6 +49,8 @@ void button_init()
49 49
50extern int screenhack_handle_events(bool *release, bool *repeat); 50extern int screenhack_handle_events(bool *release, bool *repeat);
51 51
52int button_state = 0;
53
52static int get_raw_button (void) 54static int get_raw_button (void)
53{ 55{
54 int k; 56 int k;
@@ -144,13 +146,22 @@ static int get_raw_button (void)
144 break; 146 break;
145 } 147 }
146 148
147 if(release) 149 if(release) {
148 /* return a release event */ 150 /* return a release event */
151 button_state &= ~k;
149 k |= BUTTON_REL; 152 k |= BUTTON_REL;
153 } else {
154 if(k) {
155 button_state |= k;
156 k = button_state;
157 }
158 }
150 159
151 if(repeat) 160 if(repeat)
152 k |= BUTTON_REPEAT; 161 k |= BUTTON_REPEAT;
153 162
163 if(k)
164 DEBUGF("key: %08x\n", k);
154 return k; 165 return k;
155} 166}
156 167