summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorLinus Nielsen Feltzing <linus@haxx.se>2007-03-05 14:48:31 +0000
committerLinus Nielsen Feltzing <linus@haxx.se>2007-03-05 14:48:31 +0000
commitec3f0d5e490ec51d79b674ed6d4aedf88dfaae2c (patch)
treea9796fa99edadf0afbaa3766478043d199bb0437
parent6bb473d291b27a41cb9336f6151f3f75cd993ada (diff)
downloadrockbox-ec3f0d5e490ec51d79b674ed6d4aedf88dfaae2c.tar.gz
rockbox-ec3f0d5e490ec51d79b674ed6d4aedf88dfaae2c.zip
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.c52
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)
65} 65}
66#endif 66#endif
67#endif 67#endif
68
69#ifdef HAS_BUTTON_HOLD
70bool hold_button_state = false;
71bool button_hold(void) {
72 return hold_button_state;
73}
74#endif
75
76#ifdef HAS_REMOTE_BUTTON_HOLD
77bool remote_hold_button_state = false;
78bool remote_button_hold(void) {
79 return remote_hold_button_state;
80}
81#endif
82
68void button_event(int key, bool pressed) 83void button_event(int key, bool pressed)
69{ 84{
70 int new_btn = 0; 85 int new_btn = 0;
@@ -99,7 +114,28 @@ void button_event(int key, bool pressed)
99 return; 114 return;
100 } 115 }
101 break; 116 break;
102 117
118#ifdef HAS_BUTTON_HOLD
119 case SDLK_h:
120 if(pressed)
121 {
122 hold_button_state = !hold_button_state;
123 DEBUGF("Hold button is %s\n", hold_button_state?"ON":"OFF");
124 }
125 break;
126#endif
127
128#ifdef HAS_REMOTE_BUTTON_HOLD
129 case SDLK_j:
130 if(pressed)
131 {
132 remote_hold_button_state = !remote_hold_button_state;
133 DEBUGF("Remote hold button is %s\n",
134 remote_hold_button_state?"ON":"OFF");
135 }
136 break;
137#endif
138
103#if CONFIG_KEYPAD == GIGABEAT_PAD 139#if CONFIG_KEYPAD == GIGABEAT_PAD
104 case SDLK_KP4: 140 case SDLK_KP4:
105 case SDLK_LEFT: 141 case SDLK_LEFT:
@@ -689,17 +725,3 @@ void button_clear_queue(void)
689{ 725{
690 queue_clear(&button_queue); 726 queue_clear(&button_queue);
691} 727}
692
693#ifdef HAS_BUTTON_HOLD
694bool button_hold(void) {
695 /* temp fix for hold button on irivers */
696 return false;
697}
698#endif
699
700#ifdef HAS_REMOTE_BUTTON_HOLD
701bool remote_button_hold(void) {
702 /* temp fix for hold button on irivers */
703 return false;
704}
705#endif