Search Unity

Managing multiple touchscreens setup

Discussion in 'Input System' started by z_orochii, Mar 7, 2020.

  1. z_orochii

    z_orochii

    Joined:
    Mar 8, 2013
    Posts:
    20
    Hi! I'm making an application where I need to have two displays, each with touchscreen capabilities. I am trying out the new InputSystem as people mentioned somewhere that it should be able to do things as what I'm gonna describe. But I've been experiencing problems and can't figure it out if it's my fault or the system is still not there.

    The premise of the application is to be used by kids in an installation, each display one against the other, and the kids "compete" and do stuff simultaneously. However for some reason Unity still doesn't seem to recognize more than one touchscreen (I printed all plugged in InputDevices using Touchscreen.all, and it recognized three things: Keyboard, Mouse and 1 Touchscreen, should be two).

    Now, I can do things on both screens, but only by using the mouse abstraction. UI seems to work that way,

    I can't show you screenshots from the configuration right now as I'm not at the workplace, but both screens are properly configured, Windows recognizes both as touchscreens.

    Any help, information on the current status of the InputSystem and its capabilities, or insights on how to properly work with multiple touchscreens is very much appreciated. Thanks!
     
  2. Rene-Damm

    Rene-Damm

    Joined:
    Sep 15, 2012
    Posts:
    1,779
    This is an unfortunate limitation ATM of the native backend code. It's on the list to get worked on.

    The managed system does support arbitrary many Touchscreens but the native Windows backend will only register one such device and route all touch input into it.
     
    z_orochii likes this.
  3. z_orochii

    z_orochii

    Joined:
    Mar 8, 2013
    Posts:
    20
    Hi, I'm back. I've been testing a bit this stuff, and made a couple projects for testing, each one with different configurations.

    Basically, trying between 2018.4 and 2019.3, with and without the new InputSystem. Here are my general observations.

    Just to note, the reversed screens is not an issue, just something I noted for my own stuff.

    Basically Windows was adamant on changing the devices order, tried changing the cables, one was in a VGA port, the other in an HDMI, no luck, Windows had them registered in a specific order already, so no other way other than good old swap screens physically. The USB however, if I swapped them, the input was shown in the wrong screen.

    Again nothing Unity related just something I wanted to comment. But Unity receives the displays from the OS so yeah keep that in mind.

    As far as I can tell, 2019 and 2018 have same behaviour. Which means it hasn't improved (too much) since InputSystem 0.2.

    The input inconsistency means the first screen works fine, but the second screen seems to drop inputs whenever it feels like it. Say, I try holding a button down with my finger, it blinks once, then takes a fraction of a second, then it keeps pressed. Kind of weird but for basic UIs it works.

    The new InputSystem however, seems to lose all but the last display, as far as I can tell? I actually had to revert my project back to the old backend. And by the way, removing the Input System package was not enough. Had to delete all folders besides Assets. Yes, even Project Settings.

    Hopefully anything of this helps. Love Unity, and thanks for everything dudes.

    EDIT: Forgot to include my crappy test projects. There you go.
     

    Attached Files:

  4. MS80

    MS80

    Joined:
    Mar 7, 2014
    Posts:
    346
    Hi, is there any progress on this topic? The new input system has evoled, but it seems still missing support for windows multiple touch displays?!
     
  5. XCompWiz

    XCompWiz

    Joined:
    Jan 6, 2016
    Posts:
    5
    I'm also running into this issue.
    I'm building an art installation for a library and they have 10 Displax touch-film inputs, each routed through their own USB. Unity happily accepts input from any one of them, but not more than one at a time.
    Displax recommended using Windows pointer events, but Unity doesn't seem to support those? The experimental UIToolkit has pointer events, but I think those are wrapping the Unity internal input system, and not exposing Windows' Pointer Events?

    Any ideas or suggestions?
     
  6. frank-ijsfontein

    frank-ijsfontein

    Joined:
    Sep 11, 2015
    Posts:
    16
    Has anyone found a solution for this problem yet? I have a project that uses 2 touch screens. Tapping the second screen only works when the first screen is not touched. So no chance of simultaneously dragging ui objects, which is the main interaction of our project.

    My drag & drop code doesn't support the new Input system (or the other way round) so we still use the old input system.
     
  7. vinayakmarv

    vinayakmarv

    Joined:
    Feb 16, 2022
    Posts:
    2
    Hey frank-ijsfontein, can share if it is working on windows platform and if it does then how you set it up as I am unable to do so.
     
  8. frank-ijsfontein

    frank-ijsfontein

    Joined:
    Sep 11, 2015
    Posts:
    16
    We ended up using a self-modified version of TouchScript, that correctly handles touches from multiple touch screens on Windows.
     
  9. dispatch_starlost

    dispatch_starlost

    Joined:
    Nov 17, 2017
    Posts:
    37
    Hey mate, I don't suppose you could share this code or give me some pointers on how to implement multiple touchscreens?
     
  10. aardruss

    aardruss

    Joined:
    Feb 28, 2022
    Posts:
    5
    Going to jump in here as well. Would be keen to know about this or the level of work required as it's something we're scoping out now. Good to know you solved it though @frank-ijsfontein
     
  11. dispatch_starlost

    dispatch_starlost

    Joined:
    Nov 17, 2017
    Posts:
    37
    We solved this by abandoning the idea of multiple displays/cameras in unity.

    Instead we run 1 camera on 1 display as if we are building to a single screen device, and then run the application using arguments -popupwindow -screen-height Y -screen-width X, where Y and X are our height/width of all screens combined. In our instance we are running 4x 4k TVs so its 7680x4320.

    As long as your screens are set up nicely the application will span across all monitors and the touch will work properly.
    I think there is a bit of a performance hit but our stuff is basic enough that it's not a problem.

    I'd still be keen to implement multiple touchscreens properly in Unity, so I'll be keeping an eye on this thread and hopefully Frank replies :)
     
  12. jorrit-ijsfontein

    jorrit-ijsfontein

    Joined:
    Jan 26, 2015
    Posts:
    6
    The code @frank-ijsfontein mentions can be found at
    https://github.com/IJsfontein/TouchScript/tree/feature/multiple-windows-support. This has been tested with setups consisting of two touchscreens and additional screens/beamers, but should be able to support more touchscreens. Note that we haven't tested setups where the touchscreens had different resolutions.

    The native plugin is in External/MultiWindowsTouch and the unity side can be found in Source/Assets/TouchScript/Modules/MultiWindow. There is a small example how to use this. Some familiarity with TouchScript is expected.
     
    Last edited: Mar 1, 2023
    frank-ijsfontein likes this.
  13. dispatch_starlost

    dispatch_starlost

    Joined:
    Nov 17, 2017
    Posts:
    37
    Thankyou for replying! Hopefully this can help more people in the future who stumble across this thread.
     
  14. smartgaurav545

    smartgaurav545

    Joined:
    Dec 20, 2021
    Posts:
    2
    hii did you find the solution?
     
  15. smartgaurav545

    smartgaurav545

    Joined:
    Dec 20, 2021
    Posts:
    2
    i tried to setup 1 camera and 1 display. i have two touch screen and using nvidia graphic card to convert both screen into one. but when i did this the touch works only in one screen and my application is not open in 3840*1080. can you help me?