diff options
| author | 2020-11-29 22:59:50 -0800 | |
|---|---|---|
| committer | 2020-11-29 22:59:50 -0800 | |
| commit | 7bc3e80399d62aabe4acbba094d0fff23a187186 (patch) | |
| tree | ac12ca41f34fdda51992fedfeb55b169dedcfcaf /src/yuzu_cmd/emu_window | |
| parent | Merge pull request #5005 from ReinUsesLisp/div-ceil (diff) | |
| parent | Implement full mouse support (diff) | |
| download | yuzu-7bc3e80399d62aabe4acbba094d0fff23a187186.tar.gz yuzu-7bc3e80399d62aabe4acbba094d0fff23a187186.tar.xz yuzu-7bc3e80399d62aabe4acbba094d0fff23a187186.zip | |
Merge pull request #4939 from german77/MouseInput
InputCommon: Implement full mouse support
Diffstat (limited to 'src/yuzu_cmd/emu_window')
| -rw-r--r-- | src/yuzu_cmd/emu_window/emu_window_sdl2.cpp | 8 | ||||
| -rw-r--r-- | src/yuzu_cmd/emu_window/emu_window_sdl2_gl.cpp | 1 |
2 files changed, 4 insertions, 5 deletions
diff --git a/src/yuzu_cmd/emu_window/emu_window_sdl2.cpp b/src/yuzu_cmd/emu_window/emu_window_sdl2.cpp index c4a4a36be..e32bed5e6 100644 --- a/src/yuzu_cmd/emu_window/emu_window_sdl2.cpp +++ b/src/yuzu_cmd/emu_window/emu_window_sdl2.cpp | |||
| @@ -9,7 +9,7 @@ | |||
| 9 | #include "core/perf_stats.h" | 9 | #include "core/perf_stats.h" |
| 10 | #include "input_common/keyboard.h" | 10 | #include "input_common/keyboard.h" |
| 11 | #include "input_common/main.h" | 11 | #include "input_common/main.h" |
| 12 | #include "input_common/motion_emu.h" | 12 | #include "input_common/mouse/mouse_input.h" |
| 13 | #include "input_common/sdl/sdl.h" | 13 | #include "input_common/sdl/sdl.h" |
| 14 | #include "yuzu_cmd/emu_window/emu_window_sdl2.h" | 14 | #include "yuzu_cmd/emu_window/emu_window_sdl2.h" |
| 15 | 15 | ||
| @@ -30,7 +30,7 @@ EmuWindow_SDL2::~EmuWindow_SDL2() { | |||
| 30 | 30 | ||
| 31 | void EmuWindow_SDL2::OnMouseMotion(s32 x, s32 y) { | 31 | void EmuWindow_SDL2::OnMouseMotion(s32 x, s32 y) { |
| 32 | TouchMoved((unsigned)std::max(x, 0), (unsigned)std::max(y, 0)); | 32 | TouchMoved((unsigned)std::max(x, 0), (unsigned)std::max(y, 0)); |
| 33 | input_subsystem->GetMotionEmu()->Tilt(x, y); | 33 | input_subsystem->GetMouse()->MouseMove(x, y); |
| 34 | } | 34 | } |
| 35 | 35 | ||
| 36 | void EmuWindow_SDL2::OnMouseButton(u32 button, u8 state, s32 x, s32 y) { | 36 | void EmuWindow_SDL2::OnMouseButton(u32 button, u8 state, s32 x, s32 y) { |
| @@ -42,9 +42,9 @@ void EmuWindow_SDL2::OnMouseButton(u32 button, u8 state, s32 x, s32 y) { | |||
| 42 | } | 42 | } |
| 43 | } else if (button == SDL_BUTTON_RIGHT) { | 43 | } else if (button == SDL_BUTTON_RIGHT) { |
| 44 | if (state == SDL_PRESSED) { | 44 | if (state == SDL_PRESSED) { |
| 45 | input_subsystem->GetMotionEmu()->BeginTilt(x, y); | 45 | input_subsystem->GetMouse()->PressButton(x, y, button); |
| 46 | } else { | 46 | } else { |
| 47 | input_subsystem->GetMotionEmu()->EndTilt(); | 47 | input_subsystem->GetMouse()->ReleaseButton(button); |
| 48 | } | 48 | } |
| 49 | } | 49 | } |
| 50 | } | 50 | } |
diff --git a/src/yuzu_cmd/emu_window/emu_window_sdl2_gl.cpp b/src/yuzu_cmd/emu_window/emu_window_sdl2_gl.cpp index 5f35233b5..a103b04bd 100644 --- a/src/yuzu_cmd/emu_window/emu_window_sdl2_gl.cpp +++ b/src/yuzu_cmd/emu_window/emu_window_sdl2_gl.cpp | |||
| @@ -17,7 +17,6 @@ | |||
| 17 | #include "core/settings.h" | 17 | #include "core/settings.h" |
| 18 | #include "input_common/keyboard.h" | 18 | #include "input_common/keyboard.h" |
| 19 | #include "input_common/main.h" | 19 | #include "input_common/main.h" |
| 20 | #include "input_common/motion_emu.h" | ||
| 21 | #include "video_core/renderer_base.h" | 20 | #include "video_core/renderer_base.h" |
| 22 | #include "yuzu_cmd/emu_window/emu_window_sdl2_gl.h" | 21 | #include "yuzu_cmd/emu_window/emu_window_sdl2_gl.h" |
| 23 | 22 | ||