I've noticed that the Windows player hasn't yet been made to work with multitouch events. It would be great if this could be done so that Windows touch screen users don't have to use devices to test multitouch apps.
There are two issues with the current implementation too.
1) All touches are registered as id = 2 on the win32 player, whereas the count starts from id = 1 on Android and increments with each additional touch. This means that even testing single touches in a multitouch app is incompatible.
2) The Windows player crashes when a 5th simultaneous touch is registered with this error:
"attempt to index a function value
stack traceback:"
(no more info after colon). This example reproduces...
local function onTouchBegin(event)
print("onTouchBegin. touch.id = " .. event.touch.id)
end
stage:addEventListener(Event.TOUCHES_BEGIN, onTouchBegin)
stage:addEventListener(Event.ENTER_FRAME, function() end, nil) |
Comments
I think this can be done with the Windows/Mac? player (Desktop QT) using this information:
http://doc.qt.io/qt-5/qtouchevent.html
On the Win32 player I think it can be done by intercepting WM_TOUCH, WM_TOUCHHITTESTING, etc messages in the Windows callback.
With Win32 the window will also need to call the user32.dll "RegisterTouchWindow" function, a check will have to be made to see if this function exists - as it's not present on all versions of Windows (even if the Windows version number is the same!)...
I think that the system metrics may also hold some touch information (SM_DIGITIZER) ?
It looks like touch beyond 5 points might not be supported on some (all?) versions of Windows - might be wrong though (maybe handled differently?)
POINTER_CHANGE_NONE
POINTER_CHANGE_FIRSTBUTTON_DOWN
POINTER_CHANGE_FIRSTBUTTON_UP
POINTER_CHANGE_SECONDBUTTON_DOWN
POINTER_CHANGE_SECONDBUTTON_UP
POINTER_CHANGE_THIRDBUTTON_DOWN
POINTER_CHANGE_THIRDBUTTON_UP
POINTER_CHANGE_FOURTHBUTTON_DOWN
POINTER_CHANGE_FOURTHBUTTON_UP
POINTER_CHANGE_FIFTHBUTTON_DOWN
POINTER_CHANGE_FIFTHBUTTON_UP
https://deluxepixel.com
EDIT: I checked and yes it doesn't work properly as @snook said
https:--msdn.microsoft.com/en-us/library/windows/desktop/dd744775(v=vs.85).aspx
(I can't post links, hence the --)
(which has a bug in it, if you want to play with it, see my comment (I'm _-.'.-_ )).
@hgy29, that sounds promising, hopefully it could be a case of just having to register the window then?
Likes: SinisterSoft
Likes: snooks, antix
my app which i develop for a strict deadline (until october, you helped me a lot already, which made me possible to use gideros) was tested finally on a touchscreen windows (where it should run at the end) and i sadly realized that the above two issues (fingers are not differentiated, and more seriously, app crashes with "attempt to index a function value stack traceback:" when too many fingers touch screen) are still present.
is there a chance for a fix soon ? i'm in deep shit now because of these.
btw i'm using the qt export option and not the win32, as i need the camera plugin and multi-screen support.
Fragmenter - animated loop machine and IKONOMIKON - the memory game
I'll send you something in private.
Fragmenter - animated loop machine and IKONOMIKON - the memory game
Fragmenter - animated loop machine and IKONOMIKON - the memory game
Likes: SinisterSoft
Likes: keszegh
https://deluxepixel.com
Likes: keszegh
Likes: keszegh, antix