p The common keyboard support consists of: l -bullet t Mapping from keycodes (defined by the specific keyboard driver) to keysyms (hardware independent, defined in
a /usr/include/dev/wscons/wsksymdef.h ) . t Handling of .Dq compose sequences. Characters commonly not present as separate key on keyboards can be generated after either a special .Dq compose key is pressed or a .Dq dead accent character is used. t Certain translations, like turning an .Dq ALT modifier into an .Dq ESC prefix. t Automatic key repetition
q Dq typematic . t Parameter handling for .Dq keyboard bells . t Generation of .Dq keyboard events for use by X servers. .El
p The .Nm driver provides a number of ioctl functions to control key maps and other parameters. These functions are accessible though the associated .Dq wsdisplay device as well. A complete list is in
a /usr/include/dev/wscons/wsconsio.h . The .Xr wsconsctl 8 utility allows to access key maps and other variables.
p The .Em console locator in the configuration line refers to the device's use as input part of the operating system console. A device specification containing a positive value here will only match if the device is in use as system console. (The console device selection in early system startup is not influenced.) This way, the console device can be connected to a known wskbd device instance. .Ss Ioctls The following .Xr ioctl 2 calls are provided by the .Nm driver or by devices which use it. Their definitions are found in
a dev/wscons/wsconsio.h . l -tag -width Dv t Dv WSKBDIO_GTYPE Get the keyboard type. t Dv WSKBDIO_COMPLEXBELL, WSKBDIO_SETBELL, WSKBDIO_GETBELL, WSKBDIO_SETDEFAULTBELL, WSKBDIO_GETDEFAULTBELL Pq Li "struct wsmouse_repeat" Get and set keyboard bell settings. t Dv WSKBDIO_SETKEYREPEAT, WSKBDIO_GETKEYREPEAT, WSKBDIO_SETDEFAULTKEYREPEAT, WSKBDIO_GETDEFAULTKEYREPEAT Pq Li "struct wskbd_keyrepeat_data" Get and set keyboard autorepeat settings. t Dv WSKBDIO_SETLEDS, WSKBDIO_GETLEDS Pq Li "int" Get and set keyboard LED settings. t Dv WSKBDIO_GETMAP, WSKBDIO_SETMAP Pq Li "struct wskbd_map_data" Get and set keyboard keymapping settings. t Dv WSKBDIO_GETENCODING, WSKBDIO_SETENCODING Pq Li "kbd_t" Get and set keyboard encoding settings. t Dv WSKBDIO_GETKEYCLICK, WSKBDIO_SETKEYCLICK Pq Li "int" Get and set keyboard keyclick settings. t Dv WSKBDIO_SETVERSION Pq Li "int" Set the wscons_event protocol version. The default is 0 for binary compatibility. The latest version is always available as .Dv WSKBD_EVENT_VERSION , and is currently 1. All new code should use a call similar to the below to ensure the correct version is returned. d -literal -offset indent int ver = WSKBD_EVENT_VERSION; if (ioctl(fd, WSKBDIO_SETVERSION, &ver) == -1) err(EXIT_FAILURE, "cannot set version"); .Ed .El .Sh FILES l -item t
a /usr/include/dev/wscons/wsksymdef.h t
a /usr/include/dev/wscons/wsconsio.h . .El .Sh SEE ALSO .Xr btkbd 4 , .Xr pckbd 4 , .Xr ukbd 4 , .Xr wscons 4 , .Xr wsmux 4 , .Xr wsconsctl 8 , .Xr wskbd 9