Node bindings for Gestureworks Core. Currently only Windows hosts are supported.
The init function must be called before any other commands. It will load the DLL and the GML files and kick off the internal event loop.
var gestureworks = require("gestureworks");
gestureworks.init(
'path/to/GestureworksCore.dll',
'path/to/gestures.gml',
1024, // viewport width
768 // viewport height
);
Most of the Core API is supported unmodified, with the following exceptions.
- All object keys use camelCase instead of snake_case, in keeping with node's standard coding style
-
loadGML()
andinitializeGestureWorks()
are called in theinit()
function and do not have to be invoked separately. -
registerWindowForTouch()
andregisterWindowForTouchByName()
are not supported. Instead, you are expected to register touch points manually viaaddEvent()
- There is no explicit
processFrame()
,consumePointEvents()
, orconsumeGestureEvents()
. Instead, the bindings are an EventEmitter instance and will fire 'point' and 'gesture' events.
Additionally, the bindings include a socket.io powered server, available through the serve()
method. It accepts either a port number or an http.Server instance, plus the same arguments as init()
.
var gestureworks = require("gestureworks");
gestureworks.serve(
8080, // port number or server
'path/to/GestureworksCore.dll',
'path/to/gestures.gml',
1024, // viewport width
768 // viewport height
);