Input test.

This commit is contained in:
2025-06-08 17:36:13 -05:00
parent 5cc38e14d6
commit 2309fea9f3
17 changed files with 301 additions and 19 deletions

View File

@ -7,19 +7,39 @@
#pragma once
#include "dusk.h"
#include <termios.h>
#define INPUT_UP (1 << 0)
#define INPUT_DOWN (1 << 1)
#define INPUT_LEFT (1 << 2)
#define INPUT_RIGHT (1 << 3)
#define INPUT_ACTION (1 << 4)
#define INPUT_CANCEL (1 << 5)
#define INPUT_BUFFER_SIZE 128
typedef struct {
char_t input;
uint8_t current;
uint8_t previous;
bool_t isRawMode;
struct termios origin;
} input_t;
extern input_t INPUT;
typedef struct {
char_t *key;
uint8_t value;
} inputmap_t;
extern inputmap_t INPUT_MAP[];
/**
* Initializes the input system.
*/
void inputInit(void);
void inputInit();
/**
* Updates the input system.
*/
void inputUpdate(void);
void inputUpdate();