From 19ac3453e0ed2b3fe458a0f4aeca4883c53b490e Mon Sep 17 00:00:00 2001 From: Thomas Martitz Date: Sun, 6 Jun 2010 10:27:14 +0000 Subject: Fix most reds, I have no idea what's wrong with the gigabeats (yet). git-svn-id: svn://svn.rockbox.org/rockbox/trunk@26619 a1c6a512-1295-4272-9138-f99709370657 --- firmware/target/hosted/sdl/button-sdl.c | 34 ++++++++++- uisimulator/buttonmap/SOURCES | 2 +- uisimulator/buttonmap/buttonmap.h | 2 +- uisimulator/buttonmap/gigabeat-s.c | 4 ++ uisimulator/buttonmap/gigabeat.c | 1 - uisimulator/buttonmap/iaudio-m3.c | 101 +++++++++++++++++++++++++++++++ uisimulator/buttonmap/iaudo-m3.c | 101 ------------------------------- uisimulator/buttonmap/iriver-h100_h300.c | 22 ------- uisimulator/buttonmap/touchscreen.c | 9 +-- 9 files changed, 141 insertions(+), 135 deletions(-) create mode 100644 uisimulator/buttonmap/iaudio-m3.c delete mode 100644 uisimulator/buttonmap/iaudo-m3.c diff --git a/firmware/target/hosted/sdl/button-sdl.c b/firmware/target/hosted/sdl/button-sdl.c index 2f971d7a4e..dd55373ef3 100644 --- a/firmware/target/hosted/sdl/button-sdl.c +++ b/firmware/target/hosted/sdl/button-sdl.c @@ -228,6 +228,30 @@ static void button_event(int key, bool pressed) return; #endif +#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_KP0: case SDLK_F5: if(pressed) @@ -236,9 +260,17 @@ static void button_event(int key, bool pressed) return; } break; +#ifdef HAVE_TOUCHSCREEN + case SDLK_F4: + if(pressed) + { + touchscreen_set_mode(touchscreen_get_mode() == TOUCHSCREEN_POINT ? TOUCHSCREEN_BUTTON : TOUCHSCREEN_POINT); + printf("Touchscreen mode: %s\n", touchscreen_get_mode() == TOUCHSCREEN_POINT ? "TOUCHSCREEN_POINT" : "TOUCHSCREEN_BUTTON"); + } +#endif default: #ifdef HAVE_TOUCHSCREEN - new_btn = key_to_touch(key); + new_btn = key_to_touch(key, mouse_coords); if (!new_btn) #endif new_btn = key_to_button(key); diff --git a/uisimulator/buttonmap/SOURCES b/uisimulator/buttonmap/SOURCES index 4d99093e7d..06be7450ab 100644 --- a/uisimulator/buttonmap/SOURCES +++ b/uisimulator/buttonmap/SOURCES @@ -59,7 +59,7 @@ onda-vx747.c #elif CONFIG_KEYPAD == ONDAVX777_PAD onda-vx777.c #elif CONFIG_KEYPAD == SAMSUNG_YH_PAD -samsung-yh820_yh925.c +samsung-yh820_yh92x.c #elif CONFIG_KEYPAD == PBELL_VIBE500_PAD pbell-vibe500.c #elif CONFIG_KEYPAD == MPIO_HD200_PAD diff --git a/uisimulator/buttonmap/buttonmap.h b/uisimulator/buttonmap/buttonmap.h index d5b951af9b..2f14cea9c4 100644 --- a/uisimulator/buttonmap/buttonmap.h +++ b/uisimulator/buttonmap/buttonmap.h @@ -36,7 +36,7 @@ int xy2button( int x, int y); int key_to_button(int keyboard_button); #ifdef HAVE_TOUCHSCREEN -int key_to_touch(int keyboard_button); +int key_to_touch(int keyboard_button, unsigned int mouse_coords); #endif #endif /* __BUTTONMAP_H__ */ diff --git a/uisimulator/buttonmap/gigabeat-s.c b/uisimulator/buttonmap/gigabeat-s.c index 98a8489446..5c139c470f 100644 --- a/uisimulator/buttonmap/gigabeat-s.c +++ b/uisimulator/buttonmap/gigabeat-s.c @@ -20,6 +20,10 @@ n/*************************************************************************** ****************************************************************************/ +#include +#include "button.h" +#include "buttonmap.h" + int key_to_button(int keyboard_button) { int new_btn = BUTTON_NONE; diff --git a/uisimulator/buttonmap/gigabeat.c b/uisimulator/buttonmap/gigabeat.c index 02055cf0b9..84b42a5c8a 100644 --- a/uisimulator/buttonmap/gigabeat.c +++ b/uisimulator/buttonmap/gigabeat.c @@ -19,7 +19,6 @@ n/*************************************************************************** * ****************************************************************************/ - #include #include "button.h" #include "buttonmap.h" diff --git a/uisimulator/buttonmap/iaudio-m3.c b/uisimulator/buttonmap/iaudio-m3.c new file mode 100644 index 0000000000..1ab1392f47 --- /dev/null +++ b/uisimulator/buttonmap/iaudio-m3.c @@ -0,0 +1,101 @@ +/*************************************************************************** + * __________ __ ___. + * Open \______ \ ____ ____ | | _\_ |__ _______ ___ + * Source | _// _ \_/ ___\| |/ /| __ \ / _ \ \/ / + * Jukebox | | ( <_> ) \___| < | \_\ ( <_> > < < + * Firmware |____|_ /\____/ \___ >__|_ \|___ /\____/__/\_ \ + * \/ \/ \/ \/ \/ + * $Id$ + * + * Copyright (C) 2008 by Jens Arnold + * + * This program is free software; you can redistribute it and/or + * modify it under the terms of the GNU General Public License + * as published by the Free Software Foundation; either version 2 + * of the License, or (at your option) any later version. + * + * This software is distributed on an "AS IS" basis, WITHOUT WARRANTY OF ANY + * KIND, either express or implied. + * + ****************************************************************************/ + + +#include +#include "button.h" +#include "buttonmap.h" + +int key_to_button(int keyboard_button) +{ + int new_btn = BUTTON_NONE; + switch (keyboard_button) + { + case SDLK_KP4: + new_btn = BUTTON_LEFT; + break; + case SDLK_LEFT: + new_btn = BUTTON_RC_REW; + break; + case SDLK_KP6: + new_btn = BUTTON_RIGHT; + break; + case SDLK_RIGHT: + new_btn = BUTTON_RC_FF; + break; + case SDLK_KP8: + new_btn = BUTTON_VOL_UP; + break; + case SDLK_UP: + new_btn = BUTTON_RC_VOL_UP; + break; + case SDLK_KP2: + new_btn = BUTTON_VOL_DOWN; + break; + case SDLK_DOWN: + new_btn = BUTTON_RC_VOL_DOWN; + break; + case SDLK_KP_PERIOD: + new_btn = BUTTON_MODE; + break; + case SDLK_INSERT: + new_btn = BUTTON_RC_MODE; + break; + case SDLK_KP_DIVIDE: + new_btn = BUTTON_REC; + break; + case SDLK_F1: + new_btn = BUTTON_RC_REC; + break; + case SDLK_KP5: + new_btn = BUTTON_PLAY; + break; + case SDLK_SPACE: + new_btn = BUTTON_RC_PLAY; + break; + case SDLK_KP_ENTER: + case SDLK_RETURN: + new_btn = BUTTON_RC_MENU; + break; + } + return new_btn; +} + +struct button_map bm[] = { + { SDLK_KP5, 256, 72, 29, "Play" }, + { SDLK_KP6, 255, 137, 28, "Right" }, + { SDLK_KP4, 257, 201, 26, "Left" }, + { SDLK_KP8, 338, 31, 27, "Up" }, + { SDLK_KP2, 339, 92, 23, "Down" }, + { SDLK_KP_PERIOD, 336, 50, 23, "Mode" }, + { SDLK_KP_DIVIDE, 336, 147, 23, "Rec" }, + { SDLK_h, 336, 212, 30, "Hold" }, + /* remote */ + { SDLK_SPACE, 115, 308, 20, "RC Play" }, + { SDLK_RIGHT, 85, 308, 20, "RC Rew" }, + { SDLK_LEFT, 143, 308, 20, "RC FF" }, + { SDLK_UP, 143, 498, 20, "RC Up" }, + { SDLK_DOWN, 85, 498, 20, "RC Down" }, + { SDLK_INSERT, 212, 308, 30, "RC Mode" }, + { SDLK_F1, 275, 308, 25, "RC Rec" }, + { SDLK_KP_ENTER, 115, 498, 20, "RC Menu" }, + { 0, 0, 0, 0, "None" } +}; diff --git a/uisimulator/buttonmap/iaudo-m3.c b/uisimulator/buttonmap/iaudo-m3.c deleted file mode 100644 index 1ab1392f47..0000000000 --- a/uisimulator/buttonmap/iaudo-m3.c +++ /dev/null @@ -1,101 +0,0 @@ -/*************************************************************************** - * __________ __ ___. - * Open \______ \ ____ ____ | | _\_ |__ _______ ___ - * Source | _// _ \_/ ___\| |/ /| __ \ / _ \ \/ / - * Jukebox | | ( <_> ) \___| < | \_\ ( <_> > < < - * Firmware |____|_ /\____/ \___ >__|_ \|___ /\____/__/\_ \ - * \/ \/ \/ \/ \/ - * $Id$ - * - * Copyright (C) 2008 by Jens Arnold - * - * This program is free software; you can redistribute it and/or - * modify it under the terms of the GNU General Public License - * as published by the Free Software Foundation; either version 2 - * of the License, or (at your option) any later version. - * - * This software is distributed on an "AS IS" basis, WITHOUT WARRANTY OF ANY - * KIND, either express or implied. - * - ****************************************************************************/ - - -#include -#include "button.h" -#include "buttonmap.h" - -int key_to_button(int keyboard_button) -{ - int new_btn = BUTTON_NONE; - switch (keyboard_button) - { - case SDLK_KP4: - new_btn = BUTTON_LEFT; - break; - case SDLK_LEFT: - new_btn = BUTTON_RC_REW; - break; - case SDLK_KP6: - new_btn = BUTTON_RIGHT; - break; - case SDLK_RIGHT: - new_btn = BUTTON_RC_FF; - break; - case SDLK_KP8: - new_btn = BUTTON_VOL_UP; - break; - case SDLK_UP: - new_btn = BUTTON_RC_VOL_UP; - break; - case SDLK_KP2: - new_btn = BUTTON_VOL_DOWN; - break; - case SDLK_DOWN: - new_btn = BUTTON_RC_VOL_DOWN; - break; - case SDLK_KP_PERIOD: - new_btn = BUTTON_MODE; - break; - case SDLK_INSERT: - new_btn = BUTTON_RC_MODE; - break; - case SDLK_KP_DIVIDE: - new_btn = BUTTON_REC; - break; - case SDLK_F1: - new_btn = BUTTON_RC_REC; - break; - case SDLK_KP5: - new_btn = BUTTON_PLAY; - break; - case SDLK_SPACE: - new_btn = BUTTON_RC_PLAY; - break; - case SDLK_KP_ENTER: - case SDLK_RETURN: - new_btn = BUTTON_RC_MENU; - break; - } - return new_btn; -} - -struct button_map bm[] = { - { SDLK_KP5, 256, 72, 29, "Play" }, - { SDLK_KP6, 255, 137, 28, "Right" }, - { SDLK_KP4, 257, 201, 26, "Left" }, - { SDLK_KP8, 338, 31, 27, "Up" }, - { SDLK_KP2, 339, 92, 23, "Down" }, - { SDLK_KP_PERIOD, 336, 50, 23, "Mode" }, - { SDLK_KP_DIVIDE, 336, 147, 23, "Rec" }, - { SDLK_h, 336, 212, 30, "Hold" }, - /* remote */ - { SDLK_SPACE, 115, 308, 20, "RC Play" }, - { SDLK_RIGHT, 85, 308, 20, "RC Rew" }, - { SDLK_LEFT, 143, 308, 20, "RC FF" }, - { SDLK_UP, 143, 498, 20, "RC Up" }, - { SDLK_DOWN, 85, 498, 20, "RC Down" }, - { SDLK_INSERT, 212, 308, 30, "RC Mode" }, - { SDLK_F1, 275, 308, 25, "RC Rec" }, - { SDLK_KP_ENTER, 115, 498, 20, "RC Menu" }, - { 0, 0, 0, 0, "None" } -}; diff --git a/uisimulator/buttonmap/iriver-h100_h300.c b/uisimulator/buttonmap/iriver-h100_h300.c index 5e4ad3bafc..e6ca389fc8 100644 --- a/uisimulator/buttonmap/iriver-h100_h300.c +++ b/uisimulator/buttonmap/iriver-h100_h300.c @@ -29,28 +29,6 @@ int key_to_button(int keyboard_button) int new_btn = BUTTON_NONE; switch (keyboard_button) { - 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; case SDLK_KP4: case SDLK_LEFT: new_btn = BUTTON_LEFT; diff --git a/uisimulator/buttonmap/touchscreen.c b/uisimulator/buttonmap/touchscreen.c index 746a6d5f20..90518c7c7e 100644 --- a/uisimulator/buttonmap/touchscreen.c +++ b/uisimulator/buttonmap/touchscreen.c @@ -26,7 +26,7 @@ #include "buttonmap.h" #include "touchscreen.h" -int key_to_touch(int keyboard_button) +int key_to_touch(int keyboard_button, unsigned int mouse_coords) { int new_btn = BUTTON_NONE; switch (keyboard_button) @@ -91,13 +91,6 @@ int key_to_touch(int keyboard_button) case SDLK_l: new_btn = BUTTON_BOTTOMRIGHT; break; - case SDLK_F4: - if(pressed) - { - touchscreen_set_mode(touchscreen_get_mode() == TOUCHSCREEN_POINT ? TOUCHSCREEN_BUTTON : TOUCHSCREEN_POINT); - printf("Touchscreen mode: %s\n", touchscreen_get_mode() == TOUCHSCREEN_POINT ? "TOUCHSCREEN_POINT" : "TOUCHSCREEN_BUTTON"); - } - break; } return new_btn; } -- cgit v1.2.3