summaryrefslogtreecommitdiffstats
path: root/uisimulator/win32/button.c
diff options
context:
space:
mode:
Diffstat (limited to 'uisimulator/win32/button.c')
-rw-r--r--uisimulator/win32/button.c90
1 files changed, 45 insertions, 45 deletions
diff --git a/uisimulator/win32/button.c b/uisimulator/win32/button.c
index d1a86f191a..c11033fb6b 100644
--- a/uisimulator/win32/button.c
+++ b/uisimulator/win32/button.c
@@ -139,7 +139,7 @@ void button_event(int key, bool pressed)
#endif
break;
}
-
+
if (pressed)
btn |= new_btn;
else
@@ -154,63 +154,63 @@ void button_event(int key, bool pressed)
{
queue_post(&button_queue, BUTTON_REL | diff, NULL);
}
-
- if ( btn )
+ else
{
- /* normal keypress */
- if ( btn != lastbtn )
+ if ( btn )
{
- post = true;
- repeat = false;
- repeat_speed = REPEAT_INTERVAL_START;
-
- }
- else /* repeat? */
- {
- if ( repeat )
+ /* normal keypress */
+ if ( btn != lastbtn )
{
- count--;
- if (count == 0)
- {
- post = true;
- /* yes we have repeat */
- repeat_speed--;
- if (repeat_speed < REPEAT_INTERVAL_FINISH)
- repeat_speed = REPEAT_INTERVAL_FINISH;
- count = repeat_speed;
+ post = true;
+ repeat = false;
+ repeat_speed = REPEAT_INTERVAL_START;
- repeat_count++;
- }
}
- else
+ else /* repeat? */
{
- if (count++ > REPEAT_START)
+ if ( repeat )
+ {
+ count--;
+ if (count == 0)
+ {
+ post = true;
+ /* yes we have repeat */
+ repeat_speed--;
+ if (repeat_speed < REPEAT_INTERVAL_FINISH)
+ repeat_speed = REPEAT_INTERVAL_FINISH;
+ count = repeat_speed;
+
+ repeat_count++;
+ }
+ }
+ else
{
- post = true;
- repeat = true;
- repeat_count = 0;
- /* initial repeat */
- count = REPEAT_INTERVAL_START;
+ if (count++ > REPEAT_START)
+ {
+ post = true;
+ repeat = true;
+ repeat_count = 0;
+ /* initial repeat */
+ count = REPEAT_INTERVAL_START;
+ }
}
}
- }
-
- if ( post )
- {
- if(repeat)
- queue_post(&button_queue, BUTTON_REPEAT | btn, NULL);
- else
- queue_post(&button_queue, btn, NULL);
+ if ( post )
+ {
+ if(repeat)
+ queue_post(&button_queue, BUTTON_REPEAT | btn, NULL);
+ else
+ queue_post(&button_queue, btn, NULL);
- backlight_on();
+ backlight_on();
+ }
}
+ else
+ {
+ repeat = false;
+ count = 0;
}
- else
- {
- repeat = false;
- count = 0;
}
-
lastbtn = btn & ~(BUTTON_REL | BUTTON_REPEAT);
}