2024-08-21 13:55:34 +00:00
|
|
|
#ifndef INPUT_INTERNAL_API_H
|
|
|
|
#define INPUT_INTERNAL_API_H
|
|
|
|
|
2024-09-16 13:17:00 +00:00
|
|
|
#include "twn_input.h"
|
2024-10-06 20:49:05 +00:00
|
|
|
#include "twn_vec.h"
|
|
|
|
|
|
|
|
#include <SDL2/SDL.h>
|
|
|
|
|
|
|
|
|
|
|
|
union ButtonCode {
|
|
|
|
SDL_Scancode scancode;
|
|
|
|
SDL_Keycode keycode;
|
|
|
|
SDL_GameControllerButton gamepad_button;
|
|
|
|
uint8_t mouse_button; /* SDL_BUTTON_ enum */
|
|
|
|
};
|
|
|
|
|
|
|
|
|
|
|
|
/* an input to which an action is bound */
|
|
|
|
/* it is not limited to literal buttons */
|
|
|
|
typedef struct Button {
|
|
|
|
enum ButtonSource source;
|
|
|
|
union ButtonCode code;
|
|
|
|
} Button;
|
|
|
|
|
2024-08-21 13:55:34 +00:00
|
|
|
|
2024-09-23 17:43:16 +00:00
|
|
|
void input_reset_state(InputState *input);
|
2024-08-21 13:55:34 +00:00
|
|
|
|
|
|
|
#endif
|