From d8210bfc354f51bb42f57125952ab035473a24ab Mon Sep 17 00:00:00 2001 From: rxi Date: Sat, 15 Oct 2016 16:31:07 +0100 Subject: [PATCH] Renamed KEYBOARD_KEYPRESS/RELEASE -> KEYBOARD_PRESSED/RELEASED --- src/keyboard.c | 4 ++-- src/keyboard.h | 4 ++-- src/modules/l_keyboard.c | 6 +++--- 3 files changed, 7 insertions(+), 7 deletions(-) diff --git a/src/keyboard.c b/src/keyboard.c index 533dba5..f159f37 100644 --- a/src/keyboard.c +++ b/src/keyboard.c @@ -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++; diff --git a/src/keyboard.h b/src/keyboard.h index 5d6f795..364fa79 100644 --- a/src/keyboard.h +++ b/src/keyboard.h @@ -17,8 +17,8 @@ typedef struct { } keyboard_Event; enum { - KEYBOARD_KEYPRESS, - KEYBOARD_KEYRELEASE, + KEYBOARD_PRESSED, + KEYBOARD_RELEASED, KEYBOARD_TEXTINPUT }; diff --git a/src/modules/l_keyboard.c b/src/modules/l_keyboard.c index 192c846..ab512c0 100644 --- a/src/modules/l_keyboard.c +++ b/src/modules/l_keyboard.c @@ -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"); }