touch: inject touches from spiceapi to native touch hooks (#824)

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

## Description of change
Touches via the API wasn't being delivered to native touch hook;
implement this, which closes the last gap we have vs. wintouchemu.

While we're here, implement popn subscreen support for companion as
well.

## Testing
Tested for iidx/sdvx/popn
This commit is contained in:
bicarus
2026-07-21 16:57:11 -07:00
committed by GitHub
parent 9d41ca2515
commit 4836cd94ab
6 changed files with 191 additions and 14 deletions
@@ -23,6 +23,7 @@
namespace nativetouch {
static decltype(GetTouchInputInfo) *GetTouchInputInfo_orig = nullptr;
static bool native_touch_hooked = false;
static bool native_display_initialized = false;
static DWORD native_display_orientation = DMDO_DEFAULT;
static long native_display_size_x = 1920L;
@@ -157,9 +158,15 @@ namespace nativetouch {
return result;
}
bool is_hooked() {
return native_touch_hooked;
}
void hook(HMODULE module) {
inject::hook(module);
native_touch_hooked = true;
GetTouchInputInfo_orig = detour::iat_try("GetTouchInputInfo", GetTouchInputInfoHook, module);
if (GetTouchInputInfo_orig != nullptr) {
log_misc("touch::native", "GetTouchInputInfo hooked");