diff options
Diffstat (limited to 'uisimulator/buttonmap/gigabeat-s.c')
-rw-r--r-- | uisimulator/buttonmap/gigabeat-s.c | 79 |
1 files changed, 79 insertions, 0 deletions
diff --git a/uisimulator/buttonmap/gigabeat-s.c b/uisimulator/buttonmap/gigabeat-s.c new file mode 100644 index 0000000000..98a8489446 --- /dev/null +++ b/uisimulator/buttonmap/gigabeat-s.c | |||
@@ -0,0 +1,79 @@ | |||
1 | n/*************************************************************************** | ||
2 | * __________ __ ___. | ||
3 | * Open \______ \ ____ ____ | | _\_ |__ _______ ___ | ||
4 | * Source | _// _ \_/ ___\| |/ /| __ \ / _ \ \/ / | ||
5 | * Jukebox | | ( <_> ) \___| < | \_\ ( <_> > < < | ||
6 | * Firmware |____|_ /\____/ \___ >__|_ \|___ /\____/__/\_ \ | ||
7 | * \/ \/ \/ \/ \/ | ||
8 | * $Id$ | ||
9 | * | ||
10 | * Copyright (C) 2008 by Will Robertson | ||
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 | int key_to_button(int keyboard_button) | ||
24 | { | ||
25 | int new_btn = BUTTON_NONE; | ||
26 | switch (keyboard_button) | ||
27 | { | ||
28 | case SDLK_KP4: | ||
29 | case SDLK_LEFT: | ||
30 | new_btn = BUTTON_LEFT; | ||
31 | break; | ||
32 | case SDLK_KP6: | ||
33 | case SDLK_RIGHT: | ||
34 | new_btn = BUTTON_RIGHT; | ||
35 | break; | ||
36 | case SDLK_KP8: | ||
37 | case SDLK_UP: | ||
38 | new_btn = BUTTON_UP; | ||
39 | break; | ||
40 | case SDLK_KP2: | ||
41 | case SDLK_DOWN: | ||
42 | new_btn = BUTTON_DOWN; | ||
43 | break; | ||
44 | case SDLK_F8: | ||
45 | case SDLK_ESCAPE: | ||
46 | new_btn = BUTTON_POWER; | ||
47 | break; | ||
48 | case SDLK_KP_PLUS: | ||
49 | case SDLK_KP_ENTER: | ||
50 | case SDLK_RETURN: | ||
51 | new_btn = BUTTON_PLAY; | ||
52 | break; | ||
53 | case SDLK_KP7: | ||
54 | new_btn = BUTTON_BACK; | ||
55 | break; | ||
56 | case SDLK_KP5: | ||
57 | case SDLK_SPACE: | ||
58 | new_btn = BUTTON_SELECT; | ||
59 | break; | ||
60 | case SDLK_KP9: | ||
61 | case SDLK_KP_PERIOD: | ||
62 | case SDLK_INSERT: | ||
63 | new_btn = BUTTON_MENU; | ||
64 | break; | ||
65 | } | ||
66 | return new_btn; | ||
67 | } | ||
68 | |||
69 | struct button_map bm[] = { | ||
70 | { SDLK_KP_PLUS, 416, 383, 23, "Play" }, | ||
71 | { SDLK_KP7, 135, 442, 46, "Back" }, | ||
72 | { SDLK_KP9, 288, 447, 35, "Menu" }, | ||
73 | { SDLK_KP8, 214, 480, 32, "Up" }, | ||
74 | { SDLK_KP4, 128, 558, 33, "Left" }, | ||
75 | { SDLK_KP5, 214, 556, 34, "Select" }, | ||
76 | { SDLK_KP6, 293, 558, 35, "Right" }, | ||
77 | { SDLK_KP2, 214, 637, 38, "Down" }, | ||
78 | { 0, 0, 0, 0, "None" } | ||
79 | }; | ||