#ifndef IZ_KEYBOARD_H #define IZ_KEYBOARD_H #include #include #include #include "../IZ_action.h" #include "../IZ_config.h" typedef struct { SDL_KeyCode control_mapping[CONTROLS]; } IZ_KeyboardConfig; typedef struct { IZ_KeyboardConfig config; } IZ_KeyboardState; static const SDL_KeyCode IZ_DEFAULT_KEYBOARD_CONTROLS[PLAYERS][CONTROLS] = { { SDLK_UP, SDLK_RIGHT, SDLK_DOWN, SDLK_LEFT, SDLK_RETURN, // yes SDLK_BACKSPACE, // no SDLK_a, // action0 SDLK_s, // action1 SDLK_d, // action2 SDLK_f, // action3 SDLK_z, // action4 SDLK_x, // action5 SDLK_c, // action6 SDLK_v, // action7 SDLK_w, // action8 SDLK_e, // action9 }, }; void IZ_LoadKeyboardConfig(IZ_KeyboardConfig*, uint8_t); void IZ_SaveKeyboardConfig(IZ_KeyboardConfig*, uint8_t); void IZ_HandleKeyboardEvents(SDL_Event, IZ_KeyboardState*, IZ_Action*); #endif