Skip to main content

hid_types/id/usage/
digitizers.rs

1//! Well-known Usage ID values from the Digitizers Usage Page.
2
3use num_enum::{IntoPrimitive, TryFromPrimitive};
4
5use crate::Ident;
6
7/// Well-known Usage ID values from the Digitizers Usage Page.
8///
9/// See [HID Usage Tables for Universal Serial Bus](https://www.usb.org/document-library/hid-usage-tables-17),
10/// section 16.
11#[expect(missing_docs)]
12#[derive(Clone, Copy, Debug, Eq, PartialEq, TryFromPrimitive, IntoPrimitive)]
13#[repr(u16)]
14pub enum KnownUsage {
15    Undefined = 0x00,
16    Digitizer = 0x01,
17    Pen = 0x02,
18    LightPen = 0x03,
19    TouchScreen = 0x04,
20    TouchPad = 0x05,
21    Whiteboard = 0x06,
22    CoordinateMeasuringMachine = 0x07,
23    ThreeDDigitizer = 0x08,
24    StereoPlotter = 0x09,
25    ArticulatedArm = 0x0A,
26    Armature = 0x0B,
27    MultiplePointDigitizer = 0x0C,
28    FreeSpaceWand = 0x0D,
29    DeviceConfiguration = 0x0E,
30    CapacitiveHeatMapDigitizer = 0x0F,
31    // 0x10-0x1F reserved
32    Stylus = 0x20,
33    Puck = 0x21,
34    Finger = 0x22,
35    DeviceSettings = 0x23,
36    CharacterGesture = 0x24,
37    // 0x25-0x2F reserved
38    TipPressure = 0x30,
39    BarrelPressure = 0x31,
40    InRange = 0x32,
41    Touch = 0x33,
42    Untouch = 0x34,
43    Tap = 0x35,
44    Quality = 0x36,
45    DataValid = 0x37,
46    TransducerIndex = 0x38,
47    TabletFunctionKeys = 0x39,
48    ProgramChangeKeys = 0x3A,
49    BatteryStrength = 0x3B,
50    Invert = 0x3C,
51    XTilt = 0x3D,
52    YTilt = 0x3E,
53    Azimuth = 0x3F,
54    Altitude = 0x40,
55    Twist = 0x41,
56    TipSwitch = 0x42,
57    SecondaryTipSwitch = 0x43,
58    BarrelSwitch = 0x44,
59    Eraser = 0x45,
60    TabletPick = 0x46,
61    TouchValid = 0x47,
62    Width = 0x48,
63    Height = 0x49,
64    // 0x4A-0X50 reserved
65    ContactIdentifier = 0x51,
66    DeviceMode = 0x52,
67    DeviceIdentifier = 0x53,
68    ContactCount = 0x54,
69    ContactCountMaximum = 0x55,
70    ScanTime = 0x56,
71    SurfaceSwitch = 0x57,
72    ButtonSwitch = 0x58,
73    PadType = 0x59,
74    SecondaryBarrelSwitch = 0x5A,
75    TransducerSerialNumber = 0x5B,
76    PreferredColor = 0x5C,
77    PreferredColorIsLocked = 0x5D,
78    PreferredLineWidth = 0x5E,
79    PreferredLineWidthIsLocked = 0x5F,
80    LatencyMode = 0x60,
81    GestureCharacterQuality = 0x61,
82    CharacterGestureDataLength = 0x62,
83    CharacterGestureData = 0x63,
84    GestureCharacterEncoding = 0x64,
85    Utf8CharacterGestureEncoding = 0x65,
86    Utf16LittleEndianCharacterGestureEncoding = 0x66,
87    Utf16BigEndianCharacterGestureEncoding = 0x67,
88    Utf32LittleEndianCharacterGestureEncoding = 0x68,
89    Utf32BigEndianCharacterGestureEncoding = 0x69,
90    CapacitiveHeatMapProtocolVendorId = 0x6A,
91    CapacitiveHeatMapProtocolVersion = 0x6B,
92    CapacitiveHeatMapFrameData = 0x6C,
93    GestureCharacterEnable = 0x6D,
94    TransducerSerialNumberPart2 = 0x6E,
95    NoPreferredColor = 0x6F,
96    PreferredLineStyle = 0x70,
97    PreferredLineStyleIsLocked = 0x71,
98    Ink = 0x72,
99    Pencil = 0x73,
100    Highlighter = 0x74,
101    ChiselMarker = 0x75,
102    Brush = 0x76,
103    NoPreference = 0x77,
104    // 0x78-0x7F reserved
105    DigitizerDiagnostic = 0x80,
106    DigitizerError = 0x81,
107    ErrNormalStatus = 0x82,
108    ErrTransducersExceeded = 0x83,
109    ErrFullTransFeaturesUnavailable = 0x84,
110    ErrChargeLow = 0x85,
111    // 0x86-0x8F reserved
112    TransducerSoftwareInfo = 0x90,
113    TransducerVendorId = 0x91,
114    TransducerProductId = 0x92,
115    DeviceSupportedProtocols = 0x93,
116    TransducerSupportedProtocols = 0x94,
117    NoProtocol = 0x95,
118    WacomAesProtocol = 0x96,
119    UsiProtocol = 0x97,
120    MicrosoftPenProtocol = 0x98,
121    // 0x99-0x9F reserved
122    SupportedReportRates = 0xA0,
123    ReportRate = 0xA1,
124    TransducerConnected = 0xA2,
125    SwitchDisabled = 0xA3,
126    SwitchUnimplemented = 0xA4,
127    TransducerSwitches = 0xA5,
128    TransducerIndexSelector = 0xA6,
129    // 0xA7-0xAF reserved
130    ButtonPressThreshold = 0xB0,
131    // 0xB1-0xFFFF reserved
132}
133
134/// A __Usage ID__ value.
135pub type Usage = Ident<KnownUsage, u16>;