diff options
-rw-r--r-- | uisimulator/sdl/button.c | 36 |
1 files changed, 36 insertions, 0 deletions
diff --git a/uisimulator/sdl/button.c b/uisimulator/sdl/button.c index 7e78c9d030..d42cdee859 100644 --- a/uisimulator/sdl/button.c +++ b/uisimulator/sdl/button.c | |||
@@ -19,12 +19,14 @@ | |||
19 | 19 | ||
20 | #include "uisdl.h" | 20 | #include "uisdl.h" |
21 | #include "lcd-charcell.h" | 21 | #include "lcd-charcell.h" |
22 | #include "lcd-remote.h" | ||
22 | #include "config.h" | 23 | #include "config.h" |
23 | #include "button.h" | 24 | #include "button.h" |
24 | #include "kernel.h" | 25 | #include "kernel.h" |
25 | #include "backlight.h" | 26 | #include "backlight.h" |
26 | #include "misc.h" | 27 | #include "misc.h" |
27 | 28 | ||
29 | #include "debug.h" | ||
28 | /* how long until repeat kicks in */ | 30 | /* how long until repeat kicks in */ |
29 | #define REPEAT_START 6 | 31 | #define REPEAT_START 6 |
30 | 32 | ||
@@ -34,6 +36,15 @@ | |||
34 | /* speed repeat finishes at */ | 36 | /* speed repeat finishes at */ |
35 | #define REPEAT_INTERVAL_FINISH 2 | 37 | #define REPEAT_INTERVAL_FINISH 2 |
36 | 38 | ||
39 | #if defined(IRIVER_H100_SERIES) || defined (IRIVER_H300_SERIES) | ||
40 | int _remote_type=REMOTETYPE_H100_LCD; | ||
41 | |||
42 | int remote_type(void) | ||
43 | { | ||
44 | return _remote_type; | ||
45 | } | ||
46 | #endif | ||
47 | |||
37 | struct event_queue button_queue; | 48 | struct event_queue button_queue; |
38 | 49 | ||
39 | static int btn = 0; /* Hopefully keeps track of currently pressed keys... */ | 50 | static int btn = 0; /* Hopefully keeps track of currently pressed keys... */ |
@@ -74,6 +85,31 @@ void button_event(int key, bool pressed) | |||
74 | 85 | ||
75 | switch (key) | 86 | switch (key) |
76 | { | 87 | { |
88 | #if defined(IRIVER_H100_SERIES) || defined(IRIVER_H300_SERIES) | ||
89 | case SDLK_t: | ||
90 | if(pressed) | ||
91 | switch(_remote_type) | ||
92 | { | ||
93 | case REMOTETYPE_UNPLUGGED: | ||
94 | _remote_type=REMOTETYPE_H100_LCD; | ||
95 | DEBUGF("Changed remote type to H100\n"); | ||
96 | break; | ||
97 | case REMOTETYPE_H100_LCD: | ||
98 | _remote_type=REMOTETYPE_H300_LCD; | ||
99 | DEBUGF("Changed remote type to H300\n"); | ||
100 | break; | ||
101 | case REMOTETYPE_H300_LCD: | ||
102 | _remote_type=REMOTETYPE_H300_NONLCD; | ||
103 | DEBUGF("Changed remote type to H300 NON-LCD\n"); | ||
104 | break; | ||
105 | case REMOTETYPE_H300_NONLCD: | ||
106 | _remote_type=REMOTETYPE_UNPLUGGED; | ||
107 | DEBUGF("Changed remote type to none\n"); | ||
108 | break; | ||
109 | } | ||
110 | break; | ||
111 | #endif | ||
112 | |||
77 | case SDLK_KP4: | 113 | case SDLK_KP4: |
78 | case SDLK_LEFT: | 114 | case SDLK_LEFT: |
79 | new_btn = BUTTON_LEFT; | 115 | new_btn = BUTTON_LEFT; |