1 #ifndef INPUT_MANAGER_HPP 2 #define INPUT_MANAGER_HPP 8 static const unsigned int N_KEY_INPUTS = 1024;
9 static const unsigned int N_BUTTON_INPUTS = 6;
12 LEFT_MOUSE, RIGHT_MOUSE, MIDDLE_MOUSE,
14 LEFT, RIGHT, UP, DOWN,
15 ATTACK_LEFT, ATTACK_RIGHT, ATTACK_UP, ATTACK_DOWN,
17 ACTION_1, ACTION_2, ACTION_3, ACTION_4,
18 UTIL_1, UTIL_2, UTIL_3,
24 static const std::map<SDL_Keycode, Input> INPUT_MAP = {
25 {SDLK_LEFT, Input::LEFT},
26 {SDLK_a, Input::LEFT},
27 {SDLK_RIGHT, Input::RIGHT},
28 {SDLK_d, Input::RIGHT},
31 {SDLK_DOWN, Input::DOWN},
32 {SDLK_s, Input::DOWN},
34 {SDLK_j, Input::ATTACK_LEFT},
35 {SDLK_l, Input::ATTACK_RIGHT},
36 {SDLK_k, Input::ATTACK_DOWN},
37 {SDLK_i, Input::ATTACK_UP},
39 {SDLK_SPACE, Input::JUMP},
41 {SDLK_q, Input::ACTION_1},
42 {SDLK_e, Input::ACTION_2},
43 {SDLK_r, Input::ACTION_3},
44 {SDLK_f, Input::ACTION_4},
46 {SDLK_z, Input::UTIL_1},
47 {SDLK_x, Input::UTIL_2},
48 {SDLK_c, Input::UTIL_3},
50 {SDLK_RETURN, Input::ENTER},
51 {SDLK_ESCAPE, Input::QUIT}
54 static const std::map<int, Input> MOUSE_BUTTON_MAP = {
55 {SDL_BUTTON_LEFT, Input::LEFT_MOUSE},
56 {SDL_BUTTON_MIDDLE, Input::MIDDLE_MOUSE},
57 {SDL_BUTTON_RIGHT, Input::RIGHT_MOUSE}
Basic class representation of a vector 2 with an x and y coordinate.
Definition: Vector2.hpp:8