MultiTouchPad:
Filter:
MultiTouchPad/Classes (extension) | Interfaces

MultiTouchPad
ExtensionExtension

use multitouch MacBook trackpads on OSX as controllers.

Description

MultiTouchPad is a quark and class written by Batuhan Bozkurt which allows using multitouch enabled touchpads on current MacBook models. MTP is a variant with some extensions by Alberto de Campo. MultiTouchPad is a Singleton class, so there are only class methods.

NOTE: MultiTouchPad requires installation!

Touchpad support is not integrated into SC at this time, so you need to download, compile and install tongsengmod (an application forked from the tongseng project to be used with SC) to make use of this class. This class handles the execution and termination of the tongsengmod application behind the scenes, so all you need to do is to compile and install it once:

This puts the tongsengmod program file in /usr/local/bin, where SC finds it. MultiTouchPad.progpath = "/usr/local/bin";

For standalones, it is best to put it in the app's resource directory, and tell MultiTouchPad to look there:

Works with OSX versions from Leopard (10.5) up to El Capitan (10.11).

First code examples:

Class Methods

.start

Arguments:

force

Starts the tongsengmod client and registers the responder to receive multitouch messages.

.stop

Terminates the tongsengmod client and unregisters the responder.

.gui

Arguments:

force

A simple GUI to see if things are working fine.

.setDevice

Arguments:

argDevice

argDevice is \internal for internal trackpad (default) and \external for external trackpad.

.progpath

the path where MultiTouchPad expects to find the tongsengmod program file. By default this is "/usr/local/bin", which is where the installer puts it. For standalones, it is best to put it in the app's resource directory, and tell MultiTouchPad to look there:

Accessing variables

.touchAction

A function to be executed when a new finger touch is detected. The function is passed in two arguments: curID and xys. curID is a unique integer for the lifetime of a finger on the touchpad. xys is an array with three elements: [x position, y position, blob size]

.untouchAction

A function to be executed when a finger leaves the touchpad. The function is passed in the ID of the raised finger that was previously registered with touchAction.

.setAction

A function to be executed when fingers move on the touchpad surface. The function is passed in two arguments: curID and xys. curID is a unique integer for the lifetime of a finger on the touchpad. xys is an array with three elements: [x position, y position, blob size]

.resetActions

MultiTouchPad.resetActions; Resets all actions to empty functions. Handy to make sure all actions are cleared as you can't create new instances of this class.

Internal variables and methods

.guiWin

get the gui window if there is one

.guiOn

check whetehr the gui is on.

.isRunning

check whether the tongsengmod program is running.

.device

get and set the device to \internal or \external.

.responder

the OSCresponder used by MultiTouchPad

.processOSC

processes incoming OSC messages from tongsengmod process

.fingersDict

.activeBlobs

a dict and a list with the currently active finger touchpoints.

.pid

get the pid number of the currently running tongsengmod process

.stopFunc

get the function to run when tongsengmod stops.

Examples