2001-10-23 03:51:12 +04:00
|
|
|
.\" $NetBSD: usbhidctl.1,v 1.12 2001/10/22 23:51:12 wiz Exp $
|
1999-04-14 00:50:48 +04:00
|
|
|
.\"
|
2001-10-23 02:03:49 +04:00
|
|
|
.\" Copyright (c) 2001 The NetBSD Foundation, Inc.
|
1998-07-13 15:14:03 +04:00
|
|
|
.\" All rights reserved.
|
|
|
|
.\"
|
1999-04-14 00:50:48 +04:00
|
|
|
.\" This code is derived from software contributed to The NetBSD Foundation
|
2000-09-24 06:27:12 +04:00
|
|
|
.\" by David Sainty <David.Sainty@dtsp.co.nz>
|
1998-07-13 15:14:03 +04:00
|
|
|
.\"
|
|
|
|
.\" Redistribution and use in source and binary forms, with or without
|
|
|
|
.\" modification, are permitted provided that the following conditions
|
|
|
|
.\" are met:
|
|
|
|
.\" 1. Redistributions of source code must retain the above copyright
|
|
|
|
.\" notice, this list of conditions and the following disclaimer.
|
|
|
|
.\" 2. Redistributions in binary form must reproduce the above copyright
|
|
|
|
.\" notice, this list of conditions and the following disclaimer in the
|
|
|
|
.\" documentation and/or other materials provided with the distribution.
|
|
|
|
.\" 3. All advertising materials mentioning features or use of this software
|
|
|
|
.\" must display the following acknowledgement:
|
|
|
|
.\" This product includes software developed by the NetBSD
|
|
|
|
.\" Foundation, Inc. and its contributors.
|
|
|
|
.\" 4. Neither the name of The NetBSD Foundation nor the names of its
|
|
|
|
.\" contributors may be used to endorse or promote products derived
|
|
|
|
.\" from this software without specific prior written permission.
|
|
|
|
.\"
|
|
|
|
.\" THIS SOFTWARE IS PROVIDED BY THE NETBSD FOUNDATION, INC. AND CONTRIBUTORS
|
|
|
|
.\" ``AS IS'' AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED
|
|
|
|
.\" TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
|
1999-04-14 00:50:48 +04:00
|
|
|
.\" PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE FOUNDATION OR CONTRIBUTORS
|
1998-07-13 15:14:03 +04:00
|
|
|
.\" BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
|
|
|
|
.\" CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
|
|
|
|
.\" SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
|
|
|
|
.\" INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
|
|
|
|
.\" CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
|
|
|
|
.\" ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
|
|
|
|
.\" POSSIBILITY OF SUCH DAMAGE.
|
|
|
|
.\"
|
2000-09-24 06:27:12 +04:00
|
|
|
.Dd August 27, 2000
|
1998-07-13 15:14:03 +04:00
|
|
|
.Dt USBHIDCTL 1
|
|
|
|
.Os
|
|
|
|
.Sh NAME
|
|
|
|
.Nm usbhidctl
|
|
|
|
.Nd manipulate USB HID devices
|
|
|
|
.Sh SYNOPSIS
|
2000-09-24 06:27:12 +04:00
|
|
|
.Nm ""
|
1998-12-03 23:46:10 +03:00
|
|
|
.Fl f Ar device
|
2000-09-24 06:27:12 +04:00
|
|
|
.Op Fl t Ar table
|
1998-07-13 15:14:03 +04:00
|
|
|
.Op Fl l
|
2000-09-24 06:27:12 +04:00
|
|
|
.Op Fl v
|
|
|
|
.Fl a
|
|
|
|
.Nm ""
|
|
|
|
.Fl f Ar device
|
1998-07-13 15:14:03 +04:00
|
|
|
.Op Fl t Ar table
|
|
|
|
.Op Fl v
|
2000-09-24 06:27:12 +04:00
|
|
|
.Fl r
|
|
|
|
.Nm ""
|
|
|
|
.Fl f Ar device
|
|
|
|
.Op Fl t Ar table
|
|
|
|
.Op Fl l
|
|
|
|
.Op Fl n
|
|
|
|
.Op Fl v
|
2000-07-06 11:26:48 +04:00
|
|
|
.Op Ar item ...
|
2000-09-24 06:27:12 +04:00
|
|
|
.Nm ""
|
|
|
|
.Fl f Ar device
|
|
|
|
.Op Fl t Ar table
|
|
|
|
.Fl w
|
|
|
|
.Op Ar item=value ...
|
1998-07-13 15:14:03 +04:00
|
|
|
.Sh DESCRIPTION
|
|
|
|
.Nm
|
2001-10-23 02:03:49 +04:00
|
|
|
can be used to output or modify the state of a USB HID (Human Interface
|
|
|
|
Device). If a list of items is present on the command line, then
|
2000-09-24 06:27:12 +04:00
|
|
|
.Nm
|
|
|
|
prints the current value of those items for the specified device. If the
|
|
|
|
.Fl w
|
|
|
|
flag is specified
|
|
|
|
.Nm
|
|
|
|
attempts to set the specified items to the given values.
|
1998-07-13 15:14:03 +04:00
|
|
|
.Pp
|
|
|
|
The options are as follows:
|
|
|
|
.Bl -tag -width Ds
|
1998-07-14 00:56:28 +04:00
|
|
|
.It Fl a
|
2000-09-24 06:27:12 +04:00
|
|
|
Show all items and their current values.
|
1998-07-13 15:14:03 +04:00
|
|
|
.It Fl f Ar device
|
2000-09-24 06:27:12 +04:00
|
|
|
Specify a path name for the device to operate on. If
|
|
|
|
.Ar device
|
|
|
|
is numeric, it is taken to be the USB HID device number. If it is a relative
|
|
|
|
path, it is taken to be the name of the device under
|
|
|
|
.Pa /dev .
|
|
|
|
An absolute path is taken to be the literal device pathname.
|
1998-07-13 15:14:03 +04:00
|
|
|
.It Fl l
|
2000-09-24 06:27:12 +04:00
|
|
|
Loop and dump the device data every time it changes. Only 'input' items are
|
|
|
|
displayed in this mode.
|
1998-07-13 15:14:03 +04:00
|
|
|
.It Fl n
|
2001-10-23 02:03:49 +04:00
|
|
|
Suppress printing of the item name when querying specific items. Only output
|
|
|
|
the current value.
|
1998-07-13 15:14:03 +04:00
|
|
|
.It Fl r
|
2001-10-23 02:03:49 +04:00
|
|
|
Dump the USB HID report descriptor.
|
1998-07-13 15:14:03 +04:00
|
|
|
.It Fl t Ar table
|
|
|
|
Specify a path name for the HID usage table file.
|
|
|
|
.It Fl v
|
2000-09-24 06:27:12 +04:00
|
|
|
Be verbose. Repeating this option increases verbosity.
|
|
|
|
.It Fl w
|
|
|
|
Change item values. Only 'output' and 'feature' kinds can be set with this
|
|
|
|
option.
|
1998-07-13 15:14:03 +04:00
|
|
|
.El
|
|
|
|
.Sh FILES
|
|
|
|
.Pa /usr/share/misc/usb_hid_usages
|
|
|
|
The default HID usage table.
|
2001-10-23 02:03:49 +04:00
|
|
|
.Sh SYNTAX
|
|
|
|
.Nm
|
|
|
|
parses the names of items specified on the command line against the human
|
|
|
|
interface items reported by the USB device. Each human interface item is
|
|
|
|
mapped from its native form to a human readable name, using the HID usage
|
|
|
|
table file. Command line items are compared with the generated item names,
|
|
|
|
and the USB HID device is operated on when a match is found.
|
|
|
|
.Pp
|
|
|
|
Each human interface item is named by the
|
|
|
|
.Qq page
|
|
|
|
it appears in, the
|
|
|
|
.Qq usage
|
|
|
|
within that page, and the list of
|
|
|
|
.Qq collections
|
|
|
|
containing the item. Each collection in turn is also identified by page, and
|
|
|
|
the usage within that page.
|
|
|
|
.Pp
|
|
|
|
On the
|
|
|
|
.Nm
|
|
|
|
command line the page name is separated from the usage name with the character
|
|
|
|
.Cm So : Sc .
|
|
|
|
The collections are separated by the character
|
|
|
|
.Cm So . Sc .
|
|
|
|
.Pp
|
|
|
|
As an alternative notation in items on the command line, the native numeric
|
|
|
|
value for the page name or usage can be used instead of the full human
|
|
|
|
readable page name or usage name. Numeric values can be specified in decimal,
|
|
|
|
octal or hexadecimal.
|
|
|
|
.Sh EXAMPLES
|
|
|
|
On a standard USB mouse the item
|
|
|
|
.Dl Generic_Desktop:Mouse.Generic_Desktop:Pointer.Button:Button_2
|
|
|
|
reflects the current status of button 2. The
|
|
|
|
.Qq button 2
|
|
|
|
item is encapsulated within two collections, the
|
|
|
|
.Qq Mouse
|
|
|
|
collection in the
|
|
|
|
.Qq Generic Desktop
|
|
|
|
page, and the
|
|
|
|
.Qq Pointer
|
|
|
|
collection in the
|
|
|
|
.Qq Generic Desktop
|
|
|
|
page. The item itself is the usage
|
|
|
|
.Qq Button_2
|
|
|
|
in the
|
|
|
|
.Qq Button
|
|
|
|
page.
|
|
|
|
.Pp
|
|
|
|
An item can generally be named by omitting one or more of the page names. For
|
|
|
|
example the
|
|
|
|
.Qq button 2
|
|
|
|
item would usually just be referred to on the command line as:
|
|
|
|
.Dl usbhidctl -f /dev/mouse Mouse.Pointer.Button_2
|
|
|
|
.Pp
|
|
|
|
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
|
|
|
|
.Qq Generic Desktop
|
|
|
|
page is 1, and the usage identifier for the usage
|
|
|
|
.Qq Button_2
|
|
|
|
is 2, so the following can be used to refer to the
|
|
|
|
.Qq button 2
|
|
|
|
item:
|
|
|
|
.Dl usbhidctl -f /dev/mouse 1:Mouse.1:Pointer.Button:2
|
|
|
|
.Pp
|
|
|
|
Devices with human interface outputs can be manipulated with the
|
|
|
|
.Fl w
|
|
|
|
option. For example, some USB mice have a Light Emitting Diode under software
|
|
|
|
control as usage 2 under page 0xffff, in the
|
|
|
|
.Qq Mouse
|
|
|
|
collection. The following can be used to switch this LED off:
|
|
|
|
.Dl usbhidctl -f /dev/mouse -w Mouse.0xffff:2=0
|
1998-07-13 15:14:03 +04:00
|
|
|
.Sh SEE ALSO
|
2001-10-23 03:51:12 +04:00
|
|
|
.Xr usbhidaction 1 ,
|
1999-05-12 01:03:58 +04:00
|
|
|
.Xr usb 3 ,
|
2000-07-06 11:26:48 +04:00
|
|
|
.Xr uhid 4 ,
|
2001-10-23 03:51:12 +04:00
|
|
|
.Xr usb 4
|
1998-07-13 15:14:03 +04:00
|
|
|
.Sh HISTORY
|
|
|
|
The
|
|
|
|
.Nm
|
2000-09-24 06:27:12 +04:00
|
|
|
command first appeared in
|
1998-07-13 15:14:03 +04:00
|
|
|
.Nx 1.4 .
|
2001-10-23 03:51:12 +04:00
|
|
|
.Sh AUTHORS
|
|
|
|
.An David Sainty Aq David.Sainty@dtsp.co.nz
|
2000-09-24 06:27:12 +04:00
|
|
|
.Sh BUGS
|
2001-10-23 02:03:49 +04:00
|
|
|
Some USB HID devices report multiple items with exactly the same usage
|
|
|
|
identifiers. The current naming scheme does not provide the means to specify
|
|
|
|
which of a set of identically named items you are referring to.
|