24 lines
433 B
C
24 lines
433 B
C
#ifndef KEYBOARD_H
|
|
#define KEYBOARD_H
|
|
|
|
#include <SDL2/SDL_events.h>
|
|
#include "vector2d.h"
|
|
#include "keycodes.h"
|
|
|
|
#define EVENT_KEY_UP SDL_KEYUP
|
|
#define EVENT_KEY_DOWN SDL_KEYDOWN
|
|
#define EVENT_QUIT SDL_QUIT
|
|
|
|
typedef struct event_t {
|
|
uint32_t type;
|
|
SDL_Scancode key;
|
|
} event_t;
|
|
|
|
int pollevent(event_t *event);
|
|
|
|
typedef struct events_t {
|
|
vector2d_t cursor_pos;
|
|
bool keys[MAX_KEYCODES];
|
|
} events_t;
|
|
|
|
#endif // KEYBOARD_H
|