Native to Touch & Mouse to Touch
Sometimes you might want to convert the native TouchEvents into TuioTouchEvents because there may be no tuio driver or tuiobridge for your touchscreen. This can be done with the NativeTuioAdapter which you simply have to use like the TuioCLient and will convert Flash's native TouchEvents into TuioTouchEvents.
-
import org.tuio.adapters.*;
-
[...]
-
var nta:NativeTuioAdapter = new NativeTuioAdapter(stage);
-
var tm:TuioManager = TuioManager.init(stage);
-
nta.addListener(tm)
The NativeTuioAdapter can also be used with TuioDebug.
-
import org.tuio.adapters.*;
-
[...]
-
var nta:NativeTuioAdapter = new NativeTuioAdapter(stage);
-
var tm:TuioManager = TuioManager.init(stage);
-
var tDbg:TuioDebug = TuioDebug.init(stage);
-
-
nta.addListener(tm);
-
nta.addListener(tDbg);
What about the Mouse
Converting MouseEvents into TuioTouchEvents works the same way and also gives you the same possibilities of using the TuioManager and the TuioDebug or not.
-
import org.tuio.adapters.*;
-
[...]
-
var mta:MouseTuioAdapter = new MouseTuioAdapter(stage);
-
var tm:TuioManager = TuioManager.init(stage);
-
var tDbg:TuioDebug = TuioDebug.init(stage);
-
-
mta.addListener(tm);
-
mta.addListener(tDbg);
August 20th, 2010 - 17:32
My application works with TUIO on Tabletop but I’ve just start to use a Multitouch Screen and want to use this specific part of your library in order to use it.
The Transformation Gestures don’t seem to work, actually It only seems to dispatch TouchEvent.TOUCH_DOWN & TouchEvent.TOUCH_UP , I can’t get the TouchEvent.TOUCH_MOVE.
Do you have any explanation about that?
Thank you.
August 21st, 2010 - 11:52
Mh TOUCH_MOVE should work because it is implemented … Maybe you could check if the actual native move TouchEvent is dispatched by adding a listener to the stage.
Additionally the GestureManager currently only works in combination with the TuioManager but that will probably be changed in a future release if needed.
August 23rd, 2010 - 14:57
I find a way for the TOUCH_MOVE : on “Windows7TouchToTuioDispatcher”, the “TuioContainer” created with the function “createTuioContainer” have 0 as value by default for X,Y,Z so the “handleUpdate” function on TUIOManger.as cannot dispatch the TouchEvent.TOUCH_MOVE.
I use the TuioManager, and the GestureManager, now everything work with TUIO table, and the Touch_Down/Touch_Up/Touch_Move work. But I don’t understand what to do in order to use GestureManager with Windows7TouchToTuioDispatcher.
Do you have some examples?
I’m kind of noob
August 23rd, 2010 - 16:49
Mh it should just work if you use the GestureManager instead of the TuioManager. Let me know if that does the trick and thanks for the tip on how to fix the TOUCH_MOVE.
November 5th, 2010 - 05:54
I have the same issue: http://code.google.com/p/tuio-as3/issues/detail?id=10
Trying to use mouseToTouchDispatcher, but X,Y,Z are set to 0 and therefore TOUCH_MOVE isn’t ever dispatched.
I’m using gesturemanger/tuiomanager.
April 29th, 2011 - 16:31
Hi,
I am only able to get TOUCH_MOVE to work if I use the TUIO Simulator ( reactiVision). It does not work on my Windows 7 touch system or with the md:MouseToTouchDispatcher.
I guess this is the same problem Seth has. I can work around the problem by just using the simulator but it would be super to be able to have the md:MouseToTouchDispatcher work.
Here is the relevant initialization code:
_tuioClient = new TuioClient(new LCConnector());
_tuioManager = TuioManager.init(stage, _tuioClient);
_gestureManager = GestureManager.init(stage, _tuioClient);
var winTouch:Windows7TouchToTuioDispatcher = new Windows7TouchToTuioDispatcher(stage, true, true);
_tuioDebug = TuioDebug.init(stage);
_tuioClient.addListener(_tuioDebug);
var md:MouseToTouchDispatcher = new MouseToTouchDispatcher(stage,true,true);
Any ideas?
April 29th, 2011 - 19:34
This should already be fixed since ages in the svn version of the library but somehow didn’t find its way into an official release yet <.<
I'd suggest checking out the latest revision since it should be working just fine although there are a bunch of api changes in there …
An alternative would be patching the MouseToTouchDispatcher or Windows7TouchDispatcher yourself by having a look at the source from r148 till now.
April 29th, 2011 - 23:51
Super! I will have a look at the latest version in SVN.