Renamed KEYBOARD_KEYPRESS/RELEASE -> KEYBOARD_PRESSED/RELEASED
This commit is contained in:
@@ -175,7 +175,7 @@ void keyboard_handler() {
|
||||
code &= ~(1 << 7);
|
||||
keyboard_keyStates[code] = 0;
|
||||
e = &keyboard_events.data[keyboard_events.writei & BUFFER_MASK];
|
||||
e->type = KEYBOARD_KEYRELEASE;
|
||||
e->type = KEYBOARD_RELEASED;
|
||||
e->code = code;
|
||||
e->isrepeat = 0;
|
||||
keyboard_events.writei++;
|
||||
@@ -186,7 +186,7 @@ void keyboard_handler() {
|
||||
if (!isrepeat || keyboard_allowKeyRepeat) {
|
||||
keyboard_keyStates[code] = 1;
|
||||
e = &keyboard_events.data[keyboard_events.writei & BUFFER_MASK];
|
||||
e->type = KEYBOARD_KEYPRESS;
|
||||
e->type = KEYBOARD_PRESSED;
|
||||
e->code = code;
|
||||
e->isrepeat = isrepeat;
|
||||
keyboard_events.writei++;
|
||||
|
||||
@@ -17,8 +17,8 @@ typedef struct {
|
||||
} keyboard_Event;
|
||||
|
||||
enum {
|
||||
KEYBOARD_KEYPRESS,
|
||||
KEYBOARD_KEYRELEASE,
|
||||
KEYBOARD_PRESSED,
|
||||
KEYBOARD_RELEASED,
|
||||
KEYBOARD_TEXTINPUT
|
||||
};
|
||||
|
||||
|
||||
@@ -36,15 +36,15 @@ int l_keyboard_poll(lua_State *L) {
|
||||
|
||||
while (keyboard_poll(&e)) {
|
||||
|
||||
if (e.type == KEYBOARD_KEYPRESS || e.type == KEYBOARD_KEYRELEASE) {
|
||||
if (e.type == KEYBOARD_PRESSED || e.type == KEYBOARD_RELEASED) {
|
||||
lua_newtable(L);
|
||||
lua_pushstring(L, e.type == KEYBOARD_KEYPRESS ? "down" : "up");
|
||||
lua_pushstring(L, e.type == KEYBOARD_PRESSED ? "down" : "up");
|
||||
lua_setfield(L, -2, "type");
|
||||
lua_pushnumber(L, e.code);
|
||||
lua_setfield(L, -2, "code");
|
||||
lua_pushstring(L, e.key);
|
||||
lua_setfield(L, -2, "key");
|
||||
if (e.type == KEYBOARD_KEYPRESS) {
|
||||
if (e.type == KEYBOARD_PRESSED) {
|
||||
lua_pushboolean(L, e.isrepeat);
|
||||
lua_setfield(L, -2, "isrepeat");
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user