Mouse hotfixes (#4596)

* add missing setting check in sceMouseInit

* Send guest event on mouse removed host event
This commit is contained in:
kalaposfos13 2026-06-19 09:30:04 +02:00 committed by GitHub
parent d9f68b53c9
commit ad95aac357
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
2 changed files with 6 additions and 2 deletions

View File

@ -4,6 +4,7 @@
// Generated By moduleGenerator
#include "SDL3/SDL_mouse.h"
#include "common/logging/log.h"
#include "core/emulator_settings.h"
#include "core/libraries/error_codes.h"
#include "core/libraries/libs.h"
#include "core/user_settings.h"
@ -56,8 +57,10 @@ int PS4_SYSV_ABI sceMouseGetDeviceInfo() {
}
int PS4_SYSV_ABI sceMouseInit() {
SDL_WarpMouseInWindow(g_window->GetSDLWindow(), 1, 1);
SDL_SetWindowRelativeMouseMode(g_window->GetSDLWindow(), true);
if (EmulatorSettings.IsMiceUsedAsMice()) {
SDL_WarpMouseInWindow(g_window->GetSDLWindow(), 1, 1);
SDL_SetWindowRelativeMouseMode(g_window->GetSDLWindow(), true);
}
int micecount = 0;
auto micelist = SDL_GetMice(&micecount);
LOG_INFO(Input, "{} mice are currently connected", micecount);

View File

@ -53,6 +53,7 @@ bool PushSDLEvent(SDL_Event const& e) {
return false;
}
mouse_sdl_handles[index] = -1;
mouse_states[index].Push(current_state[index]);
break;
}
case SDL_EVENT_MOUSE_MOTION: {