mirror of
https://github.com/spice2x/spice2x.github.io.git
synced 2026-10-07 02:28:13 -07:00
gitadora: fix synthetic touch (mouse and api) (#867)
## Link to GitHub Issue or related Pull Request, if one exists #0 ## Description of change Fix mouse and touch API handling for gitadora. * hook native touch in every arena window mode (previously only using wintouchemu for 1 windowed mode) * publish the touch window (SMALL panel, or the main window drawing the overlay) and only attach injection there * route touch on the SMALL window straight through instead of the overlay transform, and accept the mouse only there * fix spiceapi by forcing 800x1280 touch canvas size * run API capture before the subscreen present to fix api not showing sub image ## Testing Test: gitadora 1/2/4 windowed mode, fullscreen iidx /sdvx / popn windowed/fullscreen for regressions
This commit is contained in:
@@ -33,6 +33,7 @@
|
||||
#include "util/utils.h"
|
||||
#include "misc/wintouchemu.h"
|
||||
#include "touch/native/inject.h"
|
||||
#include "touch/native/nativetouchhook.h"
|
||||
#include "util/time.h"
|
||||
#include "rawinput/rawinput.h"
|
||||
|
||||
@@ -216,6 +217,18 @@ static void gitadora_remember_window(HWND hWnd, const std::string &window_name)
|
||||
} else if (window_name == "SMALL") {
|
||||
GFDM_SUBSCREEN_WINDOW = hWnd;
|
||||
}
|
||||
|
||||
// touch belongs to the SMALL panel when it exists, otherwise to the main window
|
||||
// that draws the subscreen overlay
|
||||
const bool hosts_touch = window_name == "SMALL" ||
|
||||
(window_name == "GITADORA" && !graphics_gitadora_has_dedicated_subscreen());
|
||||
if (nativetouch::is_hooked() && hWnd != nullptr && hosts_touch) {
|
||||
nativetouch::inject::set_preferred_injection_window(hWnd);
|
||||
}
|
||||
}
|
||||
|
||||
bool graphics_gitadora_has_dedicated_subscreen() {
|
||||
return GFDM_SUBSCREEN_WINDOW != nullptr;
|
||||
}
|
||||
|
||||
bool graphics_gitadora_prepare_two_head_device_window(
|
||||
@@ -731,6 +744,11 @@ static HWND WINAPI CreateWindowExA_hook(DWORD dwExStyle, LPCSTR lpClassName, LPC
|
||||
if (GRAPHICS_WINDOWED && !GRAPHICS_PREVENT_SECONDARY_WINDOWS) {
|
||||
graphics_hook_subscreen_window(GFDM_SUBSCREEN_WINDOW);
|
||||
}
|
||||
|
||||
// the dedicated SMALL window is the touch panel; mouse and API touch target it
|
||||
if (nativetouch::is_hooked() && result != nullptr) {
|
||||
nativetouch::inject::register_and_attach_window(result);
|
||||
}
|
||||
}
|
||||
if (is_gfdm_window && GRAPHICS_WINDOWED && !GRAPHICS_PREVENT_SECONDARY_WINDOWS) {
|
||||
gitadora_force_window_style(result);
|
||||
@@ -1320,7 +1338,9 @@ void graphics_hook_window(HWND hWnd, D3DPRESENT_PARAMETERS *pPresentationParamet
|
||||
const bool native_touch_overlay =
|
||||
(games::iidx::NATIVE_TOUCH && games::iidx::TDJ_MODE && !GRAPHICS_IIDX_WSUB) ||
|
||||
(games::popn::NATIVE_TOUCH &&
|
||||
games::popn::is_pikapika_model() && GRAPHICS_PREVENT_SECONDARY_WINDOWS);
|
||||
games::popn::is_pikapika_model() && GRAPHICS_PREVENT_SECONDARY_WINDOWS) ||
|
||||
(games::gitadora::NATIVE_TOUCH &&
|
||||
games::gitadora::is_arena_model() && GRAPHICS_PREVENT_SECONDARY_WINDOWS);
|
||||
if (native_touch_overlay) {
|
||||
nativetouch::inject::register_and_attach_window(hWnd);
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user