summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--uisimulator/buttonmap/SOURCES6
-rw-r--r--uisimulator/buttonmap/samsung-yh820.c78
-rw-r--r--uisimulator/buttonmap/samsung-yh92x.c (renamed from uisimulator/buttonmap/samsung-yh820_yh92x.c)15
3 files changed, 82 insertions, 17 deletions
diff --git a/uisimulator/buttonmap/SOURCES b/uisimulator/buttonmap/SOURCES
index 26567d3e53..6b248e9324 100644
--- a/uisimulator/buttonmap/SOURCES
+++ b/uisimulator/buttonmap/SOURCES
@@ -57,8 +57,10 @@ gogear-hdd6330.c
57onda-vx747.c 57onda-vx747.c
58#elif CONFIG_KEYPAD == ONDAVX777_PAD 58#elif CONFIG_KEYPAD == ONDAVX777_PAD
59onda-vx777.c 59onda-vx777.c
60#elif CONFIG_KEYPAD == SAMSUNG_YH_PAD 60#elif CONFIG_KEYPAD == SAMSUNG_YH820_PAD
61samsung-yh820_yh92x.c 61samsung-yh820.c
62#elif CONFIG_KEYPAD == SAMSUNG_YH920_PAD
63samsung-yh92x.c
62#elif CONFIG_KEYPAD == PBELL_VIBE500_PAD 64#elif CONFIG_KEYPAD == PBELL_VIBE500_PAD
63pbell-vibe500.c 65pbell-vibe500.c
64#elif CONFIG_KEYPAD == MPIO_HD200_PAD 66#elif CONFIG_KEYPAD == MPIO_HD200_PAD
diff --git a/uisimulator/buttonmap/samsung-yh820.c b/uisimulator/buttonmap/samsung-yh820.c
new file mode 100644
index 0000000000..02836fe8f4
--- /dev/null
+++ b/uisimulator/buttonmap/samsung-yh820.c
@@ -0,0 +1,78 @@
1/***************************************************************************
2 * __________ __ ___.
3 * Open \______ \ ____ ____ | | _\_ |__ _______ ___
4 * Source | _// _ \_/ ___\| |/ /| __ \ / _ \ \/ /
5 * Jukebox | | ( <_> ) \___| < | \_\ ( <_> > < <
6 * Firmware |____|_ /\____/ \___ >__|_ \|___ /\____/__/\_ \
7 * \/ \/ \/ \/ \/
8 * $Id$
9 *
10 * Copyright (C) 2009 Mark Arigo
11 *
12 * This program is free software; you can redistribute it and/or
13 * modify it under the terms of the GNU General Public License
14 * as published by the Free Software Foundation; either version 2
15 * of the License, or (at your option) any later version.
16 *
17 * This software is distributed on an "AS IS" basis, WITHOUT WARRANTY OF ANY
18 * KIND, either express or implied.
19 *
20 ****************************************************************************/
21
22
23#include <SDL.h>
24#include "config.h"
25#include "button.h"
26#include "buttonmap.h"
27
28int key_to_button(int keyboard_button)
29{
30 int new_btn = BUTTON_NONE;
31 switch (keyboard_button)
32 {
33 case SDLK_KP4:
34 case SDLK_LEFT:
35 new_btn = BUTTON_LEFT;
36 break;
37 case SDLK_KP6:
38 case SDLK_RIGHT:
39 new_btn = BUTTON_RIGHT;
40 break;
41 case SDLK_KP8:
42 case SDLK_UP:
43 new_btn = BUTTON_UP;
44 break;
45 case SDLK_KP2:
46 case SDLK_DOWN:
47 new_btn = BUTTON_DOWN;
48 break;
49 case SDLK_KP5:
50 case SDLK_KP_ENTER:
51 new_btn = BUTTON_PLAY;
52 break;
53 case SDLK_KP9:
54 case SDLK_PAGEUP:
55 new_btn = BUTTON_FFWD;
56 break;
57 case SDLK_KP7:
58 case SDLK_PAGEDOWN:
59 new_btn = BUTTON_REW;
60 break;
61 case SDLK_KP_PLUS:
62 new_btn = BUTTON_REC;
63 break;
64 }
65 return new_btn;
66}
67
68struct button_map bm[] = {
69 { SDLK_KP_PLUS, 330, 53, 23, "Record" },
70 { SDLK_KP7, 132, 208, 21, "Left" },
71 { SDLK_KP5, 182, 210, 18, "Play" },
72 { SDLK_KP9, 234, 211, 22, "Right" },
73 { SDLK_KP8, 182, 260, 15, "Up" },
74 { SDLK_KP4, 122, 277, 29, "Menu" },
75 { SDLK_KP6, 238, 276, 25, "Select" },
76 { SDLK_KP2, 183, 321, 24, "Down" },
77 { 0, 0, 0, 0, "None" }
78};
diff --git a/uisimulator/buttonmap/samsung-yh820_yh92x.c b/uisimulator/buttonmap/samsung-yh92x.c
index 0f12c77df3..995f9c8a7e 100644
--- a/uisimulator/buttonmap/samsung-yh820_yh92x.c
+++ b/uisimulator/buttonmap/samsung-yh92x.c
@@ -54,11 +54,7 @@ int key_to_button(int keyboard_button)
54 case SDLK_PAGEUP: 54 case SDLK_PAGEUP:
55 new_btn = BUTTON_FFWD; 55 new_btn = BUTTON_FFWD;
56 break; 56 break;
57#ifdef SAMSUNG_YH820
58 case SDLK_KP7:
59#else
60 case SDLK_KP3: 57 case SDLK_KP3:
61#endif
62 case SDLK_PAGEDOWN: 58 case SDLK_PAGEDOWN:
63 new_btn = BUTTON_REW; 59 new_btn = BUTTON_REW;
64 break; 60 break;
@@ -70,16 +66,6 @@ int key_to_button(int keyboard_button)
70} 66}
71 67
72struct button_map bm[] = { 68struct button_map bm[] = {
73#if defined (SAMSUNG_YH820)
74 { SDLK_KP_PLUS, 330, 53, 23, "Record" },
75 { SDLK_KP7, 132, 208, 21, "Left" },
76 { SDLK_KP5, 182, 210, 18, "Play" },
77 { SDLK_KP9, 234, 211, 22, "Right" },
78 { SDLK_KP8, 182, 260, 15, "Up" },
79 { SDLK_KP4, 122, 277, 29, "Menu" },
80 { SDLK_KP6, 238, 276, 25, "Select" },
81 { SDLK_KP2, 183, 321, 24, "Down" },
82#elif defined (SAMSUNG_YH920) || defined (SAMSUNG_YH925)
83 { SDLK_KP9, 370, 32, 15, "FF" }, 69 { SDLK_KP9, 370, 32, 15, "FF" },
84 { SDLK_KP5, 369, 84, 25, "Play" }, 70 { SDLK_KP5, 369, 84, 25, "Play" },
85 { SDLK_KP5, 367, 125, 27, "Play" }, 71 { SDLK_KP5, 367, 125, 27, "Play" },
@@ -89,6 +75,5 @@ struct button_map bm[] = {
89 { SDLK_KP8, 204, 226, 27, "Up" }, 75 { SDLK_KP8, 204, 226, 27, "Up" },
90 { SDLK_KP6, 257, 250, 34, "Select" }, 76 { SDLK_KP6, 257, 250, 34, "Select" },
91 { SDLK_KP2, 205, 294, 35, "Down" }, 77 { SDLK_KP2, 205, 294, 35, "Down" },
92#endif
93 { 0, 0, 0, 0, "None" } 78 { 0, 0, 0, 0, "None" }
94}; 79};