summaryrefslogtreecommitdiffstats
path: root/uisimulator
diff options
context:
space:
mode:
authorHristo Kovachev <bger@rockbox.org>2006-08-15 08:33:38 +0000
committerHristo Kovachev <bger@rockbox.org>2006-08-15 08:33:38 +0000
commit1792170633842d274d623dcdd7265f2e55ff2fc9 (patch)
tree760fcb1db7352fe6d19a0603a0a751934f0ead31 /uisimulator
parent079ad11896d68f16f23880f4de869bbb47617c19 (diff)
downloadrockbox-1792170633842d274d623dcdd7265f2e55ff2fc9.tar.gz
rockbox-1792170633842d274d623dcdd7265f2e55ff2fc9.tar.bz2
rockbox-1792170633842d274d623dcdd7265f2e55ff2fc9.zip
Add remote_type() to the uisim for h100/h300 builds. Use the "t" key to switch between remote types (only changes the remote_type()'s return value for now)
git-svn-id: svn://svn.rockbox.org/rockbox/trunk@10577 a1c6a512-1295-4272-9138-f99709370657
Diffstat (limited to 'uisimulator')
-rw-r--r--uisimulator/sdl/button.c36
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 @@
#include "uisdl.h"
#include "lcd-charcell.h"
+#include "lcd-remote.h"
#include "config.h"
#include "button.h"
#include "kernel.h"
#include "backlight.h"
#include "misc.h"
+#include "debug.h"
/* how long until repeat kicks in */
#define REPEAT_START 6
@@ -34,6 +36,15 @@
/* speed repeat finishes at */
#define REPEAT_INTERVAL_FINISH 2
+#if defined(IRIVER_H100_SERIES) || defined (IRIVER_H300_SERIES)
+int _remote_type=REMOTETYPE_H100_LCD;
+
+int remote_type(void)
+{
+ return _remote_type;
+}
+#endif
+
struct event_queue button_queue;
static int btn = 0; /* Hopefully keeps track of currently pressed keys... */
@@ -74,6 +85,31 @@ void button_event(int key, bool pressed)
switch (key)
{
+#if defined(IRIVER_H100_SERIES) || defined(IRIVER_H300_SERIES)
+ case SDLK_t:
+ if(pressed)
+ switch(_remote_type)
+ {
+ case REMOTETYPE_UNPLUGGED:
+ _remote_type=REMOTETYPE_H100_LCD;
+ DEBUGF("Changed remote type to H100\n");
+ break;
+ case REMOTETYPE_H100_LCD:
+ _remote_type=REMOTETYPE_H300_LCD;
+ DEBUGF("Changed remote type to H300\n");
+ break;
+ case REMOTETYPE_H300_LCD:
+ _remote_type=REMOTETYPE_H300_NONLCD;
+ DEBUGF("Changed remote type to H300 NON-LCD\n");
+ break;
+ case REMOTETYPE_H300_NONLCD:
+ _remote_type=REMOTETYPE_UNPLUGGED;
+ DEBUGF("Changed remote type to none\n");
+ break;
+ }
+ break;
+#endif
+
case SDLK_KP4:
case SDLK_LEFT:
new_btn = BUTTON_LEFT;