From 44d503ae22bc929785f8ef0d52f388b37314fd88 Mon Sep 17 00:00:00 2001 From: John Alanbrook Date: Fri, 16 Dec 2022 19:29:50 +0000 Subject: [PATCH] Added stringifying escape & F keys; add sound, sys FFI; unconflict time.h and timer.h --- source/engine/input.c | 34 +++++++++++++++++++++++++++++++++- 1 file changed, 33 insertions(+), 1 deletion(-) diff --git a/source/engine/input.c b/source/engine/input.c index a226a3a..d594513 100644 --- a/source/engine/input.c +++ b/source/engine/input.c @@ -104,9 +104,41 @@ void win_key_callback(GLFWwindow *w, int key, int scancode, int action, int mods case GLFW_KEY_DOWN: kkey = "down"; break; +<<<<<<< HEAD } strcat(keystr, kkey); +======= + + case GLFW_KEY_LEFT_SHIFT: + kkey = "lshift"; + break; + + case GLFW_KEY_RIGHT_SHIFT: + kkey = "rshift"; + break; + + case GLFW_KEY_LEFT_CONTROL: + kkey = "lctrl"; + break; + + case GLFW_KEY_LEFT_ALT: + kkey = "lalt"; + break; + + case GLFW_KEY_RIGHT_CONTROL: + kkey = "rctrl"; + break; + + case GLFW_KEY_RIGHT_ALT: + kkey= "ralt"; + break; + } + + if (kkey) + strcat(keystr, kkey); + else + YughWarn("Could not get key string for key %d, scancode %d.", key, scancode); } @@ -190,4 +222,4 @@ int want_quit() { void quit() { YughInfo("Exiting game."); mquit = 1; -} \ No newline at end of file +}