Annotation of src/usr.bin/usbhidctl/usbhidctl.1, Revision 1.14
1.14 ! schwarze 1: .\" $OpenBSD: usbhidctl.1,v 1.13 2010/08/02 23:17:36 miod 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.14 ! schwarze 31: .Dd $Mdocdate: August 2 2010 $
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.12 jakemsr 41: .Op Fl alv
1.2 jakob 42: .Nm
1.1 pvalchev 43: .Fl f Ar device
44: .Op Fl t Ar table
45: .Op Fl v
46: .Fl r
1.2 jakob 47: .Nm
1.1 pvalchev 48: .Fl f Ar device
49: .Op Fl t Ar table
1.8 jmc 50: .Op Fl lnv
1.9 jmc 51: .Ar name ...
1.2 jakob 52: .Nm
1.1 pvalchev 53: .Fl f Ar device
54: .Op Fl t Ar table
1.9 jmc 55: .Fl w Ar name Ns = Ns Ar value ...
1.1 pvalchev 56: .Sh DESCRIPTION
57: .Nm
1.6 jmc 58: can be used to output or modify the state of a USB HID (Human Interface Device).
59: If a list of items is present on the command line, then
1.1 pvalchev 60: .Nm
1.6 jmc 61: prints the current value of those items for the specified device.
62: If the
1.1 pvalchev 63: .Fl w
64: flag is specified
65: .Nm
66: attempts to set the specified items to the given values.
67: .Pp
68: The options are as follows:
69: .Bl -tag -width Ds
70: .It Fl a
71: Show all items and their current values.
1.4 nate 72: This option fails if the device does not support the GET_REPORT command.
1.12 jakemsr 73: This is the default, if no parameters other than
74: .Fl f
75: are given to
76: .Nm .
1.1 pvalchev 77: .It Fl f Ar device
1.6 jmc 78: Specify a path name for the device to operate on.
79: If
1.1 pvalchev 80: .Ar device
1.6 jmc 81: is numeric, it is taken to be the USB HID device number.
82: If it is a relative path, it is taken to be the name of the device under
1.1 pvalchev 83: .Pa /dev .
84: An absolute path is taken to be the literal device pathname.
85: .It Fl l
1.6 jmc 86: Loop and dump the device data every time it changes.
87: Only 'input' items are displayed in this mode.
1.1 pvalchev 88: .It Fl n
1.6 jmc 89: Suppress printing of the item name when querying specific items.
90: Only output the current value.
1.1 pvalchev 91: .It Fl r
1.4 nate 92: Dump the USB HID report descriptor.
1.1 pvalchev 93: .It Fl t Ar table
94: Specify a path name for the HID usage table file.
95: .It Fl v
1.6 jmc 96: Be verbose.
97: Repeating this option increases verbosity.
1.1 pvalchev 98: .It Fl w
1.6 jmc 99: Change item values.
100: Only 'output' and 'feature' kinds can be set with this option.
1.1 pvalchev 101: .El
1.4 nate 102: .Sh SYNTAX
103: .Nm
104: parses the names of items specified on the command line against the human
1.6 jmc 105: interface items reported by the USB device.
106: Each human interface item is mapped from its native form to a human readable
107: name, using the HID usage table file.
108: Command line items are compared with the generated item names,
1.4 nate 109: and the USB HID device is operated on when a match is found.
110: .Pp
111: Each human interface item is named by the
112: .Qq page
113: it appears in, the
114: .Qq usage
115: within that page, and the list of
116: .Qq collections
1.6 jmc 117: containing the item.
118: Each collection in turn is also identified by page, and
1.4 nate 119: the usage within that page.
120: .Pp
121: On the
122: .Nm
123: command line the page name is separated from the usage name with the character
1.7 jmc 124: .Sq Cm \&: .
1.4 nate 125: The collections are separated by the character
1.7 jmc 126: .Sq Cm \&. .
1.4 nate 127: .Pp
128: As an alternative notation in items on the command line, the native numeric
129: value for the page name or usage can be used instead of the full human
1.6 jmc 130: readable page name or usage name.
131: Numeric values can be specified in decimal, octal or hexadecimal.
1.8 jmc 132: .Sh FILES
133: .Bl -tag -width "/usr/share/misc/usb_hid_usages"
134: .It Pa /usr/share/misc/usb_hid_usages
135: The default HID usage table.
136: .El
1.4 nate 137: .Sh EXAMPLES
138: On a standard USB mouse the item
1.8 jmc 139: .Pp
1.4 nate 140: .Dl Generic_Desktop:Mouse.Generic_Desktop:Pointer.Button:Button_2
1.8 jmc 141: .Pp
1.6 jmc 142: reflects the current status of button 2.
143: The
1.4 nate 144: .Qq button 2
145: item is encapsulated within two collections, the
146: .Qq Mouse
147: collection in the
148: .Qq Generic Desktop
149: page, and the
150: .Qq Pointer
151: collection in the
152: .Qq Generic Desktop
1.6 jmc 153: page.
154: The item itself is the usage
1.4 nate 155: .Qq Button_2
156: in the
157: .Qq Button
158: page.
159: .Pp
1.6 jmc 160: An item can generally be named by omitting one or more of the page names.
161: For example the
1.4 nate 162: .Qq button 2
163: item would usually just be referred to on the command line as:
1.8 jmc 164: .Pp
1.13 miod 165: .Dl $ usbhidctl -f /dev/wsmouse0 Mouse.Pointer.Button_2
1.4 nate 166: .Pp
167: Items can also be named by referring to parts of the item name with the
1.6 jmc 168: numeric representation of the native HID usage identifiers.
169: This is most useful when items are missing from the HID usage table.
170: The page identifier for the
1.4 nate 171: .Qq Generic Desktop
172: page is 1, and the usage identifier for the usage
173: .Qq Button_2
174: is 2, so the following can be used to refer to the
175: .Qq button 2
176: item:
1.8 jmc 177: .Pp
1.13 miod 178: .Dl $ usbhidctl -f /dev/wsmouse0 1:Mouse.1:Pointer.Button:2
1.4 nate 179: .Pp
180: Devices with human interface outputs can be manipulated with the
181: .Fl w
1.6 jmc 182: option.
183: For example, some USB mice have a Light Emitting Diode under software
1.4 nate 184: control as usage 2 under page 0xffff, in the
185: .Qq Mouse
1.6 jmc 186: collection.
187: The following can be used to switch this LED off:
1.8 jmc 188: .Pp
1.13 miod 189: .Dl $ usbhidctl -f /dev/wsmouse0 -w Mouse.0xffff:2=0
1.1 pvalchev 190: .Sh SEE ALSO
1.4 nate 191: .Xr usbhidaction 1 ,
1.3 pvalchev 192: .Xr usbhid 3 ,
1.1 pvalchev 193: .Xr uhid 4 ,
194: .Xr usb 4
195: .Sh HISTORY
196: The
197: .Nm
198: command first appeared in
199: .Ox 3.0 .
1.4 nate 200: .Sh AUTHORS
1.14 ! schwarze 201: .An David Sainty Aq Mt David.Sainty@dtsp.co.nz
1.1 pvalchev 202: .Sh BUGS
1.4 nate 203: Some USB HID devices report multiple items with exactly the same usage
1.6 jmc 204: identifiers.
205: The current naming scheme does not provide the means to specify
1.4 nate 206: which of a set of identically named items you are referring to.