diff options
Diffstat (limited to 'uisimulator/buttonmap')
-rw-r--r-- | uisimulator/buttonmap/SOURCES | 2 | ||||
-rw-r--r-- | uisimulator/buttonmap/mpio-hd300.c | 82 |
2 files changed, 84 insertions, 0 deletions
diff --git a/uisimulator/buttonmap/SOURCES b/uisimulator/buttonmap/SOURCES index 7ab80da5d3..c9955d408f 100644 --- a/uisimulator/buttonmap/SOURCES +++ b/uisimulator/buttonmap/SOURCES | |||
@@ -63,5 +63,7 @@ samsung-yh820_yh92x.c | |||
63 | pbell-vibe500.c | 63 | pbell-vibe500.c |
64 | #elif CONFIG_KEYPAD == MPIO_HD200_PAD | 64 | #elif CONFIG_KEYPAD == MPIO_HD200_PAD |
65 | mpio-hd200.c | 65 | mpio-hd200.c |
66 | #elif CONFIG_KEYPAD == MPIO_HD300_PAD | ||
67 | mpio-hd300.c | ||
66 | #endif | 68 | #endif |
67 | #endif /* SIMULATOR */ | 69 | #endif /* SIMULATOR */ |
diff --git a/uisimulator/buttonmap/mpio-hd300.c b/uisimulator/buttonmap/mpio-hd300.c new file mode 100644 index 0000000000..454e3a6d6f --- /dev/null +++ b/uisimulator/buttonmap/mpio-hd300.c | |||
@@ -0,0 +1,82 @@ | |||
1 | /*************************************************************************** | ||
2 | * __________ __ ___. | ||
3 | * Open \______ \ ____ ____ | | _\_ |__ _______ ___ | ||
4 | * Source | _// _ \_/ ___\| |/ /| __ \ / _ \ \/ / | ||
5 | * Jukebox | | ( <_> ) \___| < | \_\ ( <_> > < < | ||
6 | * Firmware |____|_ /\____/ \___ >__|_ \|___ /\____/__/\_ \ | ||
7 | * \/ \/ \/ \/ \/ | ||
8 | * $Id$ | ||
9 | * | ||
10 | * Copyright (C) 2010 Michael Leslie | ||
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 | |||
27 | int key_to_button(int keyboard_button) | ||
28 | { | ||
29 | int new_btn = BUTTON_NONE; | ||
30 | switch (keyboard_button) | ||
31 | { | ||
32 | |||
33 | case SDLK_UP: | ||
34 | new_btn = BUTTON_UP; | ||
35 | break; | ||
36 | case SDLK_DOWN: | ||
37 | new_btn = BUTTON_DOWN; | ||
38 | break; | ||
39 | |||
40 | case SDLK_LEFT: | ||
41 | new_btn = BUTTON_LEFT; | ||
42 | break; | ||
43 | case SDLK_RIGHT: | ||
44 | new_btn = BUTTON_RIGHT; | ||
45 | break; | ||
46 | |||
47 | case SDLK_SPACE: | ||
48 | case SDLK_ESCAPE: | ||
49 | new_btn = BUTTON_MENU; | ||
50 | break; | ||
51 | |||
52 | case SDLK_RETURN: | ||
53 | new_btn = BUTTON_ENTER; | ||
54 | break; | ||
55 | |||
56 | case SDLK_p: | ||
57 | new_btn = BUTTON_PLAY; | ||
58 | break; | ||
59 | |||
60 | case SDLK_r: | ||
61 | new_btn = BUTTON_REC; | ||
62 | break; | ||
63 | } | ||
64 | return new_btn; | ||
65 | } | ||
66 | |||
67 | struct button_map bm[] = { | ||
68 | { SDLK_LEFT, 98, 312, 15, "Rew" }, | ||
69 | { SDLK_RIGHT, 186, 312, 15, "FF" }, | ||
70 | |||
71 | { SDLK_ESCAPE, 90, 364, 40, "Menu" }, | ||
72 | { SDLK_RETURN, 196, 364, 40, "Enter" }, | ||
73 | |||
74 | { SDLK_r, 98, 410, 15, "Rec" }, | ||
75 | { SDLK_p, 186, 410, 15, "Play/Stop" }, | ||
76 | |||
77 | { SDLK_UP, 143, 315, 40, "Up" }, | ||
78 | { SDLK_DOWN, 143, 415, 40, "Down" }, | ||
79 | |||
80 | { SDLK_h, 116, 52, 20, "Hold" }, | ||
81 | { 0, 0, 0, 0, "None" } | ||
82 | }; | ||