summaryrefslogtreecommitdiffstats
path: root/res/controllers/HID-Trackpad.js
diff options
context:
space:
mode:
authorRJ Ryan <rryan@mixxx.org>2013-06-19 00:46:54 -0400
committerRJ Ryan <rryan@mixxx.org>2013-06-19 00:46:54 -0400
commit25d57b59dff3947212909634864dd82365c9606b (patch)
treef0d0f8a048f8ed2f45c5ff015fc96891662f72f1 /res/controllers/HID-Trackpad.js
parente50f9f168fa08f2be6d0f13e8a225bbcc9de09bb (diff)
Moving mixxx/* to the root. A new era begins!
Diffstat (limited to 'res/controllers/HID-Trackpad.js')
-rw-r--r--res/controllers/HID-Trackpad.js32
1 files changed, 32 insertions, 0 deletions
diff --git a/res/controllers/HID-Trackpad.js b/res/controllers/HID-Trackpad.js
new file mode 100644
index 0000000000..febd3eeae8
--- /dev/null
+++ b/res/controllers/HID-Trackpad.js
@@ -0,0 +1,32 @@
+//
+// Demo script to print events from apple bluetooth trackpad on OS/X
+// NOTE: the trackpad doesn't seem to actually send events to us. This
+// is just a silly example anyway
+// Copyright (C) 2012, Ilkka Tuohela
+// Feel free to use whatever way wish1
+//
+
+HIDTrackpad = new HIDTrackpadDevice();
+
+HIDTrackpad.init = function(id) {
+ HIDTrackpad.id = id;
+ HIDTrackpad.registerInputPackets();
+ HIDTrackpad.registerOutputPackets();
+ HIDTrackpad.registerScalers();
+ HIDTrackpad.registerCallbacks();
+ HIDDebug("HID Trackpad Initialized: " + HIDTrackpad.id);
+}
+
+HIDTrackpad.shutdown = function() {
+ HIDDebug("HID Trackpad Shutdown: " + HIDTrackpad.id);
+}
+
+HIDTrackpad.incomingData = function(data,length) {
+ var controller = HIDTrackpad.controller;
+ if (controller==undefined) {
+ HIDDebug("Error in script initialization: controller not found");
+ return;
+ }
+ controller.parsePacket(data,length);
+}
+