---
name: "wskbd"
section: "4"
platform: "openbsd"
package: "man"
version: "8.0-current-20261101"
release: "OpenBSD 8.0-current (2026-11-01)"
platforms: ["openbsd"]
url: "https://new.carta.tech/wskbd"
---

# wskbd(4)

generic keyboard support in wscons

## NAME

**wskbd** – generic keyboard support in wscons

## SYNOPSIS

**wskbd\* at ...**

## DESCRIPTION

The **wskbd** driver handles common tasks for keyboards within the [wscons(4)](/wscons/4.md) framework. It is attached to the hardware specific keyboard drivers and provides their connection to “wsdisplay” devices and a character device interface.

The common keyboard support consists of:

- Mapping from keycodes (defined by the specific keyboard driver) to keysyms (hardware independent, defined in */usr/include/dev/wscons/wsksymdef.h*).

- Handling of “compose” sequences. Characters commonly not present as separate keys on keyboards can be generated after either a special “compose” key is pressed or a “dead accent” character is used.

- Certain translations, like turning an “ALT” modifier into an “ESC” prefix.

- Automatic key repetition (“typematic”).

- Parameter handling for “keyboard bells”.

- Generation of “keyboard events” for use by X servers.

The **wskbd** driver provides a number of ioctl functions to control key maps and other parameters. These functions are accessible through the associated “wsdisplay” device as well. A complete list is in */usr/include/dev/wscons/wsconsio.h*. The [wsconsctl(8)](/wsconsctl/8.md) utility allows access to key maps and other variables.

The *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.

The **wskbd** driver traps certain key sequences intended to perform special functions. The **Ctrl+Alt+Esc** sequence will initiate the [ddb(4)](/ddb/4.md) kernel debugger if the “ddb.console” [sysctl(8)](/sysctl/8.md) variable is set. When attached to a [wsdisplay(4)](/wsdisplay/4.md) device, **Ctrl+Alt+Fx** switches virtual terminals and the **Shift+PgUp** and **Shift+PgDn** combinations provide scrollback functionality if the underlying hardware driver supports it. When audio devices are supported, keys **Mute**, **VolumeUp** and **VolumeDown** tweak mixer settings.

### Keyboard encodings

The following encodings are supported. Device drivers for legacy keyboard interfaces may only support a subset of these. However, generally, all encodings are supported by [pckbd(4)](/pckbd/4.md) and [ukbd(4)](/ukbd/4.md).

| | | |
| --- | --- | --- |
| **wsconsctl** | **define** | **language** |
| user | KB\_USER | User-defined |
| us | KB\_US | English/US keyboard mapping (default) |
| uk | KB\_UK | English/UK keyboard mapping |
| be | KB\_BE | Belgian |
| br | KB\_BR | Brazilian with |
| cf | KB\_CF | Canadian French |
| dk | KB\_DK | Danish with |
| nl | KB\_NL | Dutch |
| ee | KB\_EE | Estonian with |
| fr | KB\_FR | French |
| de | KB\_DE | German QWERTZ with |
| hu | KB\_HU | Hungarian |
| is | KB\_IS | Icelandic with |
| it | KB\_IT | Italian |
| jp | KB\_JP | Japanese |
| la | KB\_LA | Latin American Spanish |
| no | KB\_NO | Norwegian with |
| pl | KB\_PL | Polish |
| pt | KB\_PT | Portuguese |
| ru | KB\_RU | Russian |
| es | KB\_ES | Spanish |
| sv | KB\_SV | Swedish with |
| sf | KB\_SF | Swiss French |
| sg | KB\_SG | Swiss German |
| tr | KB\_TR | Turkish (QWERTY) with |
| ua | KB\_UA | Ukrainian |
| us.declk | KB\_US\|KB\_DECLK | English/US mapping for |
| us.dvorak | KB\_US\|KB\_DVORAK | English/US keyboard with |
| us.colemak | KB\_US\|KB\_COLEMAK | English/US keyboard with |

The “.nodead” suffix (KB\_NODEAD flag) can be applied to layouts with “dead accents” to switch them off.

The KB\_US, KB\_UK, KB\_FR, KB\_JP and KB\_US\|KB\_DVORAK mappings can be modified to swap the left ⟨Ctrl⟩ and the ⟨CapsLock⟩ keys by the KB\_SWAPCTRLCAPS variant bit or the “.swapctrlcaps” suffix.

The “.metaesc” suffix (KB\_METAESC flag) option can be applied to any layout. If set, keys pressed together with the ALT modifier are prefixed by an ESC character. (Standard behaviour is to add 128 to the ASCII value.)

### Ioctls

The following [ioctl(2)](/ioctl/2.md) calls are provided by the **wskbd** driver or by devices which use it. Their definitions are found in ⟨dev/wscons/wsconsio.h⟩.

- WSKBDIO\_GTYPE

  Get the keyboard type.

- WSKBDIO\_GETMODE

  Get the keyboard mode, 0 means translated through keyboard map, 1 means raw.

- WSKBDIO\_SETMODE

  Set the keyboard mode.

- WSKBDIO\_COMPLEXBELL, WSKBDIO\_SETBELL, WSKBDIO\_GETBELL, WSKBDIO\_SETDEFAULTBELL, WSKBDIO\_GETDEFAULTBELL (*struct wskbd\_bell\_data*)

  Get and set keyboard bell settings.

- WSKBDIO\_SETKEYREPEAT, WSKBDIO\_GETKEYREPEAT, WSKBDIO\_SETDEFAULTKEYREPEAT, WSKBDIO\_GETDEFAULTKEYREPEAT (*struct wskbd\_keyrepeat\_data*)

  Get and set keyboard autorepeat settings.

- WSKBDIO\_SETLEDS, WSKBDIO\_GETLEDS (*int*)

  Get and set keyboard LED settings.

- WSKBDIO\_GETMAP, WSKBDIO\_SETMAP (*struct wskbd\_map\_data*)

  Get and set keyboard keymapping settings.

- WSKBDIO\_GETBACKLIGHT, WSKBDIO\_SETBACKLIGHT (*struct wskbd\_backlight*)

  Get and set keyboard backlight

- WSKBDIO\_GETENCODING, WSKBDIO\_SETENCODING (*kbd\_t*)

  Get and set keyboard encoding settings.

## FILES

- */dev/wskbd\**

  - */usr/include/dev/wscons/wsksymdef.h*

  - */usr/include/dev/wscons/wsconsio.h*

  ## SEE ALSO

[akbd(4)](/akbd/4.md), [comkbd(4)](/comkbd/4.md), [hilkbd(4)](/hilkbd/4.md), [intro(4)](/intro/4.md), [pckbd(4)](/pckbd/4.md), [ukbd(4)](/ukbd/4.md), [wscons(4)](/wscons/4.md), [wsmux(4)](/wsmux/4.md), zskbd(4), [wsconsctl(8)](/wsconsctl/8.md)
