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, 11 insertions, 2 deletions
diff --git a/uisimulator/x11/button-x11.c b/uisimulator/x11/button-x11.c
index 08b09cf8cb..673f71ea7b 100644
--- a/uisimulator/x11/button-x11.c
+++ b/uisimulator/x11/button-x11.c
@@ -55,13 +55,13 @@ static void button_tick(void)
55 static int repeat_speed = REPEAT_INTERVAL_START; 55 static int repeat_speed = REPEAT_INTERVAL_START;
56 static int repeat_count = 0; 56 static int repeat_count = 0;
57 static bool repeat = false; 57 static bool repeat = false;
58 static bool post = false;
58 int diff; 59 int diff;
59 int btn; 60 int btn;
60 61
61 /* only poll every X ticks */ 62 /* only poll every X ticks */
62 if ( ++tick >= POLL_FREQUENCY ) 63 if ( ++tick >= POLL_FREQUENCY )
63 { 64 {
64 bool post = false;
65 button_read(); 65 button_read();
66 btn = button_state; 66 btn = button_state;
67 67
@@ -115,9 +115,18 @@ static void button_tick(void)
115 if ( post ) 115 if ( post )
116 { 116 {
117 if (repeat) 117 if (repeat)
118 queue_post(&button_queue, BUTTON_REPEAT | btn, NULL); 118 {
119 if (queue_empty(&button_queue))
120 {
121 queue_post(&button_queue, BUTTON_REPEAT | btn, NULL);
122 post = false;
123 }
124 }
119 else 125 else
126 {
120 queue_post(&button_queue, btn, NULL); 127 queue_post(&button_queue, btn, NULL);
128 post = false;
129 }
121#ifdef HAVE_REMOTE_LCD 130#ifdef HAVE_REMOTE_LCD
122 if(btn & BUTTON_REMOTE) 131 if(btn & BUTTON_REMOTE)
123 remote_backlight_on(); 132 remote_backlight_on();