Merge pull request #23 from tuluse/master
[picodrive.git] / platform / opendingux / inputmap.c
CommitLineData
d4bea61c
PC
1#include <stdlib.h>
2#include <SDL_keysym.h>
3
4#include "../libpicofe/input.h"
5#include "../libpicofe/in_sdl.h"
6#include "../common/input_pico.h"
7
8const struct in_default_bind in_sdl_defbinds[] = {
9 { SDLK_UP, IN_BINDTYPE_PLAYER12, GBTN_UP },
10 { SDLK_DOWN, IN_BINDTYPE_PLAYER12, GBTN_DOWN },
11 { SDLK_LEFT, IN_BINDTYPE_PLAYER12, GBTN_LEFT },
12 { SDLK_RIGHT, IN_BINDTYPE_PLAYER12, GBTN_RIGHT },
13 { SDLK_LSHIFT, IN_BINDTYPE_PLAYER12, GBTN_A },
14 { SDLK_LALT, IN_BINDTYPE_PLAYER12, GBTN_B },
15 { SDLK_LCTRL, IN_BINDTYPE_PLAYER12, GBTN_C },
16 { SDLK_RETURN, IN_BINDTYPE_PLAYER12, GBTN_START },
17 { SDLK_ESCAPE, IN_BINDTYPE_EMU, PEVB_MENU },
18 { SDLK_TAB, IN_BINDTYPE_EMU, PEVB_PICO_PPREV },
19 { SDLK_BACKSPACE, IN_BINDTYPE_EMU, PEVB_PICO_PNEXT },
20 { SDLK_BACKSPACE, IN_BINDTYPE_EMU, PEVB_STATE_SAVE },
21 { SDLK_TAB, IN_BINDTYPE_EMU, PEVB_STATE_LOAD },
22 { SDLK_SPACE, IN_BINDTYPE_EMU, PEVB_FF },
23 { 0, 0, 0 }
24};
25
26const struct menu_keymap in_sdl_key_map[] =
27{
28 { SDLK_UP, PBTN_UP },
29 { SDLK_DOWN, PBTN_DOWN },
30 { SDLK_LEFT, PBTN_LEFT },
31 { SDLK_RIGHT, PBTN_RIGHT },
32 { SDLK_LCTRL, PBTN_MOK },
33 { SDLK_LALT, PBTN_MBACK },
34 { SDLK_SPACE, PBTN_MA2 },
35 { SDLK_LSHIFT, PBTN_MA3 },
36 { SDLK_TAB, PBTN_L },
37 { SDLK_BACKSPACE, PBTN_R },
38};
39
40const char * const in_sdl_key_names[SDLK_LAST] = {
41 [SDLK_UP] = "UP",
42 [SDLK_DOWN] = "DOWN",
43 [SDLK_LEFT] = "LEFT",
44 [SDLK_RIGHT] = "RIGHT",
45 [SDLK_LCTRL] = "A",
46 [SDLK_LALT] = "B",
47 [SDLK_LSHIFT] = "X",
48 [SDLK_SPACE] = "Y",
49 [SDLK_TAB] = "L",
50 [SDLK_BACKSPACE] = "R",
51 [SDLK_RETURN] = "START",
52 [SDLK_ESCAPE] = "SELECT",
53 [SDLK_POWER] = "POWER",
54 [SDLK_PAUSE] = "LOCK",
55};