Closed guardianblue closed 4 months ago
@sp2xdev you might want to include this as the new release as the spamming of touch events from poke might also be a cause
nvm this can wait
Not entirely sure if any of this will make a difference, but reading the MSDN docs:
If neither dwTime and PerformanceCount are specified, InjectTouchInput allocates the timestamp based on the timing of the call. If InjectTouchInput calls are repeatedly less than 0.1 millisecond apart, ERROR_NOT_READY might be returned. The error will not invalidate the input immediately, but the injection application needs to retry the same frame again for injection to succeed.
maybe the calls are 0.1 ms apart and therefore failing? I'm not sure.
Lastly - these APIs are Windows 8+ only, but spice needs to support Windows 7 (ideally XP as well although that doesn't quite work right now). Therefore, you need to use libutils::tryproc to obtain a function pointer instead of statically linking against the OS library (see win7.cpp / win8.cpp for examples) and check that the OS implements it (it might not).
Thanks for the info, will tinker further
It seems to work now (for win8+). Looks like touch width/height is needed after all.
I will put a new patch later to use tryproc
Updated with tryproc
When in full screen and iidxnosub not checked, GRAPHICS_IIDX_WSUB is true (by default) for all games. There are a few places around the code (this change included) where GRAPHICS_IIDX_WSUB is checked but not GRAPHICS_WINDOWED && game is LDJ. I think this might potentially break quite a few things.
Let me see if I can clean this up first, and then merge your changes.
Going through code now:
You have a lot of changes where comments are being moved around (touch.cpp, wintouchemu.cpp...)... please avoid submitting patches with these as it create extra work (I'll just revert them for now).
Will test with a touch screen momentarily.
Poke in native touch mode does not work at all. I think the coordinates are completely off.... it's a bit tricky though, most people have touch monitors as a secondary monitor for playing TDJ.
I'm going to compile out the native stuff for now and integrate this, as I need to get a new build out to address some touch regressions in other games. If you (or anyone) wants to revive native touch poke, please do submit new code but only after it's been tested with a touch screen as primary or secondary monitor.
One minor thing to point out for future reference - with -iidxnosub checked, in windowed or fullscreen mode, using poke (pressing numbers) result in a phantom touch being "stuck" at {0, 1080}. You can see this in the touch test menu. This is usually not a huge deal but can sometimes lead to dropped touches in menus.
Merged & included in the beta release. Now we can log into TDJ with just a keyboard, without bringing up the subscreen! Thanks.
One minor thing to point out for future reference - with -iidxnosub checked, in windowed or fullscreen mode, using poke (pressing numbers) result in a phantom touch being "stuck" at {0, 1080}. You can see this in the touch test menu. This is usually not a huge deal but can sometimes lead to dropped touches in menus.
Thanks for catching this, I'll see how this can be prevented
Description of change
Compiling
Docker
Testing
-w
-w -iidxnosub
-iidxnosub
Keypad press should register touches on the subscreen.
-w -iidxnosub -iidxnativetouch
(see below)Since I don't have a touch device myself, I have to temporarily change
iidx.cpp
so that the following line is called even when native touch is used:This seems to trick the game so that it doesn't ignore the native touch events. It would be nice if someone can test it on a device with real touch screen.
Patch file
poke-native2.patch