xref: /freebsd/usr.bin/usbhidctl/usbhidctl.1 (revision aa1a8ff2d6dbc51ef058f46f3db5a8bb77967145)
1.\" $NetBSD: usbhidctl.1,v 1.8 1999/05/11 21:03:58 augustss Exp $
2.\"
3.\" Copyright (c) 1998 The NetBSD Foundation, Inc.
4.\" All rights reserved.
5.\"
6.\" This code is derived from software contributed to The NetBSD Foundation
7.\" by Lennart Augustsson.
8.\"
9.\" Redistribution and use in source and binary forms, with or without
10.\" modification, are permitted provided that the following conditions
11.\" are met:
12.\" 1. Redistributions of source code must retain the above copyright
13.\"    notice, this list of conditions and the following disclaimer.
14.\" 2. Redistributions in binary form must reproduce the above copyright
15.\"    notice, this list of conditions and the following disclaimer in the
16.\"    documentation and/or other materials provided with the distribution.
17.\"
18.\" THIS SOFTWARE IS PROVIDED BY THE NETBSD FOUNDATION, INC. AND CONTRIBUTORS
19.\" ``AS IS'' AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED
20.\" TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
21.\" PURPOSE ARE DISCLAIMED.  IN NO EVENT SHALL THE FOUNDATION OR CONTRIBUTORS
22.\" BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
23.\" CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
24.\" SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
25.\" INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
26.\" CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
27.\" ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
28.\" POSSIBILITY OF SUCH DAMAGE.
29.\"
30.Dd August 1, 2011
31.Dt USBHIDCTL 1
32.Os
33.Sh NAME
34.Nm usbhidctl
35.Nd manipulate USB HID devices
36.Sh SYNOPSIS
37.Nm
38.Fl f Ar device
39.Op Fl t Ar table
40.Op Fl v
41.Op Fl x
42.Fl r
43.Nm
44.Fl f Ar device
45.Op Fl t Ar table
46.Op Fl l
47.Op Fl v
48.Op Fl x
49.Op Fl z
50.Fl a
51.Nm
52.Fl f Ar device
53.Op Fl t Ar table
54.Op Fl l
55.Op Fl n
56.Op Fl v
57.Op Fl x
58.Op Fl z
59.Ar item ...
60.Nm
61.Fl f Ar device
62.Op Fl t Ar table
63.Op Fl v
64.Op Fl z
65.Fl w
66.Ar item=value ...
67.Sh DESCRIPTION
68The
69.Nm
70utility can be used to dump and modify the state of a USB HID (Human
71Interface Device).
72Each named
73.Ar item
74is printed.
75If the
76.Fl w
77flag is specified
78.Nm
79attempts to set the specified items to the given values.
80.Pp
81The options are as follows:
82.Bl -tag -width Ds
83.It Fl a
84Show all items and their current values if device returns.
85.It Fl f Ar device
86Specify a path name for the device to operate on.
87.It Fl l
88Loop and dump the device data every time it changes.
89.It Fl n
90Suppress printing of the item name.
91.It Fl r
92Dump the report descriptor.
93.It Fl t Ar table
94Specify a path name for the HID usage table file.
95.It Fl v
96Be verbose.
97.It Fl w
98Change item values.
99Only 'output' and 'feature' kinds can be set with this option.
100.It Fl x
101Dump data in hexadecimal as well as decimal.
102.It Fl z
103Reset reports to zero before processing other arguments.
104If not specified, current values will be requested from device.
105.El
106.Sh SYNTAX
107.Nm
108compares the names of items specified on the command line against the human
109interface items reported by the USB device.
110Each human interface item is mapped from its native form to a human readable
111name, using the HID usage table file.
112Command line items are compared with the generated item names,
113and the USB HID device is operated on when a match is found.
114.Pp
115Each human interface item is named by the
116.Qq page
117it appears in, the
118.Qq usage
119within that page, and the list of
120.Qq collections
121containing the item.
122Each collection in turn is also identified by page, and
123the usage within that page.
124.Pp
125On the
126.Nm
127command line the page name is separated from the usage name with the character
128.Sq Cm \&: .
129The collections are separated by the character
130.Sq Cm \&. .
131.Pp
132Some devices give the same name to more than one item.
133.Nm
134supports isolating each item by appending a
135.Sq Cm \&# .
136character and a decimal item instance number, starting at zero.
137.Sh FILES
138.Bl -tag -width 30n
139.It Pa /usr/share/misc/usb_hid_usages
140The default HID usage table.
141.El
142.Sh SEE ALSO
143.Xr usbhid 3 ,
144.Xr uhid 4 ,
145.Xr usb 4
146.Sh HISTORY
147The
148.Nm
149command appeared in
150.Nx 1.4 .
151