xref: /freebsd-src/share/man/man4/hkbd.4 (revision fa9896e082a1046ff4fbc75fcba4d18d1f2efc19)
108d88401SVladimir Kondratyev.\" Copyright (c) 1997, 1998
208d88401SVladimir Kondratyev.\"	Nick Hibma <n_hibma@FreeBSD.org>. All rights reserved.
308d88401SVladimir Kondratyev.\"
408d88401SVladimir Kondratyev.\" Redistribution and use in source and binary forms, with or without
508d88401SVladimir Kondratyev.\" modification, are permitted provided that the following conditions
608d88401SVladimir Kondratyev.\" are met:
708d88401SVladimir Kondratyev.\" 1. Redistributions of source code must retain the above copyright
808d88401SVladimir Kondratyev.\"    notice, this list of conditions and the following disclaimer.
908d88401SVladimir Kondratyev.\" 2. Redistributions in binary form must reproduce the above copyright
1008d88401SVladimir Kondratyev.\"    notice, this list of conditions and the following disclaimer in the
1108d88401SVladimir Kondratyev.\"    documentation and/or other materials provided with the distribution.
1208d88401SVladimir Kondratyev.\"
1308d88401SVladimir Kondratyev.\" THIS SOFTWARE IS PROVIDED BY THE AUTHOR AND CONTRIBUTORS ``AS IS'' AND
1408d88401SVladimir Kondratyev.\" ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
1508d88401SVladimir Kondratyev.\" IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
1608d88401SVladimir Kondratyev.\" ARE DISCLAIMED.  IN NO EVENT SHALL THE AUTHOR OR CONTRIBUTORS BE LIABLE
1708d88401SVladimir Kondratyev.\" FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
1808d88401SVladimir Kondratyev.\" DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
1908d88401SVladimir Kondratyev.\" OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
2008d88401SVladimir Kondratyev.\" HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
2108d88401SVladimir Kondratyev.\" LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
2208d88401SVladimir Kondratyev.\" OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
2308d88401SVladimir Kondratyev.\" SUCH DAMAGE.
2408d88401SVladimir Kondratyev.\"
25*b93f6bfcSVladimir Kondratyev.Dd September 12, 2020
26*b93f6bfcSVladimir Kondratyev.Dt HKBD 4
2708d88401SVladimir Kondratyev.Os
2808d88401SVladimir Kondratyev.Sh NAME
29*b93f6bfcSVladimir Kondratyev.Nm hkbd
30*b93f6bfcSVladimir Kondratyev.Nd HID keyboard driver
3108d88401SVladimir Kondratyev.Sh SYNOPSIS
3208d88401SVladimir KondratyevTo compile this driver into the kernel,
3308d88401SVladimir Kondratyevplace the following line in your
3408d88401SVladimir Kondratyevkernel configuration file:
3508d88401SVladimir Kondratyev.Bd -ragged -offset indent
36*b93f6bfcSVladimir Kondratyev.Cd "device hkbd"
3708d88401SVladimir Kondratyev.Cd "device hid"
38*b93f6bfcSVladimir Kondratyev.Cd "device hidbus"
39*b93f6bfcSVladimir Kondratyev.Cd "device evdev"
40*b93f6bfcSVladimir Kondratyev.Cd "options EVDEV_SUPPORT"
4108d88401SVladimir Kondratyev.Ed
4208d88401SVladimir Kondratyev.Pp
4308d88401SVladimir KondratyevAlternatively, to load the driver as a
4408d88401SVladimir Kondratyevmodule at boot time, place the following line in
4508d88401SVladimir Kondratyev.Xr loader.conf 5 :
4608d88401SVladimir Kondratyev.Bd -literal -offset indent
47*b93f6bfcSVladimir Kondratyevhkbd_load="YES"
4808d88401SVladimir Kondratyev.Ed
4908d88401SVladimir Kondratyev.Sh DESCRIPTION
5008d88401SVladimir KondratyevThe
5108d88401SVladimir Kondratyev.Nm
52*b93f6bfcSVladimir Kondratyevdriver provides support for keyboards that attach to the HID transport
53*b93f6bfcSVladimir Kondratyevbackend.
54*b93f6bfcSVladimir Kondratyev.Xr hid 4 ,
55*b93f6bfcSVladimir Kondratyev.Xr hidbus 4 ,
5608d88401SVladimir Kondratyevand one of
57*b93f6bfcSVladimir Kondratyev.Xr iichid 4
5808d88401SVladimir Kondratyevor
59*b93f6bfcSVladimir Kondratyev.Xr usbhid 4
6008d88401SVladimir Kondratyevmust be configured in the kernel as well.
6108d88401SVladimir Kondratyev.Sh CONFIGURATION
6208d88401SVladimir KondratyevBy default, the keyboard subsystem does not create the appropriate devices yet.
6308d88401SVladimir KondratyevMake sure you reconfigure your kernel with the following option in the kernel
6408d88401SVladimir Kondratyevconfig file:
6508d88401SVladimir Kondratyev.Pp
6608d88401SVladimir Kondratyev.Dl "options KBD_INSTALL_CDEV"
6708d88401SVladimir Kondratyev.Pp
68*b93f6bfcSVladimir KondratyevIf both an AT keyboard HID keyboards are used at the same time, the
6908d88401SVladimir KondratyevAT keyboard will appear as
7008d88401SVladimir Kondratyev.Pa kbd0
7108d88401SVladimir Kondratyevin
7208d88401SVladimir Kondratyev.Pa /dev .
73*b93f6bfcSVladimir KondratyevThe HID keyboards will be
7408d88401SVladimir Kondratyev.Pa kbd1 , kbd2 ,
7508d88401SVladimir Kondratyevetc.
7608d88401SVladimir KondratyevYou can see some information about the keyboard with the following command:
7708d88401SVladimir Kondratyev.Pp
7808d88401SVladimir Kondratyev.Dl "kbdcontrol -i < /dev/kbd1"
7908d88401SVladimir Kondratyev.Pp
8008d88401SVladimir Kondratyevor load a keymap with
8108d88401SVladimir Kondratyev.Pp
8208d88401SVladimir Kondratyev.Dl "kbdcontrol -l keymaps/pt.iso < /dev/kbd1"
8308d88401SVladimir Kondratyev.Pp
8408d88401SVladimir KondratyevSee
8508d88401SVladimir Kondratyev.Xr kbdcontrol 1
8608d88401SVladimir Kondratyevfor more possible options.
8708d88401SVladimir Kondratyev.Pp
8808d88401SVladimir KondratyevYou can swap console keyboards by using the command
8908d88401SVladimir Kondratyev.Pp
9008d88401SVladimir Kondratyev.Dl "kbdcontrol -k /dev/kbd1"
9108d88401SVladimir Kondratyev.Pp
92*b93f6bfcSVladimir KondratyevFrom this point on, the first HID keyboard will be the keyboard
9308d88401SVladimir Kondratyevto be used by the console.
9408d88401SVladimir Kondratyev.Pp
95*b93f6bfcSVladimir KondratyevIf you want to use a HID keyboard as your default and not use an AT keyboard at
9608d88401SVladimir Kondratyevall, you will have to remove the
9708d88401SVladimir Kondratyev.Cd "device atkbd"
9808d88401SVladimir Kondratyevline from the kernel configuration file.
9908d88401SVladimir KondratyevBecause of the device initialization order,
100*b93f6bfcSVladimir Kondratyevthe HID keyboard will be detected
10108d88401SVladimir Kondratyev.Em after
10208d88401SVladimir Kondratyevthe console driver
10308d88401SVladimir Kondratyevinitializes itself and you have to explicitly tell the console
104*b93f6bfcSVladimir Kondratyevdriver to use the existence of the HID keyboard.
10508d88401SVladimir KondratyevThis can be done in
10608d88401SVladimir Kondratyevone of the following two ways.
10708d88401SVladimir Kondratyev.Pp
10808d88401SVladimir KondratyevRun the following command as a part of system initialization:
10908d88401SVladimir Kondratyev.Pp
11008d88401SVladimir Kondratyev.Dl "kbdcontrol -k /dev/kbd0 < /dev/ttyv0 > /dev/null"
11108d88401SVladimir Kondratyev.Pp
112*b93f6bfcSVladimir Kondratyev(Note that as the HID keyboard is the only keyboard, it is accessed as
11308d88401SVladimir Kondratyev.Pa /dev/kbd0 )
11408d88401SVladimir Kondratyevor otherwise tell the console driver to periodically look for a
11508d88401SVladimir Kondratyevkeyboard by setting a flag in the kernel configuration file:
11608d88401SVladimir Kondratyev.Pp
11708d88401SVladimir Kondratyev.Dl "device sc0 at isa? flags 0x100"
11808d88401SVladimir Kondratyev.Pp
11908d88401SVladimir KondratyevWith the above flag, the console driver will try to detect any
12008d88401SVladimir Kondratyevkeyboard in the system if it did not detect one while it was
12108d88401SVladimir Kondratyevinitialized at boot time.
12208d88401SVladimir Kondratyev.Sh DRIVER CONFIGURATION
12308d88401SVladimir Kondratyev.D1 Cd "options KBD_INSTALL_CDEV"
12408d88401SVladimir Kondratyev.Pp
12508d88401SVladimir KondratyevMake the keyboards available through a character device in
12608d88401SVladimir Kondratyev.Pa /dev .
12708d88401SVladimir Kondratyev.Pp
128*b93f6bfcSVladimir Kondratyev.D1 Cd options HKBD_DFLT_KEYMAP
129*b93f6bfcSVladimir Kondratyev.D1 Cd makeoptions HKBD_DFLT_KEYMAP=fr.iso
13008d88401SVladimir Kondratyev.Pp
13108d88401SVladimir KondratyevThe above lines will put the French ISO keymap in the ukbd driver.
13208d88401SVladimir KondratyevYou can specify any keymap in
13308d88401SVladimir Kondratyev.Pa /usr/share/syscons/keymaps
13408d88401SVladimir Kondratyevor
13508d88401SVladimir Kondratyev.Pa /usr/share/vt/keymaps
13608d88401SVladimir Kondratyev(depending on the console driver being used) with this option.
13708d88401SVladimir Kondratyev.Pp
13808d88401SVladimir Kondratyev.D1 Cd "options KBD_DISABLE_KEYMAP_LOADING"
13908d88401SVladimir Kondratyev.Pp
14008d88401SVladimir KondratyevDo not allow the user to change the keymap.
14108d88401SVladimir KondratyevNote that these options also affect the AT keyboard driver,
14208d88401SVladimir Kondratyev.Xr atkbd 4 .
14308d88401SVladimir Kondratyev.Sh SYSCTL VARIABLES
14408d88401SVladimir KondratyevThe following variables are available as both
14508d88401SVladimir Kondratyev.Xr sysctl 8
14608d88401SVladimir Kondratyevvariables and
14708d88401SVladimir Kondratyev.Xr loader 8
14808d88401SVladimir Kondratyevtunables:
14908d88401SVladimir Kondratyev.Bl -tag -width indent
150*b93f6bfcSVladimir Kondratyev.It Va hw.hid.hkbd.debug
15108d88401SVladimir KondratyevDebug output level, where 0 is debugging disabled and larger values increase
15208d88401SVladimir Kondratyevdebug message verbosity.
15308d88401SVladimir KondratyevDefault is 0.
15408d88401SVladimir Kondratyev.El
15508d88401SVladimir Kondratyev.Sh FILES
156*b93f6bfcSVladimir Kondratyev.Bl -tag -width ".Pa /dev/input/event*" -compact
15708d88401SVladimir Kondratyev.It Pa /dev/kbd*
15808d88401SVladimir Kondratyevblocking device nodes
159*b93f6bfcSVladimir Kondratyev.It Pa /dev/input/event*
160*b93f6bfcSVladimir Kondratyevinput event device nodes.
16108d88401SVladimir Kondratyev.El
16208d88401SVladimir Kondratyev.Sh EXAMPLES
163*b93f6bfcSVladimir Kondratyev.D1 Cd "device hkbd"
16408d88401SVladimir Kondratyev.Pp
16508d88401SVladimir KondratyevAdd the
16608d88401SVladimir Kondratyev.Nm
16708d88401SVladimir Kondratyevdriver to the kernel.
16808d88401SVladimir Kondratyev.Sh SEE ALSO
16908d88401SVladimir Kondratyev.Xr kbdcontrol 1 ,
170*b93f6bfcSVladimir Kondratyev.Xr hid 4 ,
171*b93f6bfcSVladimir Kondratyev.Xr hidbus 4 ,
172*b93f6bfcSVladimir Kondratyev.Xr iichid 4 ,
17308d88401SVladimir Kondratyev.Xr syscons 4 ,
174*b93f6bfcSVladimir Kondratyev.Xr usbhid 4 ,
17508d88401SVladimir Kondratyev.Xr vt 4 ,
17608d88401SVladimir Kondratyev.Xr config 8
17708d88401SVladimir Kondratyev.Sh AUTHORS
17808d88401SVladimir Kondratyev.An -nosplit
17908d88401SVladimir KondratyevThe
18008d88401SVladimir Kondratyev.Nm
18108d88401SVladimir Kondratyevdriver was written by
18208d88401SVladimir Kondratyev.An Lennart Augustsson Aq Mt augustss@cs.chalmers.se
18308d88401SVladimir Kondratyevfor
18408d88401SVladimir Kondratyev.Nx
18508d88401SVladimir Kondratyevand was substantially rewritten for
18608d88401SVladimir Kondratyev.Fx
18708d88401SVladimir Kondratyevby
18808d88401SVladimir Kondratyev.An Kazutaka YOKOTA Aq Mt yokota@zodiac.mech.utsunomiya-u.ac.jp .
18908d88401SVladimir Kondratyev.Pp
19008d88401SVladimir KondratyevThis manual page was written by
19108d88401SVladimir Kondratyev.An Nick Hibma Aq Mt n_hibma@FreeBSD.org
19208d88401SVladimir Kondratyevwith a large amount of input from
19308d88401SVladimir Kondratyev.An Kazutaka YOKOTA Aq Mt yokota@zodiac.mech.utsunomiya-u.ac.jp .
194