4 * Created on: Aug 6, 2012
16 /// Maps SDL key events to virtual buttons.
17 /// Records the state and whether it was pressed/released in the current
19 /// Multiple buttons can be passed by ORing them bitwise.
20 /// The MapKey(SDLKey, Button) function introduces a mapping for the given key
21 /// to the given virtual button. Each key can be assigned to one button only,
22 /// but there is no limit (well, except for memory, I guess) on how many keys
23 /// may map to the same button.
24 /// Each iteration should first call ResetInteractiveState() to drop the just
25 /// pressed/released information and then pass each SDL_KeyboardEvent to
26 /// HandleKeyboardEvent(const SDL_KeyboardEvent &).
27 /// The four DEBUG_? buttons do not map to any real SNES/Lufia 2 button and may
28 /// be used for debugging or non-gameplay-related input.
43 SHOULDER_RIGHT = 0x0400,
44 SHOULDER_LEFT = 0x0800,
56 bool IsDown(int b) const {
59 bool JustPressed(int b) const {
62 bool JustReleased(int b) const {
67 void ResetInteractiveState() {
71 void HandleKeyboardEvent(const SDL_KeyboardEvent &);
74 void MapKey(SDLKey k, Button b) {
79 std::map<SDLKey, Button> mapping;
88 #endif /* APP_INPUT_H_ */