input system rework
This commit is contained in:
@ -13,7 +13,6 @@
|
||||
|
||||
union ButtonCode {
|
||||
SDL_Scancode scancode;
|
||||
SDL_Keycode keycode;
|
||||
SDL_GameControllerButton gamepad_button;
|
||||
uint8_t mouse_button; /* SDL_BUTTON_ enum */
|
||||
};
|
||||
@ -22,7 +21,6 @@ union ButtonCode {
|
||||
typedef enum ButtonSource {
|
||||
BUTTON_SOURCE_NOT_SET,
|
||||
BUTTON_SOURCE_KEYBOARD_PHYSICAL,
|
||||
BUTTON_SOURCE_KEYBOARD_CHARACTER,
|
||||
BUTTON_SOURCE_GAMEPAD,
|
||||
BUTTON_SOURCE_MOUSE,
|
||||
} ButtonSource;
|
||||
@ -70,6 +68,14 @@ typedef struct InputState {
|
||||
} InputState;
|
||||
|
||||
|
||||
typedef struct ControlDesc {
|
||||
union {
|
||||
SDL_Scancode scancode;
|
||||
uint8_t mouse_button;
|
||||
};
|
||||
} ControlDesc;
|
||||
|
||||
|
||||
void input_state_init(InputState *input);
|
||||
|
||||
void input_state_deinit(InputState *input);
|
||||
|
Reference in New Issue
Block a user