diff options
author | Linus Nielsen Feltzing <linus@haxx.se> | 2007-03-05 14:48:31 +0000 |
---|---|---|
committer | Linus Nielsen Feltzing <linus@haxx.se> | 2007-03-05 14:48:31 +0000 |
commit | ec3f0d5e490ec51d79b674ed6d4aedf88dfaae2c (patch) | |
tree | a9796fa99edadf0afbaa3766478043d199bb0437 | |
parent | 6bb473d291b27a41cb9336f6151f3f75cd993ada (diff) |
UI simulator: You can now toggle the main and remote hold switches with the h and j keys. It does not filter any keys, though, it mainly toggles the hold state, for WPS testing etc.
git-svn-id: svn://svn.rockbox.org/rockbox/trunk@12624 a1c6a512-1295-4272-9138-f99709370657
-rw-r--r-- | uisimulator/sdl/button.c | 52 |
1 files changed, 37 insertions, 15 deletions
diff --git a/uisimulator/sdl/button.c b/uisimulator/sdl/button.c index 7bc04409cf..31bea7dab1 100644 --- a/uisimulator/sdl/button.c +++ b/uisimulator/sdl/button.c @@ -65,6 +65,21 @@ void set_remote_backlight_filter_keypress(bool value) } #endif #endif + +#ifdef HAS_BUTTON_HOLD +bool hold_button_state = false; +bool button_hold(void) { + return hold_button_state; +} +#endif + +#ifdef HAS_REMOTE_BUTTON_HOLD +bool remote_hold_button_state = false; +bool remote_button_hold(void) { + return remote_hold_button_state; +} +#endif + void button_event(int key, bool pressed) { int new_btn = 0; @@ -99,7 +114,28 @@ void button_event(int key, bool pressed) return; } break; - + +#ifdef HAS_BUTTON_HOLD + case SDLK_h: + if(pressed) + { + hold_button_state = !hold_button_state; + DEBUGF("Hold button is %s\n", hold_button_state?"ON":"OFF"); + } + break; +#endif + +#ifdef HAS_REMOTE_BUTTON_HOLD + case SDLK_j: + if(pressed) + { + remote_hold_button_state = !remote_hold_button_state; + DEBUGF("Remote hold button is %s\n", + remote_hold_button_state?"ON":"OFF"); + } + break; +#endif + #if CONFIG_KEYPAD == GIGABEAT_PAD case SDLK_KP4: case SDLK_LEFT: @@ -689,17 +725,3 @@ void button_clear_queue(void) { queue_clear(&button_queue); } - -#ifdef HAS_BUTTON_HOLD -bool button_hold(void) { - /* temp fix for hold button on irivers */ - return false; -} -#endif - -#ifdef HAS_REMOTE_BUTTON_HOLD -bool remote_button_hold(void) { - /* temp fix for hold button on irivers */ - return false; -} -#endif |