From 1792170633842d274d623dcdd7265f2e55ff2fc9 Mon Sep 17 00:00:00 2001 From: Hristo Kovachev Date: Tue, 15 Aug 2006 08:33:38 +0000 Subject: 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 --- uisimulator/sdl/button.c | 36 ++++++++++++++++++++++++++++++++++++ 1 file changed, 36 insertions(+) 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; -- cgit v1.2.3