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