[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.7

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