25 lines
424 B
C
25 lines
424 B
C
#ifndef __INPUT_H
|
|
#define __INPUT_H
|
|
|
|
typedef enum {
|
|
ACTION_ROTATE,
|
|
ACTION_MOVE_LEFT,
|
|
ACTION_MOVE_RIGHT,
|
|
ACTION_DROP,
|
|
ACTION_QUIT,
|
|
} action_t;
|
|
|
|
#define NUM_ACTIONS 5
|
|
|
|
void input_init();
|
|
|
|
void input_update();
|
|
|
|
// check if an action is triggered repeatedly.
|
|
int input_repeat(action_t action);
|
|
|
|
// check if an action is triggered once.
|
|
// eg. If a key was pressed.
|
|
int input_once(action_t action);
|
|
|
|
#endif /* !__INPUT_H */
|