Search Unity

Testing Multi-touch inputs on desktop computer?

Discussion in 'Editor & General Support' started by Kaji-Atsushi, Mar 23, 2015.

  1. Kaji-Atsushi

    Kaji-Atsushi

    Joined:
    Oct 6, 2012
    Posts:
    234
    Is there a way to test multi-touch inputs on a computer? I'm thinking there should be some way to fake multi-touch inputs and just manually move them around/activate one by one it via mouse? I guess theres a way to do it with some pseudo game-object raycasts/collisions code to act as touch input. But I was wondering if there was a simpler solution.
     
  2. twobob

    twobob

    Joined:
    Jun 28, 2014
    Posts:
    1,763
    simpler than clicking on the area where someone would put their finger?
    and perhaps cloning that hit out across 5 (or 10) areas

    What kind of "simpler" did you have in mind?

    Will this actually involve human interaction or do you mean like Unit tests?

    I generally attach the /actual/ device if I have the exact one. I keep a few multi-touch devices around for such things. So I don't really have this problem but as you say - my 1st instinct - would be to spread the single hit around.
     
  3. greg-harding

    greg-harding

    Joined:
    Apr 11, 2013
    Posts:
    381
    TouchScript, TouchKit, FingerGestures, and other touch solutions usually have support for this too. Often pressing alt or option while pressing the mouse button will provide a secondary touch for testing purposes in the editor.

    You could also use something like TouchScript and another network device sending TUIO touch events which is what we're doing right now. Check out TouchScript, TUIOpad (iOS, free) and our code (wip) for integrating touches with the new Unity UI;

    https://github.com/TouchScript/TouchScript
    TouchScriptInputModule.cs (https://gist.github.com/gregharding/12081413d0f398a41e94)
     
    twobob likes this.
  4. bnas

    bnas

    Joined:
    Feb 4, 2015
    Posts:
    2
    hello
    I would use TouchScript Input Module but I can not use it, I work in unity with the 4.6 GUI. But I can not have the focus on multiple GUI, for cons I performed a piano in 3D and I have no problem with TouchScript.
    I really need help, thanking you in advance
    Bastos
     
  5. greg-harding

    greg-harding

    Joined:
    Apr 11, 2013
    Posts:
    381
  6. bnas

    bnas

    Joined:
    Feb 4, 2015
    Posts:
    2
    Thank you for you're answer greg harding, that I am working on a project, and it has several slider, I work in unity so with 4.6 UI. But impossible to operate touchscript with the UI. I saw several people have already asked this question, but I do not understand the answers, or I can not put them into applications ;) . That's if anyone can help me
    Thank you in advance
     
  7. greg-harding

    greg-harding

    Joined:
    Apr 11, 2013
    Posts:
    381
    It's not impossible :) TouchScript currently doesn't have an official InputModule that you can just drop onto an EventSystem and use for Unity UI, but on the TouchScript forums I linked to there are several work-in-progress implementations you can try.

    I have also contributed a work-in-progress TouchScriptInputModule.cs (based on the Unity UI code, works in Unity 5 so you might need to tweak it slightly for Unity 4.6) that works for our current projects, and supports some network-based TUIO input. It still needs some work (I have to update the gist code as well), is not fully tested, and probably contains some bugs, but feel free to try it out - add it as an input module on your EventSystem gameobject, add the TouchScript TouchManager and other special inputs you need to support (such as TuioInput).

    To set up and troubleshoot you will need some understanding of how Unity UI and TouchScript work, and c# if you need to tweak the code a bit.
     
  8. jjxtra

    jjxtra

    Joined:
    Aug 30, 2013
    Posts:
    991
    Fingers - Gesture for Unity supports Shift and Control to do pinch and rotate gestures. You can also use the left, middle and right mouse buttons to simulate different fingers. Unity is broken in the editor and player for Windows touch screens and tablets, but should work fine if you deploy a .exe file.