summaryrefslogtreecommitdiff
path: root/uisimulator/buttonmap/samsung-yh92x.c
diff options
context:
space:
mode:
authorSzymon Dziok <b0hoon@o2.pl>2014-05-24 01:12:02 +0000
committerSzymon Dziok <b0hoon@o2.pl>2014-05-24 01:12:02 +0000
commitc03e665badb8dd5e322b6d75e77a213488e79845 (patch)
treec723576f7663fb511b9a2cba56377cb433a55fdd /uisimulator/buttonmap/samsung-yh92x.c
parent7f7aee3f2457818547ec065ddd65bea0b3a68983 (diff)
downloadrockbox-c03e665badb8dd5e322b6d75e77a213488e79845.tar.gz
rockbox-c03e665badb8dd5e322b6d75e77a213488e79845.zip
Fix the simulators.
Change-Id: I9663f709b5979fffea3962e2062de3821a264c23
Diffstat (limited to 'uisimulator/buttonmap/samsung-yh92x.c')
-rw-r--r--uisimulator/buttonmap/samsung-yh92x.c79
1 files changed, 79 insertions, 0 deletions
diff --git a/uisimulator/buttonmap/samsung-yh92x.c b/uisimulator/buttonmap/samsung-yh92x.c
new file mode 100644
index 0000000000..995f9c8a7e
--- /dev/null
+++ b/uisimulator/buttonmap/samsung-yh92x.c
@@ -0,0 +1,79 @@
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_KP3:
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_KP9, 370, 32, 15, "FF" },
70 { SDLK_KP5, 369, 84, 25, "Play" },
71 { SDLK_KP5, 367, 125, 27, "Play" },
72 { SDLK_KP3, 369, 188, 17, "Rew" },
73 { SDLK_KP_PLUS, 370, 330, 30, "Record" },
74 { SDLK_KP4, 146, 252, 32, "Menu" },
75 { SDLK_KP8, 204, 226, 27, "Up" },
76 { SDLK_KP6, 257, 250, 34, "Select" },
77 { SDLK_KP2, 205, 294, 35, "Down" },
78 { 0, 0, 0, 0, "None" }
79};