My favorites | Sign in
Project Home Downloads Wiki Issues Source
Project Information
Members

SimTouch

SimTouch is an Adobe Air application that simulates native touch events on the Flash platform. SimTouch is a transparent app that sits on top of the application that you are developing and dispatches TouchEvents to your application through a connection class. Additionally, by using the SimConnect class you can use your iPhone to simulate Touch Events.

Currently SimTouch only dispatches TOUCH_BEGIN, TOUCH_MOVE, and TOUCH_END events.

My name is Matt. (mlegrand at gmail.com) Let me know if I can help and please message me with the what your working on. I'd love to see what you're building with SimTouch or on top of SimTouch. It is licensed under the MIT license because it's the most liberal license I could find. Feel free to give credit to your drunken uncle Rico or crotchety aunt Susie.

Screen Shots

Video

Here is a video talking about SimTouch: http://multitouchup.com/?p=404

And here is a quick YouTube video that shows SimTouch being used in with the Physics.as example. This video was taken using the first version of SimTouch that is primarily for the TUIO protocol.

http://www.youtube.com/watch?v=MkRXr2Y85c0

More Details

The SimTouch application works by sending data over sockets. You can either send data over up sockets using a custom binary protocol or you can send touch data over tcp sockets using an XML protocol. Both perform well and I haven’t detected too much improvement using UDP. However UDP is required to use the iPhone connection method.

To use the SimConnect swc with the flex framework, simply download the swc and drop it in you ‘libs’ folder of you new application. To start the connection class simply pass the stage to a new SimConnection class. ex:

<s:WindowedApplication 
xmlns:fx=”http://ns.adobe.com/mxml/2009″
xmlns:s=”library://ns.adobe.com/flex/spark”
xmlns:mx=”library://ns.adobe.com/flex/halo”
applicationComplete=”applicationCompleteHandler(event)”
width=”1024″ height=”768″>

<fx:Script>
<![CDATA[

import com.multitouchup.simConnect.SimConnection;
import mx.events.FlexEvent;

protected function applicationCompleteHandler(event:FlexEvent):void
{

var s:SimConnection = new SimConnection(this.stage, 3333, "127.0.0.1", debugCan, false, false);

}
]]>
</fx:Script>

<canvas id="”debugCan”" width="”100%”" height="”100%”">
</canvas>

Unknown end tag for </windowedapplication>

The preceding example shows a the start of the SimConnection class and passes in the stage, port, socket connection location, a debug canvas and sets udp to false and gestures to false. Gestures

Currently the SimConnection class doesn’t dispatch gestures. I do intend to build out that functionality someday.

Connection to the iPhone

The software that I am currently using to connect to SimConnect is called MSA Remote by Memo(http://www.memo.tv/). It’s uses a custom UDP protocol to send Touch messages. In order to connect to the iPhone I would use the previous code but set the socket location to the location of the current computer on the network and turn UDP to true.

Why is my application all jittery?

You may run into a bug in the Adobe Flex framework where when your application looses focus the framerate is dropped to 1 frame per second. This is a known bug (SDK-25126) and is working correctly as of Flex 4 revision 14001. I suggest going to opensource.adobe.com and pull a more resent version of the Flex SDK where they have this issue fixed. 1

Using the TUIO protocol?

If you are interested in using this application with TouchLib and the TUIO protocol please use the older version of this application. At some point I’ll try to add an additional settings option for the folks that are interested in building apps with this library. If you are using the old SimTouch, remember that you’ll need an additional socket server to connect with.

Download

http://simtouch.googlecode.com/svn/trunk/SimTouch/src/SimTouch.air

Adobe Air run-time is required: http://www.adobe.com

Socket Server

Here is an example of a PHP socket server for relaying XML Socket messages that I've been using on a Mac:

http://www.rshields.com/?q=node/91

Additionally Richard Shields was kind enough to post a Mac and PC C++ version of his relay socket server that also works extremely well. (Used to make video on Vista)

http://www.rshields.com/?q=node/116

I also added a zip of Mac and PC versions running on port 3000: http://simtouch.googlecode.com/svn/trunk/SimTouch/socketservers.zip

Powered by Google Project Hosting