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.
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:
force |
Starts the tongsengmod client and registers the responder to receive multitouch messages. |
Terminates the tongsengmod client and unregisters the responder.
force |
A simple GUI to see if things are working fine. |
argDevice |
argDevice is \internal for internal trackpad (default) and \external for external trackpad. |
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:
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]
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.
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]
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.
get the gui window if there is one
check whetehr the gui is on.
check whether the tongsengmod program is running.
get and set the device to \internal or \external
.
the OSCresponder used by MultiTouchPad
processes incoming OSC messages from tongsengmod process
a dict and a list with the currently active finger touchpoints.
get the pid number of the currently running tongsengmod process
get the function to run when tongsengmod stops.