Input test.
This commit is contained in:
26
src/input.h
26
src/input.h
@ -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();
|
Reference in New Issue
Block a user