touch: inject mouse and poke into native touch modes (#815)
## Link to GitHub Issue or related Pull Request, if one exists Part 1 of many fixes for #814. ## Description of change For the native touch hook - add code to inject synthetic touches using Windows API (`InjectTouchInput`). Note that this is Windows 8+ only, but we can make an assumption that we are running on Win10+ for these games (TDJ/UFC/High Cheers) since the cabs assume Win10. Detect mouse events and allow IIDX poke to call into this to inject synthetic touches. Also, update the nativetouchhook to independently calculate window size and rotation, instead of relying on rawinput layer. ## Testing Tested to work with native touch option on IIDX, SDVX, POPN, all full screen / windowed / sub on/off combinations. Edge cases: * sdvx main monitor rotated 270 deg * touch invert option * windowed mode resize / moved All seem to work.
This commit is contained in:
@@ -81,8 +81,6 @@ static const char *LOG_MODULE_NAME = "touch";
|
||||
|
||||
static TouchHandler *TOUCH_HANDLER = nullptr;
|
||||
|
||||
static bool is_mouse_message_from_touchscreen();
|
||||
|
||||
TouchHandler::TouchHandler(std::string name) {
|
||||
log_info("touch", "Using touch handler: {}", name);
|
||||
}
|
||||
@@ -1003,7 +1001,7 @@ void update_spicetouch_window_dimensions(HWND hWnd) {
|
||||
}
|
||||
|
||||
// https://learn.microsoft.com/en-us/windows/win32/tablet/system-events-and-mouse-messages
|
||||
static bool is_mouse_message_from_touchscreen() {
|
||||
bool is_mouse_message_from_touchscreen() {
|
||||
constexpr ULONG_PTR MI_WP_SIGNATURE = 0xFF515700;
|
||||
constexpr ULONG_PTR SIGNATURE_MASK = 0xFFFFFF00;
|
||||
return (GetMessageExtraInfo() & SIGNATURE_MASK) == MI_WP_SIGNATURE;
|
||||
|
||||
Reference in New Issue
Block a user