1.\" $OpenBSD: ukbd.4,v 1.17 2008/08/09 16:31:06 miod 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: August 9 2008 $ 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_IT 127.Pq it 128Italian. 129.It KB_JP 130.Pq jp 131Japanese. 132.It KB_LA 133.Pq la 134Latinamerican. 135.It KB_LT 136.Pq \< 137Lithuanian in 138.Dq ISO 8859-13 . 139.It KB_LV 140.Pq \&lv 141Latvian 142.It KB_NL 143.Pq \&nl 144Dutch with 145.Dq dead accents . 146.It KB_NO 147.Pq no 148Norwegian with 149.Dq dead accents . 150.It KB_PL 151.Pq pl 152Polish in 153.Dq ISO 8859-2 . 154.It KB_PT 155.Pq pt 156Portuguese. 157.It KB_PT | KB_APPLE 158.Pq pt.apple 159Portuguese for 160.Tn Apple 161black USB keyboards. 162.It KB_RU 163.Pq ru 164Russian in 165.Dq KOI8 . 166.It KB_SF 167.Pq sf 168Swiss French with 169.Dq dead accents . 170.It KB_SG 171.Pq sg 172Swiss German with 173.Dq dead accents . 174.It KB_SI 175.Pq si 176Slovenian. 177.It KB_SV 178.Pq sv 179Swedish with 180.Dq dead accents . 181.It KB_TR 182.Pq tr 183Turkish in 184.Dq ISO 8859-9 185with 186.Dq dead accents . 187.It KB_UA 188.Pq ua 189Ukrainian in 190.Dq KOI8 . 191.It KB_UK 192.Pq uk 193British. 194.It KB_US 195.Pq us 196English/US keyboard mapping (default). 197.It KB_US | KB_DVORAK 198.Pq us.dvorak 199English/US keyboard with 200.Dq Dvorak 201layout. 202.El 203.Pp 204The KB_DE, KB_DK, KB_NO, KB_SF, KB_SG, KB_SV and KB_TR mappings can be used in 205the KB_NODEAD 206.Pq .nodead 207variant. 208This switches off the 209.Dq dead accents . 210.Pp 211The KB_BE, KB_FR, KB_FR |�KB_APPLE, KB_FR | KB_DVORAK, KB_JP, KB_US and 212KB_US | KB_DVORAK 213mappings can be modified 214to swap the left Control and the Caps Lock keys by the 215KB_SWAPCTRLCAPS variant bit or the 216.Dq .swapctrlcaps 217suffix. 218.Pp 219The KB_METAESC 220.Pq .metaesc 221option can be applied to any layout. 222If set, keys pressed together 223with the ALT modifier are prefixed by an ESC character. 224(Standard behaviour is to add 128 to the ASCII value.) 225.Sh EXAMPLES 226To set a German keyboard layout without 227.Dq dead accents 228and sending an ESC character before the key symbol if the ALT 229key is pressed simultaneously, use 230.Ic wsconsctl -w keyboard.encoding=de.nodead.metaesc . 231To set it at kernel build time, add the following 232to the kernel configuration file: 233.Bd -literal -offset indent 234option UKBD_LAYOUT="(KB_DE|KB_NODEAD|KB_METAESC)" 235.Ed 236.Sh SEE ALSO 237.Xr usbhidctl 1 , 238.Xr intro 4 , 239.Xr uhidev 4 , 240.Xr usb 4 , 241.Xr wskbd 4 , 242.Xr wsconsctl 8 243.Sh HISTORY 244The 245.Nm 246driver 247appeared in 248.Nx 1.4 . 249.Ox 250support was added in 251.Ox 2.8 . 252.Sh BUGS 253The 254.Nm 255driver is brought into action rather late in the boot process, so if 256it is used as the console driver then 257.Xr ddb 4 258is not usable until late in the boot. 259.Pp 260The list of built-in mappings doesn't follow any logic. 261It grew as people submitted what they needed. 262