sdvx, touch: hook Windows touch API when main monitor is rotated 270 degrees (portrait flipped) (#558)

## Link to GitHub Issue, if one exists
n/a

## Description of change
Game expects primary monitor to be in 90 deg rotation, and does the
touch calculation accordingly.

If the user does 270 deg rotation ("portrait, flipped") then the game's
touch calculation is flipped upside down. Detect this and provide the
fixed up values in the touch hook.

## Testing
Tested with SDVX in 90 deg, 270 deg rotation, and 1080p, forced 1440p.
This commit is contained in:
bicarus
2026-02-27 14:22:56 -08:00
committed by GitHub
parent 955c50a9f3
commit 954e6022d9
4 changed files with 45 additions and 9 deletions
+7 -4
View File
@@ -21,8 +21,9 @@
#include "util/socd_cleaner.h"
#include "util/time.h"
#include "util/libutils.h"
#include "misc/wintouchemu.h"
#include "misc/eamuse.h"
#include "misc/nativetouchhook.h"
#include "misc/wintouchemu.h"
#include "bi2x_hook.h"
#include "camera.h"
#include "io.h"
@@ -416,9 +417,11 @@ namespace games::sdvx {
}
if (is_valkyrie_model()) {
// hook touch window
// in windowed mode, game can accept mouse input on the second screen
if (!NATIVETOUCH && !GRAPHICS_WINDOWED) {
if (NATIVETOUCH) {
nativetouchhook::hook(avs::game::DLL_INSTANCE);
} else if (!NATIVETOUCH && !GRAPHICS_WINDOWED) {
// hook touch window
// in windowed mode, game can accept mouse input on the second screen
wintouchemu::FORCE = true;
wintouchemu::INJECT_MOUSE_AS_WM_TOUCH = true;
wintouchemu::hook_title_ends(