Annotation of src/usr.bin/usbhidctl/usbhidctl.1, Revision 1.11
1.11 ! ray 1: .\" $OpenBSD: usbhidctl.1,v 1.10 2007/05/31 19:20:19 jmc Exp $
1.4 nate 2: .\" $NetBSD: usbhidctl.1,v 1.14 2001/12/28 17:49:32 augustss Exp $
1.1 pvalchev 3: .\"
1.4 nate 4: .\" Copyright (c) 2001 The NetBSD Foundation, Inc.
1.1 pvalchev 5: .\" All rights reserved.
6: .\"
7: .\" This code is derived from software contributed to The NetBSD Foundation
8: .\" by David Sainty <David.Sainty@dtsp.co.nz>
9: .\"
10: .\" Redistribution and use in source and binary forms, with or without
11: .\" modification, are permitted provided that the following conditions
12: .\" are met:
13: .\" 1. Redistributions of source code must retain the above copyright
14: .\" notice, this list of conditions and the following disclaimer.
15: .\" 2. Redistributions in binary form must reproduce the above copyright
16: .\" notice, this list of conditions and the following disclaimer in the
17: .\" documentation and/or other materials provided with the distribution.
18: .\"
19: .\" THIS SOFTWARE IS PROVIDED BY THE NETBSD FOUNDATION, INC. AND CONTRIBUTORS
20: .\" ``AS IS'' AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED
21: .\" TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
22: .\" PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE FOUNDATION OR CONTRIBUTORS
23: .\" BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
24: .\" CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
25: .\" SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
26: .\" INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
27: .\" CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
28: .\" ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
29: .\" POSSIBILITY OF SUCH DAMAGE.
30: .\"
1.11 ! ray 31: .Dd $Mdocdate: May 31 2007 $
1.1 pvalchev 32: .Dt USBHIDCTL 1
33: .Os
34: .Sh NAME
35: .Nm usbhidctl
36: .Nd manipulate USB HID devices
37: .Sh SYNOPSIS
1.2 jakob 38: .Nm
1.1 pvalchev 39: .Fl f Ar device
40: .Op Fl t Ar table
1.8 jmc 41: .Op Fl lv
1.1 pvalchev 42: .Fl a
1.2 jakob 43: .Nm
1.1 pvalchev 44: .Fl f Ar device
45: .Op Fl t Ar table
46: .Op Fl v
47: .Fl r
1.2 jakob 48: .Nm
1.1 pvalchev 49: .Fl f Ar device
50: .Op Fl t Ar table
1.8 jmc 51: .Op Fl lnv
1.9 jmc 52: .Ar name ...
1.2 jakob 53: .Nm
1.1 pvalchev 54: .Fl f Ar device
55: .Op Fl t Ar table
1.9 jmc 56: .Fl w Ar name Ns = Ns Ar value ...
1.1 pvalchev 57: .Sh DESCRIPTION
58: .Nm
1.6 jmc 59: can be used to output or modify the state of a USB HID (Human Interface Device).
60: If a list of items is present on the command line, then
1.1 pvalchev 61: .Nm
1.6 jmc 62: prints the current value of those items for the specified device.
63: If the
1.1 pvalchev 64: .Fl w
65: flag is specified
66: .Nm
67: attempts to set the specified items to the given values.
68: .Pp
69: The options are as follows:
70: .Bl -tag -width Ds
71: .It Fl a
72: Show all items and their current values.
1.4 nate 73: This option fails if the device does not support the GET_REPORT command.
1.1 pvalchev 74: .It Fl f Ar device
1.6 jmc 75: Specify a path name for the device to operate on.
76: If
1.1 pvalchev 77: .Ar device
1.6 jmc 78: is numeric, it is taken to be the USB HID device number.
79: If it is a relative path, it is taken to be the name of the device under
1.1 pvalchev 80: .Pa /dev .
81: An absolute path is taken to be the literal device pathname.
82: .It Fl l
1.6 jmc 83: Loop and dump the device data every time it changes.
84: Only 'input' items are displayed in this mode.
1.1 pvalchev 85: .It Fl n
1.6 jmc 86: Suppress printing of the item name when querying specific items.
87: Only output the current value.
1.1 pvalchev 88: .It Fl r
1.4 nate 89: Dump the USB HID report descriptor.
1.1 pvalchev 90: .It Fl t Ar table
91: Specify a path name for the HID usage table file.
92: .It Fl v
1.6 jmc 93: Be verbose.
94: Repeating this option increases verbosity.
1.1 pvalchev 95: .It Fl w
1.6 jmc 96: Change item values.
97: Only 'output' and 'feature' kinds can be set with this option.
1.1 pvalchev 98: .El
1.4 nate 99: .Sh SYNTAX
100: .Nm
101: parses the names of items specified on the command line against the human
1.6 jmc 102: interface items reported by the USB device.
103: Each human interface item is mapped from its native form to a human readable
104: name, using the HID usage table file.
105: Command line items are compared with the generated item names,
1.4 nate 106: and the USB HID device is operated on when a match is found.
107: .Pp
108: Each human interface item is named by the
109: .Qq page
110: it appears in, the
111: .Qq usage
112: within that page, and the list of
113: .Qq collections
1.6 jmc 114: containing the item.
115: Each collection in turn is also identified by page, and
1.4 nate 116: the usage within that page.
117: .Pp
118: On the
119: .Nm
120: command line the page name is separated from the usage name with the character
1.7 jmc 121: .Sq Cm \&: .
1.4 nate 122: The collections are separated by the character
1.7 jmc 123: .Sq Cm \&. .
1.4 nate 124: .Pp
125: As an alternative notation in items on the command line, the native numeric
126: value for the page name or usage can be used instead of the full human
1.6 jmc 127: readable page name or usage name.
128: Numeric values can be specified in decimal, octal or hexadecimal.
1.8 jmc 129: .Sh FILES
130: .Bl -tag -width "/usr/share/misc/usb_hid_usages"
131: .It Pa /usr/share/misc/usb_hid_usages
132: The default HID usage table.
133: .El
1.4 nate 134: .Sh EXAMPLES
135: On a standard USB mouse the item
1.8 jmc 136: .Pp
1.4 nate 137: .Dl Generic_Desktop:Mouse.Generic_Desktop:Pointer.Button:Button_2
1.8 jmc 138: .Pp
1.6 jmc 139: reflects the current status of button 2.
140: The
1.4 nate 141: .Qq button 2
142: item is encapsulated within two collections, the
143: .Qq Mouse
144: collection in the
145: .Qq Generic Desktop
146: page, and the
147: .Qq Pointer
148: collection in the
149: .Qq Generic Desktop
1.6 jmc 150: page.
151: The item itself is the usage
1.4 nate 152: .Qq Button_2
153: in the
154: .Qq Button
155: page.
156: .Pp
1.6 jmc 157: An item can generally be named by omitting one or more of the page names.
158: For example the
1.4 nate 159: .Qq button 2
160: item would usually just be referred to on the command line as:
1.8 jmc 161: .Pp
1.5 deraadt 162: .Dl $ usbhidctl -f /dev/mouse Mouse.Pointer.Button_2
1.4 nate 163: .Pp
164: Items can also be named by referring to parts of the item name with the
1.6 jmc 165: numeric representation of the native HID usage identifiers.
166: This is most useful when items are missing from the HID usage table.
167: The page identifier for the
1.4 nate 168: .Qq Generic Desktop
169: page is 1, and the usage identifier for the usage
170: .Qq Button_2
171: is 2, so the following can be used to refer to the
172: .Qq button 2
173: item:
1.8 jmc 174: .Pp
1.5 deraadt 175: .Dl $ usbhidctl -f /dev/mouse 1:Mouse.1:Pointer.Button:2
1.4 nate 176: .Pp
177: Devices with human interface outputs can be manipulated with the
178: .Fl w
1.6 jmc 179: option.
180: For example, some USB mice have a Light Emitting Diode under software
1.4 nate 181: control as usage 2 under page 0xffff, in the
182: .Qq Mouse
1.6 jmc 183: collection.
184: The following can be used to switch this LED off:
1.8 jmc 185: .Pp
1.5 deraadt 186: .Dl $ usbhidctl -f /dev/mouse -w Mouse.0xffff:2=0
1.1 pvalchev 187: .Sh SEE ALSO
1.4 nate 188: .Xr usbhidaction 1 ,
1.3 pvalchev 189: .Xr usbhid 3 ,
1.1 pvalchev 190: .Xr uhid 4 ,
191: .Xr usb 4
192: .Sh HISTORY
193: The
194: .Nm
195: command first appeared in
196: .Ox 3.0 .
1.4 nate 197: .Sh AUTHORS
198: .An David Sainty Aq David.Sainty@dtsp.co.nz
1.1 pvalchev 199: .Sh BUGS
1.4 nate 200: Some USB HID devices report multiple items with exactly the same usage
1.6 jmc 201: identifiers.
202: The current naming scheme does not provide the means to specify
1.4 nate 203: which of a set of identically named items you are referring to.