Skip to content

Instantly share code, notes, and snippets.

Show Gist options
  • Save fahrstuhl/ba927e503073435479cf95d0ce01dcbf to your computer and use it in GitHub Desktop.
Save fahrstuhl/ba927e503073435479cf95d0ce01dcbf to your computer and use it in GitHub Desktop.
Decoded USB descriptor of XP-PEN Artist 13.3 graphics tablet.
0x05, 0x0D, // Usage Page (Digitizer)
0x09, 0x02, // Usage (Pen)
0xA1, 0x01, // Collection (Application)
0x85, 0x07, // Report ID (7)
0x09, 0x20, // Usage (Stylus)
0xA1, 0x00, // Collection (Physical)
0x09, 0x42, // Usage (Tip Switch)
0x09, 0x44, // Usage (Barrel Switch)
0x09, 0x45, // Usage (Eraser) <---- This is the second barrel button. Eraser seems wrong. Linux maps it to the same button as the Tip Switch.
0x15, 0x00, // Logical Minimum (0)
0x25, 0x01, // Logical Maximum (1)
0x75, 0x01, // Report Size (1)
0x95, 0x03, // Report Count (3)
0x81, 0x02, // Input (Data,Var,Abs,No Wrap,Linear,Preferred State,No Null Position)
0x95, 0x02, // Report Count (2)
0x81, 0x03, // Input (Const,Var,Abs,No Wrap,Linear,Preferred State,No Null Position)
0x09, 0x32, // Usage (In Range)
0x95, 0x01, // Report Count (1)
0x81, 0x02, // Input (Data,Var,Abs,No Wrap,Linear,Preferred State,No Null Position)
0x95, 0x02, // Report Count (2)
0x81, 0x03, // Input (Const,Var,Abs,No Wrap,Linear,Preferred State,No Null Position)
0x75, 0x10, // Report Size (16)
0x95, 0x01, // Report Count (1)
0x35, 0x00, // Physical Minimum (0)
0xA4, // Push
0x05, 0x01, // Usage Page (Generic Desktop Ctrls)
0x09, 0x30, // Usage (X)
0x65, 0x13, // Unit (System: English Linear, Length: Centimeter)
0x55, 0x0D, // Unit Exponent (-3)
0x46, 0x2D, 0x2D, // Physical Maximum (11565)
0x27, 0xC0, 0x72, 0x00, 0x00, // Logical Maximum (29375)
0x81, 0x02, // Input (Data,Var,Abs,No Wrap,Linear,Preferred State,No Null Position)
0x09, 0x31, // Usage (Y)
0x46, 0x69, 0x19, // Physical Maximum (6505)
0x27, 0x8C, 0x40, 0x00, 0x00, // Logical Maximum (16523)
0x81, 0x02, // Input (Data,Var,Abs,No Wrap,Linear,Preferred State,No Null Position)
0xB4, // Pop
0x09, 0x30, // Usage (Tip Pressure)
0x45, 0x00, // Physical Maximum (0)
0x26, 0xFF, 0x1F, // Logical Maximum (8191)
0x81, 0x02, // Input (Data,Var,Abs,No Wrap,Linear,Preferred State,No Null Position)
0xC0, // End Collection
0xC0, // End Collection
0x09, 0x0E, // Usage (0x0E)
0xA1, 0x01, // Collection (Application)
0x85, 0x05, // Report ID (5)
0x09, 0x23, // Usage (0x23)
0xA1, 0x02, // Collection (Logical)
0x09, 0x52, // Usage (0x52)
0x09, 0x53, // Usage (0x53)
0x25, 0x0A, // Logical Maximum (10)
0x75, 0x08, // Report Size (8)
0x95, 0x02, // Report Count (2)
0xB1, 0x02, // Feature (Data,Var,Abs,No Wrap,Linear,Preferred State,No Null Position,Non-volatile)
0xC0, // End Collection
0xC0, // End Collection
0x05, 0x0C, // Usage Page (Consumer)
0x09, 0x36, // Usage (Function Buttons)
0xA1, 0x00, // Collection (Physical)
0x85, 0x06, // Report ID (6)
0x05, 0x09, // Usage Page (Button)
0x19, 0x01, // Usage Minimum (0x01)
0x29, 0x20, // Usage Maximum (0x20) <---- Uses 32 button maps even though it only has 6 buttons. The buttons are mapped to EV_KEY events BTN_0 to BTN_6, which seem useless and can't really be mapped in software.
0x15, 0x00, // Logical Minimum (0)
0x25, 0x01, // Logical Maximum (1)
0x95, 0x20, // Report Count (32) <---- Defines 32 buttons
0x75, 0x01, // Report Size (1)
0x81, 0x02, // Input (Data,Var,Abs,No Wrap,Linear,Preferred State,No Null Position)
0xC0, // End Collection
// 140 bytes
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment