Gesture API

Updated

UPDD V6 supports a gesture module which delivers information about detected on screen gestures via the UPDD API.

For Mac OS X the gesture API function is part of the comprehensive gesture software that can perform system actions associated with the gesture before the gesture is posted into the OS to invoke any gesture related functionality on the desktop or specific application.

Under Windows and Linux the gesture module is supplied specifically to post gesture data to the driver for onward dispatch to UPDD Client applications.

Download and installation

Download and install the MacOS gesture software from here. Install as instructed.  If using the gesture API interface only set the mode of operation to API only

Download and install the Windows gesture module from here. Copy and run the updd gesture application program from the UPDD installation folder, usually this is c:\program files\updd (x86)\.

Download and install the Linux gesture module from here. Copy and run the updd gesture application program from the UPDD installation folder, usually this is /opt/updd.

Once it is installed then the API can be used to receive gesture information.

You may wish to set up system start up items for the gesture software so that is is loaded at system start.

Once installed a gesture system tray / menu bar item icon will be seen  to invoke various functions:




Setting - load the settings dialog
Show gesture log to show gesture being performed
Change History - Lists development history
 

Invoke at system startup

It may be desirable to have the UPDD gesture software running at all times. In this case you need to implement a start up function to invoke the gesture software system startup or at user login, as per these suggestions:

 OS Start up method
MacOS The Gesture setting, Other tab, has a check box to 'Start UPDD Gestures at login'
Windows In this case you need to create a short cut in the start up folder to the the UPDD Gesture application residing in c:\program files (x86)\updd
Linux You need to use an appropriate application startup method to execute the following command as the logged in user at login time:

    /opt/updd/upddenv “/opt/updd/UPDD Gestures” &

API functions 

The method for receiving gesture information via the UPDD API is the same as for other data types, although a couple of additional steps are required in setting up the software to build.

//Add the following 2 lines before inclusing of the upddapi.h
#define
 UPDD_GESTURES
#include "TBGestureAnalysisTypes.h"
#include "upddapi.h"

//Ensure that the files TBGesturesAnalysisTypes.h and gestures_event.inl are both in the include path.
//Having done this simply use the constant _ReadDataTypeGestureEvent in an appropriate call to TBApiRegisterDataCallback

e.g.

TBApiRegisterEvent(0, (unsigned long)this, _EventTypeGesture, MyGestureCallback);

//Data specific to the gesture will be reported in the GestureEvent section of the PointerData structure to the registered callback.
//e.g.

void TBCALL MyGestureCallback(unsigned long /*context*/, _PointerEvent* ev)

{
if (ev->pe.gestureEvent.type == kTBGestureTwoFingerTap)
{
cout << "Saw a two finger tap" << endl;
}
}
The gestures software must be running to utilise the gestures API.

Gestures_Event.inl

This is an optional part of the API.

It is only used if you define the pre-processor macro UPDD_GESTURES

It provides additional information about gesture events.

Events are described here

http://support.touch-base.com/Documentation/50293/Callback-Events

the file gestures_event.inl has detailed information about the returned information for gestures.

Disabling / enabling gestures

Should you have any reason to temporarily disable gestures, such as when running you own touch screen calibration program under Mac, we have introduced a setting for enabling / disabling the gesture functionality and can be set as follows:

TBApiSetSettingFromInt(0, "gesture enabled", 0); // disable
TBApiSetSettingFromInt(0, "gesture enabled", 1); // enable

Alternatively it can be set from the command line interface like so:

upddutils nodevice set "gesture enabled" 0

Search