townengine/src/twn_input_c.h

29 lines
530 B
C

#ifndef INPUT_INTERNAL_API_H
#define INPUT_INTERNAL_API_H
#include "twn_input.h"
#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;
void input_reset_state(InputState *input);
#endif