imgui/renderer: Hide Cursor on Idle Implementation (#1266)

Implement hide cursor on idle w/ idle timeout duration (configurable via GUI). While at it add always and never to hide the cursor options as well.

* Revert commit #1211 as to not interfere with the cursor states.
* Make hide cursor on idle as the default setting w/ timeout duration of 5 seconds to hide.
* Add an input tab in the settings page to add the hide cursor setting, with hiding the idle timeout box with respect to the cursor hide option.

Co-authored-by: georgemoralis <giorgosmrls@gmail.com>
This commit is contained in:
Exhigh 2024-10-08 10:47:42 +04:00 committed by GitHub
parent 96344873d6
commit f139762c64
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
7 changed files with 296 additions and 12 deletions

View file

@ -313,9 +313,6 @@ 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) {
@ -354,9 +351,6 @@ void WindowSDL::onGamepadEvent(const SDL_Event* event) {
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