1.\" $NetBSD: wskbd.4,v 1.16 2012/05/27 12:05:40 wiz Exp $ 2.\" 3.\" Copyright (c) 1999 4.\" Matthias Drochner. All rights reserved. 5.\" 6.\" Redistribution and use in source and binary forms, with or without 7.\" modification, are permitted provided that the following conditions 8.\" are met: 9.\" 1. Redistributions of source code must retain the above copyright 10.\" notice, this list of conditions and the following disclaimer. 11.\" 2. Redistributions in binary form must reproduce the above copyright 12.\" notice, this list of conditions and the following disclaimer in the 13.\" documentation and/or other materials provided with the distribution. 14.\" 15.\" THIS SOFTWARE IS PROVIDED BY THE AUTHOR AND CONTRIBUTORS ``AS IS'' AND 16.\" ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE 17.\" IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE 18.\" ARE DISCLAIMED. IN NO EVENT SHALL THE AUTHOR OR CONTRIBUTORS BE LIABLE 19.\" FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL 20.\" DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS 21.\" OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) 22.\" HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT 23.\" LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY 24.\" OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF 25.\" SUCH DAMAGE. 26.\" 27.Dd May 27, 2012 28.Dt WSKBD 4 29.Os 30.Sh NAME 31.Nm wskbd 32.Nd generic keyboard support in wscons 33.Sh SYNOPSIS 34.Cd "wskbd* at pckbd? console ? mux 1" 35(standard PC keyboard) 36.Cd "wskbd* at ukbd? console ? mux 1" 37(USB keyboard) 38.Cd "wskbd* at lkkbd? console ? mux 1" 39(DEC LK200/400 serial keyboard) 40.Cd "wskbd0 at akbd? console ? mux 1" 41(Apple ADB keyboard) 42.Cd "wskbd0 at nextkbd? console ? mux 1" 43(NeXT keyboard) 44.Cd "wskbd* at vrkiu? console ? mux 1" 45(NEC VR4000 series HPC keyboard) 46.Cd "wskbd* at skbd? console ? mux 1" 47(keyboard of misc hpcmips handheld devices) 48.Cd "wskbd* at btkbd? console ? mux 1" 49(Bluetooth keyboard) 50.Sh DESCRIPTION 51The 52.Nm 53driver handles common tasks for keyboards within the 54.Xr wscons 4 55framework. 56It is attached to the hardware specific keyboard drivers and 57provides their connection to 58.Dq wsdisplay 59devices and a character device interface. 60.Pp 61The common keyboard support consists of: 62.Bl -bullet 63.It 64Mapping from keycodes (defined by the specific keyboard driver) to 65keysyms (hardware independent, defined in 66.Pa /usr/include/dev/wscons/wsksymdef.h ) . 67.It 68Handling of 69.Dq compose 70sequences. 71Characters commonly not present as separate key on keyboards 72can be generated after either a special 73.Dq compose 74key is pressed or a 75.Dq dead accent 76character is used. 77.It 78Certain translations, like turning an 79.Dq ALT 80modifier into an 81.Dq ESC 82prefix. 83.It 84Automatic key repetition 85.Pq Dq typematic . 86.It 87Parameter handling for 88.Dq keyboard bells . 89.It 90Generation of 91.Dq keyboard events 92for use by X servers. 93.El 94.Pp 95The 96.Nm 97driver provides a number of ioctl functions to control key maps 98and other parameters. 99These functions are accessible though the associated 100.Dq wsdisplay 101device as well. 102A complete list is in 103.Pa /usr/include/dev/wscons/wsconsio.h . 104The 105.Xr wsconsctl 8 106utility allows to access key maps and other variables. 107.Pp 108The 109.Em console 110locator in the configuration line refers to the device's use as input 111part of the operating system console. 112A device specification containing a positive value here will only 113match if the device is in use as system console. 114(The console device selection in early system startup is not influenced.) 115This way, the console device can be connected to a known 116wskbd device instance. 117.Ss Ioctls 118The following 119.Xr ioctl 2 120calls are provided by the 121.Nm 122driver or by devices which use it. 123Their definitions are found in 124.Pa dev/wscons/wsconsio.h . 125.Bl -tag -width Dv 126.It Dv WSKBDIO_GTYPE 127Get the keyboard type. 128.It Dv WSKBDIO_COMPLEXBELL, WSKBDIO_SETBELL, WSKBDIO_GETBELL, WSKBDIO_SETDEFAULTBELL, WSKBDIO_GETDEFAULTBELL Pq Li "struct wsmouse_repeat" 129Get and set keyboard bell settings. 130.It Dv WSKBDIO_SETKEYREPEAT, WSKBDIO_GETKEYREPEAT, WSKBDIO_SETDEFAULTKEYREPEAT, WSKBDIO_GETDEFAULTKEYREPEAT Pq Li "struct wskbd_keyrepeat_data" 131Get and set keyboard autorepeat settings. 132.It Dv WSKBDIO_SETLEDS, WSKBDIO_GETLEDS Pq Li "int" 133Get and set keyboard LED settings. 134.It Dv WSKBDIO_GETMAP, WSKBDIO_SETMAP Pq Li "struct wskbd_map_data" 135Get and set keyboard keymapping settings. 136.It Dv WSKBDIO_GETENCODING, WSKBDIO_SETENCODING Pq Li "kbd_t" 137Get and set keyboard encoding settings. 138.It Dv WSKBDIO_GETKEYCLICK, WSKBDIO_SETKEYCLICK Pq Li "int" 139Get and set keyboard keyclick settings. 140.It Dv WSKBDIO_SETVERSION Pq Li "int" 141Set the wscons_event protocol version. 142The default is 0 for binary compatibility. 143The latest version is 144always available as 145.Dv WSKBD_EVENT_VERSION , 146and is currently 1. 147All new code should use a call similar to the below to ensure the 148correct version is returned. 149.Bd -literal -offset indent 150int ver = WSKBD_EVENT_VERSION; 151if (ioctl(fd, WSKBDIO_SETVERSION, &ver) == -1) 152 err(EXIT_FAILURE, "cannot set version"); 153.Ed 154.El 155.Sh FILES 156.Bl -item 157.It 158.Pa /dev/wskbd* 159.It 160.Pa /usr/include/dev/wscons/wsksymdef.h 161.It 162.Pa /usr/include/dev/wscons/wsconsio.h . 163.El 164.Sh SEE ALSO 165.Xr btkbd 4 , 166.Xr pckbd 4 , 167.Xr ukbd 4 , 168.Xr wscons 4 , 169.Xr wsmux 4 , 170.Xr wsconsctl 8 , 171.Xr wskbd 9 172