-
Notifications
You must be signed in to change notification settings - Fork 1
/
WacomBambooPen.sc
53 lines (47 loc) · 1.12 KB
/
WacomBambooPen.sc
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
WacomBambooPen {
var <device
;
*new {
GeneralHID.buildDeviceList;
^super.new.init
}
init { arg server;
this.get_device;
this.assignNames;
this.createBuses;
}
get_device {
device = GeneralHID.open(
// Wacom Bamboo Pen specific
GeneralHID.findBy(1386, 212, nil, 262)
);
device.grab
}
assignNames {
device.add(\x, [3, 0]);
device.add(\y, [3, 1]);
device.add(\z, [3, 24]);
device.add(\b1, [1, 331]);
device.add(\b2, [1, 332]);
device.add(\hover, [1, 320]);
device.add(\touch, [1, 330]);
// device.add(\unknown, [1, 321]);
}
createBuses { arg server;
device[\x].createBus(server);
device[\y].createBus(server);
device[\z].createBus(server);
device[\b1].createBus(server);
device[\b2].createBus(server);
device[\hover].createBus(server);
device[\touch].createBus(server);
}
// Assign each bus to an instance var
x { ^device[\x].bus }
y { ^device[\y].bus }
z { ^device[\z].bus }
b1 { ^device[\b1].bus }
b2 { ^device[\b2].bus }
hover { ^device[\hover].bus }
touch { ^device[\touch].bus }
}