9 /// Maps SDL key events to virtual buttons.
10 /// Records the state and whether it was pressed/released in the current
12 /// Multiple buttons can be passed by ORing them bitwise.
13 /// The MapKey(SDLKey, Button) function introduces a mapping for the given key
14 /// to the given virtual button. Each key can be assigned to one button only,
15 /// but there is no limit (well, except for memory, I guess) on how many keys
16 /// may map to the same button.
17 /// Each iteration should first call ResetInteractiveState() to drop the just
18 /// pressed/released information and then pass each SDL_KeyboardEvent to
19 /// HandleKeyboardEvent(const SDL_KeyboardEvent &).
20 /// The four DEBUG_? buttons do not map to any real SNES/Lufia 2 button and may
21 /// be used for debugging or non-gameplay-related input.
36 SHOULDER_RIGHT = 0x0400,
37 SHOULDER_LEFT = 0x0800,
49 bool IsDown(int b) const {
52 bool JustPressed(int b) const {
55 bool JustReleased(int b) const {
60 void ResetInteractiveState() {
64 void HandleKeyboardEvent(const SDL_KeyboardEvent &);
67 void MapKey(SDLKey k, Button b) {
72 std::map<SDLKey, Button> mapping;
81 #endif /* APP_INPUT_H_ */