From 9149f29c1a1f8bf5b356bfee4cfd1be9e046b3f1 Mon Sep 17 00:00:00 2001 From: KojoZero Date: Wed, 29 Apr 2026 22:36:35 -0700 Subject: [PATCH] updated TouchDirectlyPressed, fixed auto map, and cursor rotation --- src/citra_qt/configuration/config.cpp | 1 + src/core/frontend/cursor.cpp | 2 +- src/core/frontend/emu_window.cpp | 4 ++-- src/core/frontend/framebuffer_layout.cpp | 1 + src/input_common/sdl/sdl_impl.cpp | 1 + 5 files changed, 6 insertions(+), 3 deletions(-) diff --git a/src/citra_qt/configuration/config.cpp b/src/citra_qt/configuration/config.cpp index a5aa9896b..b7a2b6693 100644 --- a/src/citra_qt/configuration/config.cpp +++ b/src/citra_qt/configuration/config.cpp @@ -33,6 +33,7 @@ const std::array QtConfig::default_butt Qt::Key_A, Qt::Key_S, Qt::Key_Z, Qt::Key_X, Qt::Key_T, Qt::Key_G, Qt::Key_F, Qt::Key_H, Qt::Key_Q, Qt::Key_W, Qt::Key_M, Qt::Key_N, Qt::Key_O, Qt::Key_P, Qt::Key_1, Qt::Key_2, Qt::Key_B, Qt::Key_V, + Qt::Key_U, }; const std::array, Settings::NativeAnalog::NumAnalogs> QtConfig::default_analogs{{ diff --git a/src/core/frontend/cursor.cpp b/src/core/frontend/cursor.cpp index 93d41058a..a6626b076 100644 --- a/src/core/frontend/cursor.cpp +++ b/src/core/frontend/cursor.cpp @@ -244,7 +244,7 @@ void Cursor::runMacro(){ void Cursor::setRotation(){ if (emuWindow->GetFramebufferLayout().is_portrait){ - rotation = 3; + rotation = 1; } else { rotation = 0; } diff --git a/src/core/frontend/emu_window.cpp b/src/core/frontend/emu_window.cpp index 5e8266ef5..e56fe7ba4 100644 --- a/src/core/frontend/emu_window.cpp +++ b/src/core/frontend/emu_window.cpp @@ -198,8 +198,8 @@ bool EmuWindow::TouchDirectlyPressed(unsigned internal_x, unsigned internal_y) { std::clamp(internal_x, 0, 319); std::clamp(internal_y, 0, 239); touch_state->touch_pressed = true; - touch_state->touch_x = internal_x/319.0f; - touch_state->touch_y = (239-internal_y)/239.0f; + touch_state->touch_x = internal_x/320.0f; + touch_state->touch_y = (239-internal_y)/240.0f; return true; } void EmuWindow::TouchReleased() { diff --git a/src/core/frontend/framebuffer_layout.cpp b/src/core/frontend/framebuffer_layout.cpp index 918c1454f..c0eb2fcb8 100644 --- a/src/core/frontend/framebuffer_layout.cpp +++ b/src/core/frontend/framebuffer_layout.cpp @@ -639,6 +639,7 @@ FramebufferLayout reverseLayout(FramebufferLayout layout) { layout.additional_screen.top = layout.height - oldRight; layout.additional_screen.bottom = layout.height - oldLeft; } + layout.is_portrait = true; return layout; } diff --git a/src/input_common/sdl/sdl_impl.cpp b/src/input_common/sdl/sdl_impl.cpp index 71f2be379..7a22d4e4c 100644 --- a/src/input_common/sdl/sdl_impl.cpp +++ b/src/input_common/sdl/sdl_impl.cpp @@ -140,6 +140,7 @@ constexpr std::array