sdvx, touch: account for 270 degree monitor rotation in wintouchemu (#559)

## Link to GitHub Issue or related Pull Request, if one exists
#558 

## Description of change
Same as #558 but this PR fixes the non-native touch cases (when
wintouchemu is active).

## Testing
Tested 90 and 270 degree rotation, 1080p and 1440p.
This commit is contained in:
bicarus
2026-02-27 17:17:00 -08:00
committed by GitHub
parent 2842fe7ec6
commit 884d665c1c
+12
View File
@@ -20,6 +20,7 @@
#include "util/logging.h" #include "util/logging.h"
#include "util/time.h" #include "util/time.h"
#include "util/utils.h" #include "util/utils.h"
#include "rawinput/touch.h"
#include "avs/game.h" #include "avs/game.h"
@@ -126,6 +127,11 @@ namespace wintouchemu {
WINDOW_TITLE_END = window_title_end; WINDOW_TITLE_END = window_title_end;
} }
static void flip_touch_points(PTOUCHINPUT point) {
point->x = rawinput::touch::DISPLAY_SIZE_X * 100 - point->x;
point->y = rawinput::touch::DISPLAY_SIZE_Y * 100 - point->y;
}
static BOOL WINAPI GetTouchInputInfoHook(HANDLE hTouchInput, UINT cInputs, PTOUCHINPUT pInputs, int cbSize) { static BOOL WINAPI GetTouchInputInfoHook(HANDLE hTouchInput, UINT cInputs, PTOUCHINPUT pInputs, int cbSize) {
// check if original should be called // check if original should be called
@@ -220,6 +226,12 @@ namespace wintouchemu {
touch_input->cxContact = 0; touch_input->cxContact = 0;
touch_input->cyContact = 0; touch_input->cyContact = 0;
if (avs::game::is_model("KFC") &&
rawinput::touch::DISPLAY_INITIALIZED &&
rawinput::touch::DISPLAY_ORIENTATION == DMDO_270) {
flip_touch_points(touch_input);
}
} else if (USE_MOUSE && !mouse_used) { } else if (USE_MOUSE && !mouse_used) {
// disable further mouse inputs this call // disable further mouse inputs this call