summaryrefslogtreecommitdiffstats
path: root/uisimulator
diff options
context:
space:
mode:
authorJens Arnold <amiconn@rockbox.org>2005-07-13 20:04:43 +0000
committerJens Arnold <amiconn@rockbox.org>2005-07-13 20:04:43 +0000
commitd36567d3707afd2351f13e7e6a6889c75a5b60ef (patch)
tree06bcfc48a594fc855224d90bdfee92647757f115 /uisimulator
parentb0e78a46745dafb6d582b1e2b94043be9bb76442 (diff)
downloadrockbox-d36567d3707afd2351f13e7e6a6889c75a5b60ef.tar.gz
rockbox-d36567d3707afd2351f13e7e6a6889c75a5b60ef.tar.bz2
rockbox-d36567d3707afd2351f13e7e6a6889c75a5b60ef.zip
Win32 simulators: Fixed button repeat handling when releasing buttons.
git-svn-id: svn://svn.rockbox.org/rockbox/trunk@7134 a1c6a512-1295-4272-9138-f99709370657
Diffstat (limited to 'uisimulator')
-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);
}