diff options
| author | raysan5 <raysan5@gmail.com> | 2016-03-06 19:30:16 +0100 |
|---|---|---|
| committer | raysan5 <raysan5@gmail.com> | 2016-03-06 19:30:16 +0100 |
| commit | 6ee5718b2e65c69fca695fdf999fa1838c63aa0b (patch) | |
| tree | cb138571d91cba3af6b6ef94b72608ac648420bb /src/core.c | |
| parent | d0e7195a16c50b23fd82e7ca7869cc07773ddba2 (diff) | |
| download | raylib-6ee5718b2e65c69fca695fdf999fa1838c63aa0b.tar.gz raylib-6ee5718b2e65c69fca695fdf999fa1838c63aa0b.zip | |
Improved function GetKeyPressed()
To support multiple keys (including function keys)
Diffstat (limited to 'src/core.c')
| -rw-r--r-- | src/core.c | 9 |
1 files changed, 5 insertions, 4 deletions
@@ -1735,10 +1735,11 @@ static void KeyCallback(GLFWwindow *window, int key, int scancode, int action, i TakeScreenshot(); } #endif - else currentKeyState[key] = action; - - // TODO: Review (and remove) this HACK for GuiTextBox, to deteck back key - if ((key == 259) && (action == GLFW_PRESS)) lastKeyPressed = 3; + else + { + currentKeyState[key] = action; + if (action == GLFW_PRESS) lastKeyPressed = key; + } } // GLFW3 Mouse Button Callback, runs on mouse button pressed |
