diff options
| author | 2023-02-18 16:25:48 -0500 | |
|---|---|---|
| committer | 2023-02-18 16:25:48 -0500 | |
| commit | e531d1fae986addc7253e14bcc569c38ab50ccb0 (patch) | |
| tree | 82b68c763271ac1d15112a536136f7462cacadfb /src/yuzu_cmd/emu_window/emu_window_sdl2.cpp | |
| parent | Merge pull request #9825 from liamwhite/object-name (diff) | |
| parent | input_common: Split mouse input into individual devices (diff) | |
| download | yuzu-e531d1fae986addc7253e14bcc569c38ab50ccb0.tar.gz yuzu-e531d1fae986addc7253e14bcc569c38ab50ccb0.tar.xz yuzu-e531d1fae986addc7253e14bcc569c38ab50ccb0.zip | |
Merge pull request #9815 from german77/qt-mouse
Qt: Fix mouse scalling
Diffstat (limited to 'src/yuzu_cmd/emu_window/emu_window_sdl2.cpp')
| -rw-r--r-- | src/yuzu_cmd/emu_window/emu_window_sdl2.cpp | 8 |
1 files changed, 6 insertions, 2 deletions
diff --git a/src/yuzu_cmd/emu_window/emu_window_sdl2.cpp b/src/yuzu_cmd/emu_window/emu_window_sdl2.cpp index 5450b8c38..5153cdb79 100644 --- a/src/yuzu_cmd/emu_window/emu_window_sdl2.cpp +++ b/src/yuzu_cmd/emu_window/emu_window_sdl2.cpp | |||
| @@ -62,7 +62,9 @@ void EmuWindow_SDL2::OnMouseButton(u32 button, u8 state, s32 x, s32 y) { | |||
| 62 | const auto mouse_button = SDLButtonToMouseButton(button); | 62 | const auto mouse_button = SDLButtonToMouseButton(button); |
| 63 | if (state == SDL_PRESSED) { | 63 | if (state == SDL_PRESSED) { |
| 64 | const auto [touch_x, touch_y] = MouseToTouchPos(x, y); | 64 | const auto [touch_x, touch_y] = MouseToTouchPos(x, y); |
| 65 | input_subsystem->GetMouse()->PressButton(x, y, touch_x, touch_y, mouse_button); | 65 | input_subsystem->GetMouse()->PressButton(x, y, mouse_button); |
| 66 | input_subsystem->GetMouse()->PressMouseButton(mouse_button); | ||
| 67 | input_subsystem->GetMouse()->PressTouchButton(touch_x, touch_y, mouse_button); | ||
| 66 | } else { | 68 | } else { |
| 67 | input_subsystem->GetMouse()->ReleaseButton(mouse_button); | 69 | input_subsystem->GetMouse()->ReleaseButton(mouse_button); |
| 68 | } | 70 | } |
| @@ -70,7 +72,9 @@ void EmuWindow_SDL2::OnMouseButton(u32 button, u8 state, s32 x, s32 y) { | |||
| 70 | 72 | ||
| 71 | void EmuWindow_SDL2::OnMouseMotion(s32 x, s32 y) { | 73 | void EmuWindow_SDL2::OnMouseMotion(s32 x, s32 y) { |
| 72 | const auto [touch_x, touch_y] = MouseToTouchPos(x, y); | 74 | const auto [touch_x, touch_y] = MouseToTouchPos(x, y); |
| 73 | input_subsystem->GetMouse()->MouseMove(x, y, touch_x, touch_y, 0, 0); | 75 | input_subsystem->GetMouse()->Move(x, y, 0, 0); |
| 76 | input_subsystem->GetMouse()->MouseMove(touch_x, touch_y); | ||
| 77 | input_subsystem->GetMouse()->TouchMove(touch_x, touch_y); | ||
| 74 | } | 78 | } |
| 75 | 79 | ||
| 76 | void EmuWindow_SDL2::OnFingerDown(float x, float y, std::size_t id) { | 80 | void EmuWindow_SDL2::OnFingerDown(float x, float y, std::size_t id) { |