From ec3f0d5e490ec51d79b674ed6d4aedf88dfaae2c Mon Sep 17 00:00:00 2001 From: Linus Nielsen Feltzing Date: Mon, 5 Mar 2007 14:48:31 +0000 Subject: 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 --- uisimulator/sdl/button.c | 52 ++++++++++++++++++++++++++++++++++-------------- 1 file changed, 37 insertions(+), 15 deletions(-) (limited to 'uisimulator/sdl') 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 -- cgit v1.2.3