diff --git a/src/events/SDL_keyboard.c b/src/events/SDL_keyboard.c index 69fcc08091..066c6e6aaa 100644 --- a/src/events/SDL_keyboard.c +++ b/src/events/SDL_keyboard.c @@ -70,7 +70,6 @@ typedef struct SDL_Keyboard static SDL_Keyboard SDL_keyboard; static int SDL_keyboard_count; static SDL_KeyboardInstance *SDL_keyboards; -static bool SDL_keyboard_active; static void SDLCALL SDL_KeycodeOptionsChanged(void *userdata, const char *name, const char *oldValue, const char *hint) { @@ -215,20 +214,6 @@ const char *SDL_GetKeyboardNameForID(SDL_KeyboardID instance_id) return SDL_GetPersistentString(SDL_keyboards[keyboard_index].name); } -void SDL_SetKeyboardActive(bool active) -{ - SDL_keyboard_active = active; -} - -bool SDL_HasActiveKeyboard(void) -{ - if (!SDL_HasKeyboard()) { - // No keyboards to be active - return false; - } - return SDL_keyboard_active; -} - void SDL_ResetKeyboard(void) { SDL_Keyboard *keyboard = &SDL_keyboard; @@ -571,8 +556,6 @@ static bool SDL_SendKeyboardKeyInternal(Uint64 timestamp, Uint32 flags, SDL_Keyb } if (source == KEYBOARD_HARDWARE) { - // Primary input appears to be a keyboard - SDL_SetKeyboardActive(true); keyboard->hardware_timestamp = SDL_GetTicks(); } else if (source == KEYBOARD_AUTORELEASE) { keyboard->autorelease_pending = true; diff --git a/src/events/SDL_keyboard_c.h b/src/events/SDL_keyboard_c.h index 45145cf211..ddfb5c5747 100644 --- a/src/events/SDL_keyboard_c.h +++ b/src/events/SDL_keyboard_c.h @@ -43,12 +43,6 @@ extern void SDL_AddKeyboard(SDL_KeyboardID keyboardID, const char *name, bool se // A keyboard has been removed from the system extern void SDL_RemoveKeyboard(SDL_KeyboardID keyboardID, bool send_event); -// Set whether keyboard input is active -extern void SDL_SetKeyboardActive(bool active); - -// Get whether keyboard input is active -extern bool SDL_HasActiveKeyboard(void); - // Set the mapping of scancode to key codes extern void SDL_SetKeymap(SDL_Keymap *keymap, bool send_event); diff --git a/src/joystick/SDL_joystick.c b/src/joystick/SDL_joystick.c index 55bd9f5bf4..78c64b7f64 100644 --- a/src/joystick/SDL_joystick.c +++ b/src/joystick/SDL_joystick.c @@ -2368,11 +2368,6 @@ void SDL_SendJoystickButton(Uint64 timestamp, SDL_Joystick *joystick, Uint8 butt return; } - if (!joystick->is_virtual) { - // Primary input appears to be a joystick - SDL_SetKeyboardActive(false); - } - /* We ignore events if we don't have keyboard focus, except for button * release. */ if (SDL_PrivateJoystickShouldIgnoreEvent()) { diff --git a/src/video/SDL_video.c b/src/video/SDL_video.c index d84aea615e..ebad40d8b1 100644 --- a/src/video/SDL_video.c +++ b/src/video/SDL_video.c @@ -5405,7 +5405,7 @@ bool SDL_GetTextInputMultiline(SDL_PropertiesID props) static bool AutoShowingScreenKeyboard(void) { const char *hint = SDL_GetHint(SDL_HINT_ENABLE_SCREEN_KEYBOARD); - if (((!hint || SDL_strcasecmp(hint, "auto") == 0) && !SDL_HasActiveKeyboard()) || + if (((!hint || SDL_strcasecmp(hint, "auto") == 0) && !SDL_HasKeyboard()) || SDL_GetStringBoolean(hint, false)) { return true; } else {