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 September 12, 2020 28.Dt HKBD 4 29.Os 30.Sh NAME 31.Nm hkbd 32.Nd HID 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 hkbd" 39.Cd "device hid" 40.Cd "device hidbus" 41.Cd "device evdev" 42.Cd "options EVDEV_SUPPORT" 43.Ed 44.Pp 45Alternatively, to load the driver as a 46module at boot time, place the following line in 47.Xr loader.conf 5 : 48.Bd -literal -offset indent 49hkbd_load="YES" 50.Ed 51.Sh DESCRIPTION 52The 53.Nm 54driver provides support for keyboards that attach to the HID transport 55backend. 56.Xr hid 4 , 57.Xr hidbus 4 , 58and one of 59.Xr iichid 4 60or 61.Xr usbhid 4 62must be configured in the kernel as well. 63.Sh CONFIGURATION 64By default, the keyboard subsystem does not create the appropriate devices yet. 65Make sure you reconfigure your kernel with the following option in the kernel 66config file: 67.Pp 68.Dl "options KBD_INSTALL_CDEV" 69.Pp 70If both an AT keyboard HID keyboards are used at the same time, the 71AT keyboard will appear as 72.Pa kbd0 73in 74.Pa /dev . 75The HID keyboards will be 76.Pa kbd1 , kbd2 , 77etc. 78You can see some information about the keyboard with the following command: 79.Pp 80.Dl "kbdcontrol -i < /dev/kbd1" 81.Pp 82or load a keymap with 83.Pp 84.Dl "kbdcontrol -l keymaps/pt.iso < /dev/kbd1" 85.Pp 86See 87.Xr kbdcontrol 1 88for more possible options. 89.Pp 90You can swap console keyboards by using the command 91.Pp 92.Dl "kbdcontrol -k /dev/kbd1" 93.Pp 94From this point on, the first HID keyboard will be the keyboard 95to be used by the console. 96.Pp 97If you want to use a HID keyboard as your default and not use an AT keyboard at 98all, you will have to remove the 99.Cd "device atkbd" 100line from the kernel configuration file. 101Because of the device initialization order, 102the HID keyboard will be detected 103.Em after 104the console driver 105initializes itself and you have to explicitly tell the console 106driver to use the existence of the HID keyboard. 107This can be done in 108one of the following two ways. 109.Pp 110Run the following command as a part of system initialization: 111.Pp 112.Dl "kbdcontrol -k /dev/kbd0 < /dev/ttyv0 > /dev/null" 113.Pp 114(Note that as the HID keyboard is the only keyboard, it is accessed as 115.Pa /dev/kbd0 ) 116or otherwise tell the console driver to periodically look for a 117keyboard by setting a flag in the kernel configuration file: 118.Pp 119.Dl "device sc0 at isa? flags 0x100" 120.Pp 121With the above flag, the console driver will try to detect any 122keyboard in the system if it did not detect one while it was 123initialized at boot time. 124.Sh DRIVER CONFIGURATION 125.D1 Cd "options KBD_INSTALL_CDEV" 126.Pp 127Make the keyboards available through a character device in 128.Pa /dev . 129.Pp 130.D1 Cd options HKBD_DFLT_KEYMAP 131.D1 Cd makeoptions HKBD_DFLT_KEYMAP=fr.iso 132.Pp 133The above lines will put the French ISO keymap in the ukbd driver. 134You can specify any keymap in 135.Pa /usr/share/syscons/keymaps 136or 137.Pa /usr/share/vt/keymaps 138(depending on the console driver being used) with this option. 139.Pp 140.D1 Cd "options KBD_DISABLE_KEYMAP_LOADING" 141.Pp 142Do not allow the user to change the keymap. 143Note that these options also affect the AT keyboard driver, 144.Xr atkbd 4 . 145.Sh SYSCTL VARIABLES 146The following variables are available as both 147.Xr sysctl 8 148variables and 149.Xr loader 8 150tunables: 151.Bl -tag -width indent 152.It Va hw.hid.hkbd.debug 153Debug output level, where 0 is debugging disabled and larger values increase 154debug message verbosity. 155Default is 0. 156.El 157.Sh FILES 158.Bl -tag -width ".Pa /dev/input/event*" -compact 159.It Pa /dev/kbd* 160blocking device nodes 161.It Pa /dev/input/event* 162input event device nodes. 163.El 164.Sh EXAMPLES 165.D1 Cd "device hkbd" 166.Pp 167Add the 168.Nm 169driver to the kernel. 170.Sh SEE ALSO 171.Xr kbdcontrol 1 , 172.Xr hid 4 , 173.Xr hidbus 4 , 174.Xr iichid 4 , 175.Xr syscons 4 , 176.Xr usbhid 4 , 177.Xr vt 4 , 178.Xr config 8 179.Sh AUTHORS 180.An -nosplit 181The 182.Nm 183driver was written by 184.An Lennart Augustsson Aq Mt augustss@cs.chalmers.se 185for 186.Nx 187and was substantially rewritten for 188.Fx 189by 190.An Kazutaka YOKOTA Aq Mt yokota@zodiac.mech.utsunomiya-u.ac.jp . 191.Pp 192This manual page was written by 193.An Nick Hibma Aq Mt n_hibma@FreeBSD.org 194with a large amount of input from 195.An Kazutaka YOKOTA Aq Mt yokota@zodiac.mech.utsunomiya-u.ac.jp . 196