updated TouchDirectlyPressed, fixed auto map, and cursor rotation

This commit is contained in:
KojoZero 2026-04-29 22:36:35 -07:00
parent 0ba8e18dc4
commit 9149f29c1a
5 changed files with 6 additions and 3 deletions

View file

@ -33,6 +33,7 @@ const std::array<int, Settings::NativeButton::NumButtons> 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<std::array<int, 5>, Settings::NativeAnalog::NumAnalogs> QtConfig::default_analogs{{

View file

@ -244,7 +244,7 @@ void Cursor::runMacro(){
void Cursor::setRotation(){
if (emuWindow->GetFramebufferLayout().is_portrait){
rotation = 3;
rotation = 1;
} else {
rotation = 0;
}

View file

@ -198,8 +198,8 @@ bool EmuWindow::TouchDirectlyPressed(unsigned internal_x, unsigned internal_y) {
std::clamp<unsigned>(internal_x, 0, 319);
std::clamp<unsigned>(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() {

View file

@ -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;
}

View file

@ -140,6 +140,7 @@ constexpr std::array<SDL_GameControllerButton, Settings::NativeButton::NumButton
SDL_CONTROLLER_BUTTON_INVALID,
SDL_CONTROLLER_BUTTON_GUIDE,
SDL_CONTROLLER_BUTTON_INVALID,
SDL_CONTROLLER_BUTTON_LEFTSTICK,
}};
struct SDLJoystickDeleter {