From 7a656ba477647ac34b013174e03a840d4314c8a2 Mon Sep 17 00:00:00 2001 From: ubkp <118854183+ubkp@users.noreply.github.com> Date: Sat, 23 Sep 2023 18:14:36 -0300 Subject: [PATCH] Move SetExitKey from core to android, desktop, web --- src/rcore.c | 16 ++++++++-------- src/rcore_android.c | 7 +++++++ src/rcore_desktop.c | 7 +++++++ src/rcore_web.c | 7 +++++++ 4 files changed, 29 insertions(+), 8 deletions(-) diff --git a/src/rcore.c b/src/rcore.c index a5bd8839a..61ea9edb6 100644 --- a/src/rcore.c +++ b/src/rcore.c @@ -1937,14 +1937,14 @@ int GetCharPressed(void) return value; } -// Set a custom key to exit program -// NOTE: default exitKey is ESCAPE -void SetExitKey(int key) -{ -#if !defined(PLATFORM_ANDROID) - CORE.Input.Keyboard.exitKey = key; -#endif -} +//// Set a custom key to exit program +//// NOTE: default exitKey is ESCAPE +//void SetExitKey(int key) +//{ +//#if !defined(PLATFORM_ANDROID) +// CORE.Input.Keyboard.exitKey = key; +//#endif +//} // NOTE: Gamepad support not implemented in emscripten GLFW3 (PLATFORM_WEB) diff --git a/src/rcore_android.c b/src/rcore_android.c index 8ce84f677..97a550a7b 100644 --- a/src/rcore_android.c +++ b/src/rcore_android.c @@ -1049,6 +1049,13 @@ int GetMonitorPhysicalWidth(int monitor) return 0; } +// Set a custom key to exit program +// NOTE: default exitKey is ESCAPE +void SetExitKey(int key) +{ + TRACELOG(LOG_INFO, "SetExitKey not implemented in rcore_android.c"); +} + // Get gamepad internal name id const char *GetGamepadName(int gamepad) { diff --git a/src/rcore_desktop.c b/src/rcore_desktop.c index 77962c00e..b38921960 100644 --- a/src/rcore_desktop.c +++ b/src/rcore_desktop.c @@ -1512,6 +1512,13 @@ int GetMonitorPhysicalWidth(int monitor) return 0; } +// Set a custom key to exit program +// NOTE: default exitKey is ESCAPE +void SetExitKey(int key) +{ + CORE.Input.Keyboard.exitKey = key; +} + // Get gamepad internal name id const char *GetGamepadName(int gamepad) { diff --git a/src/rcore_web.c b/src/rcore_web.c index 2e50da19b..3565b061b 100644 --- a/src/rcore_web.c +++ b/src/rcore_web.c @@ -1041,6 +1041,13 @@ int GetMonitorPhysicalWidth(int monitor) return 0; } +// Set a custom key to exit program +// NOTE: default exitKey is ESCAPE +void SetExitKey(int key) +{ + CORE.Input.Keyboard.exitKey = key; +} + // NOTE: Gamepad support not implemented in emscripten GLFW3 (PLATFORM_WEB) // Get gamepad internal name id