summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-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 43b33fa..8187125 100644
--- a/uisimulator/x11/button-x11.c
+++ b/uisimulator/x11/button-x11.c
@@ -49,6 +49,8 @@ void button_init()
extern int screenhack_handle_events(bool *release, bool *repeat);
+int button_state = 0;
+
static int get_raw_button (void)
{
int k;
@@ -144,13 +146,22 @@ static int get_raw_button (void)
break;
}
- if(release)
+ if(release) {
/* return a release event */
+ button_state &= ~k;
k |= BUTTON_REL;
+ } else {
+ if(k) {
+ button_state |= k;
+ k = button_state;
+ }
+ }
if(repeat)
k |= BUTTON_REPEAT;
+ if(k)
+ DEBUGF("key: %08x\n", k);
return k;
}