MultiTouch

From Jmol
Revision as of 18:27, 15 January 2010 by AngelHerraez (talk | contribs) (new page to collect details on multi-touch support in Jmol)
(diff) ← Older revision | Latest revision (diff) | Newer revision → (diff)
Jump to navigation Jump to search

Using Jmol with Multi-Touch Panels

..very rough draft yet..

(introduction)

Preliminary demo

(versions)

(details)

An adaptation of SparshUI to work with the Jmol application (either stand-alone or embedded) and the Jmol applet.

Custom gestures: SinglePointGesture and TwoPointGesture

Ports: 5946 for clients and 5947 for a single driver

Implemented gestures include:

- single touch up/down/move (standard mouse down,drag,up -- model rotation) - single-touch click (standard mouse click) - single-touch long click (model translation) - two-finger slide (model translation) - two-finger stretch (zoom in) - two-finger pinch (zoom out)

On the HP TouchSmart one first starts the device connection -- JmolMultiTouchDriver.exe. Then you start the Jmol application using the -Msparshui flag or, for the embedded application, initialize it with the command option -multitouch-sparshui. For the applet, include the JavaScript command:

  JmolSetCallback("multiTouchSparshUI", "true")

prior to

  JmolApplet(...)

Or, with my latest version of Jmol.js, you can add parameters to the URL line, so with that you can adapt any page to work with multi-touch. For example, if you have JmolMultiTouchDriver.exe running on your HP TouchSmart, the following should work:

http://chemapps.stolaf.edu/jmol/docs/examples-11/molecules/molecules.htm?PARAMS=multiTouchSparshUI:true

The driver will cycle while waiting for a connection, and the first Jmol application or applet that loads will start a gesture server that connects with it. If additional applets or applications load, then their gesture server will not connect, but they will find the other gesture server.

The problem of multiple overlapping windows was solved easily by only allowing SparshUI action within a window if that window has the focus. So one needs to first click on a model to activate SparshUI action within that window.

There might be a problem if one applet starts a server and then closes while another is using it. In addition, multiple applets on the same page are no problem, but applets on different pages within the same tabbed browser system probably cause problems. Just closing a page doesn't necessarily work. I've been using File|Close Tab in Firefox.


Terminology

swipe: put finger on surface, drag in a single direction, while continuing the drag motion lift finger from surface

flick: swipe but done must faster

Contributors

AngelHerraez