Quick Links: Download Gideros Studio | Gideros Documentation | Gideros Development Center | Gideros community chat | DONATE
Gideros Player - not multitouch aware on Windows + issue + crash — Gideros Forum

Gideros Player - not multitouch aware on Windows + issue + crash

snookssnooks Member
edited August 2017 in Bugs and issues
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)

+1 -1 (+2 / -0 )Share on Facebook

Comments

  • SinisterSoftSinisterSoft Maintainer
    edited August 2017
    The players will have to be updated:

    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

    Coder, video game industry veteran (since the '80s, ❤'s assembler), arrested - never convicted hacker (in the '90s), dad of five, he/him (if that even matters!).
    https://deluxepixel.com
  • hgy29hgy29 Maintainer
    edited August 2017
    I didn't actually check myself but QT player has code to handle multitouch already: https://github.com/gideros/gideros/blob/master/player/Sources/glcanvas.cpp#L1020

    EDIT: I checked and yes it doesn't work properly as @snook said
  • snookssnooks Member
    edited August 2017
    @SinisterSoft, I don't think that there's a hard limit (within reason) with Windows multitouch, WM_TOUCH here works with the full 10 points of my screen. Using the code from this article..

    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

    +1 -1 (+1 / -0 )Share on Facebook
  • hgy29hgy29 Maintainer
    it looks like touch events are received, but not bridged correctly to gideros.

    Likes: snooks, antix

    +1 -1 (+2 / -0 )Share on Facebook
  • That's fantastic if you're on the case!
  • keszeghkeszegh Member
    edited September 2017
    @hgy29,
    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.
  • hgy29hgy29 Maintainer
    @keszegh, I had completely forgotten this one. I found an obvious issue: pressure was reported in touch id, touch id was reported in event type, etc. wrongs args supplied when calling gideros from QT.
    I'll send you something in private.
  • i don't have a touchscreen available anymore, perhaps, @snooks, you can help us trying out bugfix versions? let us know and then @hgy29 can send you also in private test versions.
  • hgy29hgy29 Maintainer
    I just had a try (I only have a touchscreen at home, but I compile at the office). It almost works, only issue is that touch ids are not numbered as gideros docs says. Adding a mapping table should help, I'll do this next monday.

    Likes: SinisterSoft

    +1 -1 (+1 / -0 )Share on Facebook
  • I can test here - I have touch screen windows, multiple devices.

    Likes: keszegh

    Coder, video game industry veteran (since the '80s, ❤'s assembler), arrested - never convicted hacker (in the '90s), dad of five, he/him (if that even matters!).
    https://deluxepixel.com
    +1 -1 (+1 / -0 )Share on Facebook
  • Of course I'm up for it. I have a touch screen on what sounds like significantly less devices than SinisterSoft. :)

    Likes: keszegh

    +1 -1 (+1 / -0 )Share on Facebook
  • No crashing with many fingers. Output from test script with putting a few fingers on the screen and then lifting and replacing one of them repeatedly...

    Uploading finished.
    onTouchBegin. touch.id = 33554434
    onTouchBegin. touch.id = 33554435
    onTouchBegin. touch.id = 33554436
    onTouchBegin. touch.id = 33554437
    onTouchBegin. touch.id = 33554438
    onTouchBegin. touch.id = 33554439
    onTouchBegin. touch.id = 33554440
    onTouchBegin. touch.id = 33554441
    onTouchBegin. touch.id = 33554442
    onTouchBegin. touch.id = 33554443
    onTouchBegin. touch.id = 33554444
    onTouchBegin. touch.id = 33554445
    onTouchBegin. touch.id = 33554446
    onTouchBegin. touch.id = 33554447
    onTouchBegin. touch.id = 33554448
    onTouchBegin. touch.id = 33554449
    onTouchBegin. touch.id = 33554450
    ... putting three fingers down, one after another, then lifting all off and repeating...

    onTouchBegin. touch.id = 33554434
    onTouchBegin. touch.id = 33554435
    onTouchBegin. touch.id = 33554436
    onTouchBegin. touch.id = 33554434
    onTouchBegin. touch.id = 33554435
    onTouchBegin. touch.id = 33554436
    onTouchBegin. touch.id = 33554434
    onTouchBegin. touch.id = 33554435
    onTouchBegin. touch.id = 33554436
    onTouchBegin. touch.id = 33554434
    onTouchBegin. touch.id = 33554435
    onTouchBegin. touch.id = 33554436
    onTouchBegin. touch.id = 33554434
    onTouchBegin. touch.id = 33554435
    onTouchBegin. touch.id = 33554436
    So exactly as hgy29 describes, just the touch id numbering to go.

    Likes: keszegh, antix

    +1 -1 (+2 / -0 )Share on Facebook
Sign In or Register to comment.