jtmm2/inc/input.h

17 lines
332 B
C

#pragma once
enum Key { K_LEFT, K_RIGHT, K_UP, K_DOWN, K_JUMP, K_EXIT, K_COUNT };
enum KeyState { KS_UP, KS_DOWN, KS_PRESS };
struct Input {
enum Key keys[K_COUNT];
enum KeyState states[K_COUNT];
};
void input_init(void);
void input_update(void);
int input_down(enum Key);
int input_pressed(enum Key);
int input_up(enum Key);