summaryrefslogtreecommitdiff
path: root/uisimulator/buttonmap/samsung-yh820_yh92x.c
diff options
context:
space:
mode:
Diffstat (limited to 'uisimulator/buttonmap/samsung-yh820_yh92x.c')
-rw-r--r--uisimulator/buttonmap/samsung-yh820_yh92x.c94
1 files changed, 94 insertions, 0 deletions
diff --git a/uisimulator/buttonmap/samsung-yh820_yh92x.c b/uisimulator/buttonmap/samsung-yh820_yh92x.c
new file mode 100644
index 0000000000..0f12c77df3
--- /dev/null
+++ b/uisimulator/buttonmap/samsung-yh820_yh92x.c
@@ -0,0 +1,94 @@
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#ifdef SAMSUNG_YH820
58 case SDLK_KP7:
59#else
60 case SDLK_KP3:
61#endif
62 case SDLK_PAGEDOWN:
63 new_btn = BUTTON_REW;
64 break;
65 case SDLK_KP_PLUS:
66 new_btn = BUTTON_REC;
67 break;
68 }
69 return new_btn;
70}
71
72struct 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" },
84 { SDLK_KP5, 369, 84, 25, "Play" },
85 { SDLK_KP5, 367, 125, 27, "Play" },
86 { SDLK_KP3, 369, 188, 17, "Rew" },
87 { SDLK_KP_PLUS, 370, 330, 30, "Record" },
88 { SDLK_KP4, 146, 252, 32, "Menu" },
89 { SDLK_KP8, 204, 226, 27, "Up" },
90 { SDLK_KP6, 257, 250, 34, "Select" },
91 { SDLK_KP2, 205, 294, 35, "Down" },
92#endif
93 { 0, 0, 0, 0, "None" }
94};