Separated lua bindings from keyboard.c

This commit is contained in:
rxi
2016-10-15 15:35:08 +01:00
parent 3de597d997
commit a19dad718a
3 changed files with 183 additions and 125 deletions

View File

@@ -1,4 +1,4 @@
/**
/**
* Copyright (c) 2016 rxi
*
* This library is free software; you can redistribute it and/or modify it
@@ -8,7 +8,24 @@
#ifndef KEYBOARD_H
#define KEYBOARD_H
typedef struct {
int type;
unsigned code;
const char *key;
char text[64];
int isrepeat;
} keyboard_Event;
enum {
KEYBOARD_KEYPRESS,
KEYBOARD_KEYRELEASE,
KEYBOARD_TEXTINPUT
};
int keyboard_init(void);
void keyboard_deinit(void);
void keyboard_setKeyRepeat(int allow);
int keyboard_isDown(const char *key);
int keyboard_poll(keyboard_Event *e);
#endif