Move all input handling into input module

This commit is contained in:
2025-10-18 17:43:22 +01:00
parent f992dd3d39
commit 79dc3c1256
5 changed files with 88 additions and 103 deletions

15
input.h
View File

@@ -1,15 +1,20 @@
#ifndef INPUT_H
#define INPUT_H
typedef void (*input_callback_t)(int key);
typedef void (*input_callback_t)();
typedef struct {
int spin;
int thrust;
bool quit;
} input_state_t;
extern input_state_t input;
int input_init();
void input_cleanup();
void input_on_press(input_callback_t cb);
void input_on_release(input_callback_t cb);
void input_on_repeat(input_callback_t cb);
void input_on_shoot(input_callback_t cb);
void input_handle();
#endif