For ADB, the decoding of bits is done by overlaying a bitfield structure ...
Ah, so I was misreading. Fair enough.
BTW, it is very well possible that the ADB puck works - just that it will be reported as a pen. Not all the puck buttons might be mapped (how many buttons do you have on your puck?).
Puck button encoding (on the adb side) is different to pen button encoding. Because the pen button encoding is insane. Here's how it works:
For a puck : the "button" nybble encodes the button number on the puck as follows (at least for my 4 button puck, the intuos lens cursor and so on have at least 5 buttons) :
1 - Front Centre
2 - Left
3 - Back centre
4 - Right
Note - this doesn't allow for detection of multiple buttons at once. It seems to pick up the first button pressed. I do not believe there is any difference between the packets sent by the "lens" puck and a non-lens variant, except where the samples are centred.
I'd guess you have pen button encoding handled properly, but just in case:
For the stylus (ultrapen eraser), it's all a bit arse arse as the number is a bitmap of the "tip pressed" and button
Button = 1 - nib pressed
Button = 2 - side button 1 pressed
Button = 3 - nib pressed and side button 1 pressed
button = 4 - side button 2 pressed in proximity *or* eraser in proximity
Button = 5 - Eraser pressed *or* side button 2 pressed and tip pressed
Button = 6 - Eraser in proximity with side button 1 pressed
Button = 7 - can't do this, I don't think.
A little explanation from the wacom docs...
# When the eraser is in proximity of the tablet, or the second side switch is pressed while the pen is
# in proximity, then the tablet will transmit a switch number of 4. When the eraser tip is pressed
# against the tablet, or the second side switch is pressed while the pen tip is pressed against the
# tablet, then the tablet will transmit a switch state of 5.
# Note that the tablet cannot detect the difference between an eraser in proximity and a pen tip with
# the 2nd side switch pressed in proximity (switch state 4), and it cannot detect the difference
# between an eraser pressed against the tablet and a tip pressed against the tablet while the 2nd side
# switch is pressed (switch state 5).
# Note: The WACOM drivers differentiate between the eraser function and the second side switch
# function by analyzing the first switch state transmitted after the pen enters proximity: if the initial
# switch state is 4, the driver assumes that an eraser is now in proximity, and if the initial switch
# state is 0 and changes later to 4 or 5, then the driver assumes that the pen tip is in proximity and
# that the 2nd side switch was pressed at the later moment.
If you want to use the puck then we can try to fix it (if we ever found what a puck "tool id" looks like?). The best would be to find someone with a similar Intuos2 device and make him run a USB Trace to see the packets.http://linuxwacom.git.sourceforge.net/git/gitweb.cgi?p=linuxwacom/input-wacom;a=blob;f=2.6.36/wacom_wac.h;h=a4399a41f8d3ee658f1651d44cbdd965e9128dba;hb=HEAD
suggests that the HID report identifier should probably be 0x06, but I'm not certain if it sends a different packet. Would need to trawl through the Linux code again, I think.
/* device IDs */
#define STYLUS_DEVICE_ID 0x02
#define TOUCH_DEVICE_ID 0x03
#define CURSOR_DEVICE_ID 0x06
#define ERASER_DEVICE_ID 0x0A
#define PAD_DEVICE_ID 0x0F