1.\" $OpenBSD: ukbd.4,v 1.22 2019/05/11 14:19:16 abieber Exp $ 2.\" $NetBSD: ukbd.4,v 1.10 2001/12/29 15:12:32 augustss Exp $ 3.\" 4.\" Copyright (c) 1999, 2001 The NetBSD Foundation, Inc. 5.\" All rights reserved. 6.\" 7.\" This code is derived from software contributed to The NetBSD Foundation 8.\" by Lennart Augustsson. 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.\" 19.\" THIS SOFTWARE IS PROVIDED BY THE NETBSD FOUNDATION, INC. AND CONTRIBUTORS 20.\" ``AS IS'' AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED 21.\" TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR 22.\" PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE FOUNDATION OR CONTRIBUTORS 23.\" BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR 24.\" CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF 25.\" SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS 26.\" INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN 27.\" CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) 28.\" ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE 29.\" POSSIBILITY OF SUCH DAMAGE. 30.\" 31.\" Copyright (c) 1999 32.\" Matthias Drochner. All rights reserved. 33.\" 34.\" Redistribution and use in source and binary forms, with or without 35.\" modification, are permitted provided that the following conditions 36.\" are met: 37.\" 1. Redistributions of source code must retain the above copyright 38.\" notice, this list of conditions and the following disclaimer. 39.\" 2. Redistributions in binary form must reproduce the above copyright 40.\" notice, this list of conditions and the following disclaimer in the 41.\" documentation and/or other materials provided with the distribution. 42.\" 43.\" THIS SOFTWARE IS PROVIDED BY THE AUTHOR AND CONTRIBUTORS ``AS IS'' AND 44.\" ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE 45.\" IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE 46.\" ARE DISCLAIMED. IN NO EVENT SHALL THE AUTHOR OR CONTRIBUTORS BE LIABLE 47.\" FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL 48.\" DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS 49.\" OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) 50.\" HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT 51.\" LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY 52.\" OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF 53.\" SUCH DAMAGE. 54.\" 55.Dd $Mdocdate: May 11 2019 $ 56.Dt UKBD 4 57.Os 58.Sh NAME 59.Nm ukbd 60.Nd USB keyboard support 61.Sh SYNOPSIS 62.Cd "ukbd* at uhidev?" 63.Cd "wskbd* at ukbd?" 64.Cd "option UKBD_LAYOUT=XXX" 65.Sh DESCRIPTION 66The 67.Nm 68driver provides support for USB keyboards i.e. HID devices in the 69.Dq keyboard 70class. 71Access to the keyboard is through the 72.Xr wskbd 4 73driver. 74.Pp 75The 76.Nm 77driver supports a number of different key mappings which 78can be chosen from with the kernel option 79.Dq UKBD_LAYOUT 80at compile time or with the utility 81.Xr wsconsctl 8 82(variable: 83.Dq keyboard.encoding ) 84at runtime. 85Other mappings can be used if the whole keymap is replaced by means of 86.Xr wsconsctl 8 . 87The built-in mappings are at this time: 88.Pp 89.Bl -tag -width Ds -offset indent -compact 90.It KB_BE 91.Pq be 92Belgium French. 93.It KB_BR 94.Pq br 95Brazilian. 96.It KB_CF 97.Pq cf 98Canadian French. 99.It KB_DE 100.Pq de 101German with 102.Dq dead accents . 103.It KB_DK 104.Pq dk 105Danish with 106.Dq dead accents . 107.It KB_ES 108.Pq es 109Spanish. 110.It KB_FR 111.Pq fr 112French. 113.It KB_FR | KB_APPLE 114.Pq fr.apple 115French for 116.Tn Apple 117black USB keyboards. 118.It KB_FR | KB_DVORAK 119.Pq fr.dvorak 120French keyboard with 121.Dq Dvorak-Bepo 122layout. 123.It KB_HU 124.Pq hu 125Hungarian. 126.It KB_IS 127.Pq is 128Icelandic with 129.Dq dead accents . 130.It KB_IT 131.Pq it 132Italian. 133.It KB_JP 134.Pq jp 135Japanese. 136.It KB_LA 137.Pq la 138Latinamerican. 139.It KB_LT 140.Pq \< 141Lithuanian in 142.Dq ISO 8859-13 . 143.It KB_LV 144.Pq \&lv 145Latvian 146.It KB_NL 147.Pq \&nl 148Dutch with 149.Dq dead accents . 150.It KB_NO 151.Pq no 152Norwegian with 153.Dq dead accents . 154.It KB_PL 155.Pq pl 156Polish in 157.Dq ISO 8859-2 . 158.It KB_PT 159.Pq pt 160Portuguese. 161.It KB_PT | KB_APPLE 162.Pq pt.apple 163Portuguese for 164.Tn Apple 165black USB keyboards. 166.It KB_RU 167.Pq ru 168Russian in 169.Dq KOI8 . 170.It KB_SF 171.Pq sf 172Swiss French with 173.Dq dead accents . 174.It KB_SG 175.Pq sg 176Swiss German with 177.Dq dead accents . 178.It KB_SI 179.Pq si 180Slovenian. 181.It KB_SV 182.Pq sv 183Swedish with 184.Dq dead accents . 185.It KB_TR 186.Pq tr 187Turkish in 188.Dq ISO 8859-9 189with 190.Dq dead accents . 191.It KB_UA 192.Pq ua 193Ukrainian in 194.Dq KOI8 . 195.It KB_UK 196.Pq uk 197British. 198.It KB_US 199.Pq us 200English/US keyboard mapping (default). 201.It KB_US | KB_COLEMAK 202.Pq us.colemak 203English/US keyboard with 204.Dq Colemak 205layout. 206.It KB_US | KB_DVORAK 207.Pq us.dvorak 208English/US keyboard with 209.Dq Dvorak 210layout. 211.El 212.Pp 213The KB_DE, KB_DK, KB_IS, KB_NO, KB_SF, KB_SG, KB_SV and KB_TR 214mappings can be used in the KB_NODEAD 215.Pq .nodead 216variant. 217This switches off the 218.Dq dead accents . 219.Pp 220The KB_BE, KB_FR, KB_FR | KB_APPLE, KB_FR | KB_DVORAK, KB_JP, KB_UK, KB_US, 221KB_US | KB_DVORAK and KB_US | KB_COLEMAK 222mappings can be modified 223to swap the left Control and the Caps Lock keys by the 224KB_SWAPCTRLCAPS variant bit or the 225.Dq .swapctrlcaps 226suffix. 227.Pp 228The KB_METAESC 229.Pq .metaesc 230option can be applied to any layout. 231If set, keys pressed together 232with the ALT modifier are prefixed by an ESC character. 233(Standard behaviour is to add 128 to the ASCII value.) 234.Sh EXAMPLES 235To set a German keyboard layout without 236.Dq dead accents 237and sending an ESC character before the key symbol if the ALT 238key is pressed simultaneously, use 239.Ic wsconsctl keyboard.encoding=de.nodead.metaesc . 240To set it at kernel build time, add the following 241to the kernel configuration file: 242.Bd -literal -offset indent 243option UKBD_LAYOUT="(KB_DE|KB_NODEAD|KB_METAESC)" 244.Ed 245.Sh SEE ALSO 246.Xr usbhidctl 1 , 247.Xr intro 4 , 248.Xr uhidev 4 , 249.Xr usb 4 , 250.Xr wskbd 4 , 251.Xr wsconsctl 8 252.Sh HISTORY 253The 254.Nm 255driver 256appeared in 257.Nx 1.4 . 258.Ox 259support was added in 260.Ox 2.8 . 261.Sh BUGS 262The 263.Nm 264driver is brought into action rather late in the boot process, so if 265it is used as the console driver then 266.Xr ddb 4 267is not usable until late in the boot. 268.Pp 269The list of built-in mappings doesn't follow any logic. 270It grew as people submitted what they needed. 271