jtmm2/inc/input.h

31 lines
412 B
C
Raw Normal View History

2021-12-15 23:55:44 +01:00
#pragma once
2021-12-19 00:30:09 +01:00
enum Key {
K_LEFT,
K_RIGHT,
K_UP,
K_DOWN,
K_JUMP,
K_POLARITY,
K_EXIT,
2021-12-20 18:00:17 +01:00
K_SKIP,
2021-12-19 00:30:09 +01:00
K_EDITOR,
K_SCROLL_UP,
K_SCROLL_DOWN,
2021-12-21 00:14:49 +01:00
K_DEBUG,
2021-12-19 00:30:09 +01:00
K_COUNT
};
2021-12-15 23:55:44 +01:00
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);