diff options
-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) | |||
65 | } | 65 | } |
66 | #endif | 66 | #endif |
67 | #endif | 67 | #endif |
68 | |||
69 | #ifdef HAS_BUTTON_HOLD | ||
70 | bool hold_button_state = false; | ||
71 | bool button_hold(void) { | ||
72 | return hold_button_state; | ||
73 | } | ||
74 | #endif | ||
75 | |||
76 | #ifdef HAS_REMOTE_BUTTON_HOLD | ||
77 | bool remote_hold_button_state = false; | ||
78 | bool remote_button_hold(void) { | ||
79 | return remote_hold_button_state; | ||
80 | } | ||
81 | #endif | ||
82 | |||
68 | void button_event(int key, bool pressed) | 83 | void 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 | ||
694 | bool button_hold(void) { | ||
695 | /* temp fix for hold button on irivers */ | ||
696 | return false; | ||
697 | } | ||
698 | #endif | ||
699 | |||
700 | #ifdef HAS_REMOTE_BUTTON_HOLD | ||
701 | bool remote_button_hold(void) { | ||
702 | /* temp fix for hold button on irivers */ | ||
703 | return false; | ||
704 | } | ||
705 | #endif | ||