1.\" Copyright (c) 1997, 1998 2.\" Nick Hibma <n_hibma@FreeBSD.org>. All rights reserved. 3.\" 4.\" Redistribution and use in source and binary forms, with or without 5.\" modification, are permitted provided that the following conditions 6.\" are met: 7.\" 1. Redistributions of source code must retain the above copyright 8.\" notice, this list of conditions and the following disclaimer. 9.\" 2. Redistributions in binary form must reproduce the above copyright 10.\" notice, this list of conditions and the following disclaimer in the 11.\" documentation and/or other materials provided with the distribution. 12.\" 13.\" THIS SOFTWARE IS PROVIDED BY THE AUTHOR AND CONTRIBUTORS ``AS IS'' AND 14.\" ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE 15.\" IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE 16.\" ARE DISCLAIMED. IN NO EVENT SHALL THE AUTHOR OR CONTRIBUTORS BE LIABLE 17.\" FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL 18.\" DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS 19.\" OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) 20.\" HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT 21.\" LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY 22.\" OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF 23.\" SUCH DAMAGE. 24.\" 25.\" $FreeBSD$ 26.\" 27.Dd April 24, 2018 28.Dt UKBD 4 29.Os 30.Sh NAME 31.Nm ukbd 32.Nd USB keyboard driver 33.Sh SYNOPSIS 34To compile this driver into the kernel, 35place the following line in your 36kernel configuration file: 37.Bd -ragged -offset indent 38.Cd "device ukbd" 39.Cd "device hid" 40.Cd "device usb" 41.Ed 42.Pp 43Alternatively, to load the driver as a 44module at boot time, place the following line in 45.Xr loader.conf 5 : 46.Bd -literal -offset indent 47ukbd_load="YES" 48.Ed 49.Sh DESCRIPTION 50The 51.Nm 52driver provides support for keyboards that attach to the USB port. 53.Xr usb 4 54and one of 55.Xr uhci 4 56or 57.Xr ohci 4 58must be configured in the kernel as well. 59.Sh CONFIGURATION 60By default, the keyboard subsystem does not create the appropriate devices yet. 61Make sure you reconfigure your kernel with the following option in the kernel 62config file: 63.Pp 64.Dl "options KBD_INSTALL_CDEV" 65.Pp 66If both an AT keyboard USB keyboards are used at the same time, the 67AT keyboard will appear as 68.Pa kbd0 69in 70.Pa /dev . 71The USB keyboards will be 72.Pa kbd1 , kbd2 , 73etc. 74You can see some information about the keyboard with the following command: 75.Pp 76.Dl "kbdcontrol -i < /dev/kbd1" 77.Pp 78or load a keymap with 79.Pp 80.Dl "kbdcontrol -l keymaps/pt.iso < /dev/kbd1" 81.Pp 82See 83.Xr kbdcontrol 1 84for more possible options. 85.Pp 86You can swap console keyboards by using the command 87.Pp 88.Dl "kbdcontrol -k /dev/kbd1" 89.Pp 90From this point on, the first USB keyboard will be the keyboard 91to be used by the console. 92.Pp 93If you want to use a USB keyboard as your default and not use an AT keyboard at 94all, you will have to remove the 95.Cd "device atkbd" 96line from the kernel configuration file. 97Because of the device initialization order, 98the USB keyboard will be detected 99.Em after 100the console driver 101initializes itself and you have to explicitly tell the console 102driver to use the existence of the USB keyboard. 103This can be done in 104one of the following two ways. 105.Pp 106Run the following command as a part of system initialization: 107.Pp 108.Dl "kbdcontrol -k /dev/kbd0 < /dev/ttyv0 > /dev/null" 109.Pp 110(Note that as the USB keyboard is the only keyboard, it is accessed as 111.Pa /dev/kbd0 ) 112or otherwise tell the console driver to periodically look for a 113keyboard by setting a flag in the kernel configuration file: 114.Pp 115.Dl "device sc0 at isa? flags 0x100" 116.Pp 117With the above flag, the console driver will try to detect any 118keyboard in the system if it did not detect one while it was 119initialized at boot time. 120.Sh DRIVER CONFIGURATION 121.D1 Cd "options KBD_INSTALL_CDEV" 122.Pp 123Make the keyboards available through a character device in 124.Pa /dev . 125.Pp 126.D1 Cd options UKBD_DFLT_KEYMAP 127.D1 Cd makeoptions UKBD_DFLT_KEYMAP=fr.iso 128.Pp 129The above lines will put the French ISO keymap in the ukbd driver. 130You can specify any keymap in 131.Pa /usr/share/syscons/keymaps 132or 133.Pa /usr/share/vt/keymaps 134(depending on the console driver being used) with this option. 135.Pp 136.D1 Cd "options KBD_DISABLE_KEYMAP_LOADING" 137.Pp 138Do not allow the user to change the keymap. 139.Pp 140.D1 Cd "options KBD_DELAY1=200" 141.Pp 142Set the keyboard initial key repeat delay. 143.Pp 144.D1 Cd "options KBD_DELAY2=15" 145.Pp 146Set the keyboard key repeat delay. 147.Pp 148Note that these options also affect the AT keyboard driver, 149.Xr atkbd 4 . 150.Sh SYSCTL VARIABLES 151The following variables are available as both 152.Xr sysctl 8 153variables and 154.Xr loader 8 155tunables: 156.Bl -tag -width indent 157.It Va hw.usb.ukbd.debug 158Debug output level, where 0 is debugging disabled and larger values increase 159debug message verbosity. 160Default is 0. 161.El 162.Sh FILES 163.Bl -tag -width ".Pa /dev/kbd*" -compact 164.It Pa /dev/kbd* 165blocking device nodes 166.El 167.Sh EXAMPLES 168.D1 Cd "device ukbd" 169.Pp 170Add the 171.Nm 172driver to the kernel. 173.Sh SEE ALSO 174.Xr kbdcontrol 1 , 175.Xr ohci 4 , 176.Xr syscons 4 , 177.Xr uhci 4 , 178.Xr usb 4 , 179.Xr vt 4 , 180.Xr config 8 181.Sh AUTHORS 182.An -nosplit 183The 184.Nm 185driver was written by 186.An Lennart Augustsson Aq Mt augustss@cs.chalmers.se 187for 188.Nx 189and was substantially rewritten for 190.Fx 191by 192.An Kazutaka YOKOTA Aq Mt yokota@zodiac.mech.utsunomiya-u.ac.jp . 193.Pp 194This manual page was written by 195.An Nick Hibma Aq Mt n_hibma@FreeBSD.org 196with a large amount of input from 197.An Kazutaka YOKOTA Aq Mt yokota@zodiac.mech.utsunomiya-u.ac.jp . 198