On a standard USB mouse the item
Generic_Desktop:Mouse.Generic_Desktop:Pointer.Button:Button_2
reflects the current status of button 2. The “button 2” item is encapsulated within two collections, the “Mouse” collection in the “Generic Desktop” page, and the “Pointer” collection in the “Generic Desktop” page. The item itself is the usage “Button_2” in the “Button” page.
An item can generally be named by omitting one or more of the page names. For example the “button 2” item would usually just be referred to on the command line as:
usbhidctl -f /dev/mouse Mouse.Pointer.Button_2
Items can also be named by referring to parts of the item name with the numeric representation of the native HID usage identifiers. This is most useful when items are missing from the HID usage table. The page identifier for the “Generic Desktop” page is 1, and the usage identifier for the usage “Button_2” is 2, so the following can be used to refer to the “button 2” item:
usbhidctl -f /dev/mouse 1:Mouse.1:Pointer.Button:2
Devices with human interface outputs can be manipulated with the
-w option. For example, some USB mice have a Light Emitting Diode under software control as usage 2 under page 0xffff, in the “Mouse” collection. The following can be used to switch this LED off:
usbhidctl -f /dev/mouse -w Mouse.0xffff:2=0
The output below is from a device that uses the same name repeatedly.
% usbhidctl -f /dev/uhid0 -a
Consumer_Control.Volume_Up=0
Consumer_Control.Volume_Down=0
Consumer_Control.Mute=0
Consumer_Control.Unassigned=0
Consumer_Control.Unassigned=0
The “Consumer_Control.Unassigned” name is used twice. Each can be individually accessed by providing an instance number. For example, to set the value for the first item:
usbhidctl -f /dev/uhid0 -w 'Consumer_Control.Unassigned#0=1'