From 4786535bb9923e4b3a4ad888ee3107b4a3fd5e72 Mon Sep 17 00:00:00 2001 From: tGecko Date: Wed, 2 Oct 2024 22:48:30 +0200 Subject: [PATCH] hide cursor on key/button press --- src/sdl_window.cpp | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/src/sdl_window.cpp b/src/sdl_window.cpp index bd2cc39d2..4a4020a42 100644 --- a/src/sdl_window.cpp +++ b/src/sdl_window.cpp @@ -304,6 +304,9 @@ void WindowSDL::onKeyPress(const SDL_Event* event) { if (axis != Input::Axis::AxisMax) { controller->Axis(0, axis, ax); } + if (SDL_GetCursor() != NULL) { + SDL_HideCursor(); + } } void WindowSDL::onGamepadEvent(const SDL_Event* event) { @@ -329,6 +332,9 @@ void WindowSDL::onGamepadEvent(const SDL_Event* event) { if (button != 0) { controller->CheckButton(0, button, event->type == SDL_EVENT_GAMEPAD_BUTTON_DOWN); } + if (SDL_GetCursor() != NULL) { + SDL_HideCursor(); + } break; case SDL_EVENT_GAMEPAD_AXIS_MOTION: axis = event->gaxis.axis == SDL_GAMEPAD_AXIS_LEFTX ? Input::Axis::LeftX