mirror of
https://github.com/shadps4-emu/shadPS4.git
synced 2026-07-10 01:44:42 -06:00
Mouse hotfixes (#4596)
* add missing setting check in sceMouseInit * Send guest event on mouse removed host event
This commit is contained in:
parent
d9f68b53c9
commit
ad95aac357
@ -4,6 +4,7 @@
|
|||||||
// Generated By moduleGenerator
|
// Generated By moduleGenerator
|
||||||
#include "SDL3/SDL_mouse.h"
|
#include "SDL3/SDL_mouse.h"
|
||||||
#include "common/logging/log.h"
|
#include "common/logging/log.h"
|
||||||
|
#include "core/emulator_settings.h"
|
||||||
#include "core/libraries/error_codes.h"
|
#include "core/libraries/error_codes.h"
|
||||||
#include "core/libraries/libs.h"
|
#include "core/libraries/libs.h"
|
||||||
#include "core/user_settings.h"
|
#include "core/user_settings.h"
|
||||||
@ -56,8 +57,10 @@ int PS4_SYSV_ABI sceMouseGetDeviceInfo() {
|
|||||||
}
|
}
|
||||||
|
|
||||||
int PS4_SYSV_ABI sceMouseInit() {
|
int PS4_SYSV_ABI sceMouseInit() {
|
||||||
SDL_WarpMouseInWindow(g_window->GetSDLWindow(), 1, 1);
|
if (EmulatorSettings.IsMiceUsedAsMice()) {
|
||||||
SDL_SetWindowRelativeMouseMode(g_window->GetSDLWindow(), true);
|
SDL_WarpMouseInWindow(g_window->GetSDLWindow(), 1, 1);
|
||||||
|
SDL_SetWindowRelativeMouseMode(g_window->GetSDLWindow(), true);
|
||||||
|
}
|
||||||
int micecount = 0;
|
int micecount = 0;
|
||||||
auto micelist = SDL_GetMice(&micecount);
|
auto micelist = SDL_GetMice(&micecount);
|
||||||
LOG_INFO(Input, "{} mice are currently connected", micecount);
|
LOG_INFO(Input, "{} mice are currently connected", micecount);
|
||||||
|
|||||||
@ -53,6 +53,7 @@ bool PushSDLEvent(SDL_Event const& e) {
|
|||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
mouse_sdl_handles[index] = -1;
|
mouse_sdl_handles[index] = -1;
|
||||||
|
mouse_states[index].Push(current_state[index]);
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
case SDL_EVENT_MOUSE_MOTION: {
|
case SDL_EVENT_MOUSE_MOTION: {
|
||||||
|
|||||||
Loading…
Reference in New Issue
Block a user