[BACK]Return to usbhidctl.1 CVS log [TXT][DIR] Up to [local] / src / usr.bin / usbhidctl

Annotation of src/usr.bin/usbhidctl/usbhidctl.1, Revision 1.5

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