summaryrefslogtreecommitdiff
path: root/uisimulator/buttonmap/gogear-hdd6330.c
diff options
context:
space:
mode:
authorSzymon Dziok <b0hoon@o2.pl>2010-10-21 22:20:16 +0000
committerSzymon Dziok <b0hoon@o2.pl>2010-10-21 22:20:16 +0000
commitc8dfe0508e176b87594f12a67467d51715f53a54 (patch)
tree2c5e8be6a0986cf29dc0f4628671a1abf7b2c0c0 /uisimulator/buttonmap/gogear-hdd6330.c
parent93ac9868670f3005813c7443988a612c8bab96e3 (diff)
downloadrockbox-c8dfe0508e176b87594f12a67467d51715f53a54.tar.gz
rockbox-c8dfe0508e176b87594f12a67467d51715f53a54.zip
HDD6330: add the simulator.
git-svn-id: svn://svn.rockbox.org/rockbox/trunk@28323 a1c6a512-1295-4272-9138-f99709370657
Diffstat (limited to 'uisimulator/buttonmap/gogear-hdd6330.c')
-rw-r--r--uisimulator/buttonmap/gogear-hdd6330.c79
1 files changed, 79 insertions, 0 deletions
diff --git a/uisimulator/buttonmap/gogear-hdd6330.c b/uisimulator/buttonmap/gogear-hdd6330.c
new file mode 100644
index 0000000000..ee3ad56971
--- /dev/null
+++ b/uisimulator/buttonmap/gogear-hdd6330.c
@@ -0,0 +1,79 @@
1/***************************************************************************
2 * __________ __ ___.
3 * Open \______ \ ____ ____ | | _\_ |__ _______ ___
4 * Source | _// _ \_/ ___\| |/ /| __ \ / _ \ \/ /
5 * Jukebox | | ( <_> ) \___| < | \_\ ( <_> > < <
6 * Firmware |____|_ /\____/ \___ >__|_ \|___ /\____/__/\_ \
7 * \/ \/ \/ \/ \/
8 * $Id$
9 *
10 * Copyright (C) 2010 Szymon Dziok
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 "button.h"
25#include "buttonmap.h"
26
27int key_to_button(int keyboard_button)
28{
29 int new_btn = BUTTON_NONE;
30 switch (keyboard_button)
31 {
32 case SDLK_KP4:
33 case SDLK_LEFT:
34 new_btn = BUTTON_LEFT;
35 break;
36 case SDLK_KP6:
37 case SDLK_RIGHT:
38 new_btn = BUTTON_RIGHT;
39 break;
40 case SDLK_KP8:
41 case SDLK_UP:
42 new_btn = BUTTON_UP;
43 break;
44 case SDLK_KP2:
45 case SDLK_DOWN:
46 new_btn = BUTTON_DOWN;
47 break;
48 case SDLK_KP5:
49 case SDLK_SPACE:
50 new_btn = BUTTON_PLAY;
51 break;
52 case SDLK_KP7:
53 new_btn = BUTTON_PREV;
54 break;
55 case SDLK_KP9:
56 new_btn = BUTTON_NEXT;
57 break;
58 case SDLK_KP1:
59 new_btn = BUTTON_MENU;
60 break;
61 case SDLK_KP3:
62 new_btn = BUTTON_VIEW;
63 break;
64 case SDLK_KP_MULTIPLY:
65 new_btn = BUTTON_POWER;
66 break;
67 case SDLK_KP_PLUS:
68 new_btn = BUTTON_VOL_UP;
69 break;
70 case SDLK_KP_MINUS:
71 new_btn = BUTTON_VOL_DOWN;
72 break;
73 }
74 return new_btn;
75}
76
77struct button_map bm[] = {
78 { 0, 0, 0, 0, "None" }
79};