From a14176e89d521296014c3e16f24147a5bca22176 Mon Sep 17 00:00:00 2001 From: Nickolas McDonald <43690021+n77y@users.noreply.github.com> Date: Sat, 19 Aug 2023 21:49:09 -0400 Subject: [PATCH] Update rcore.c --- src/rcore.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/rcore.c b/src/rcore.c index d2e743cc3..effd7a59b 100644 --- a/src/rcore.c +++ b/src/rcore.c @@ -3751,7 +3751,7 @@ void OpenURL(const char *url) // Check if a key has been pressed once bool IsKeyPressed(int key) { - return IsKeyDown(key) && (CORE.Input.Keyboard.previousKeyState[key] == 0); + return KEY_SAFE(key) && (CORE.Input.Keyboard.previousKeyState[key] == 0) && (CORE.Input.Keyboard.currentKeyState[key] == 1); } // Check if a key is being pressed (key held down) @@ -3763,7 +3763,7 @@ bool IsKeyDown(int key) // Check if a key has been released once bool IsKeyReleased(int key) { - return IsKeyUp(key) && (CORE.Input.Keyboard.previousKeyState[key] == 1); + return KEY_SAFE(key) && (CORE.Input.Keyboard.previousKeyState[key] == 1) && (CORE.Input.Keyboard.currentKeyState[key] == 0); } // Check if a key is NOT being pressed (key not held down)