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

# wsconsctl(8)

get or set wscons state

## NAME

**wsconsctl** – get or set wscons state

## SYNOPSIS

**wsconsctl** \[**-an**\]

**wsconsctl** \[**-n**\] \[**-f** *file*\] *name* *...*

**wsconsctl** \[**-n**\] \[**-f** *file*\] *name*=*value* *...*

## DESCRIPTION

The **wsconsctl** command displays or sets various wscons system driver variables. If a list of variables is present on the command line, **wsconsctl** prints the current value of those variables for the specified device.

The options are as follows:

- **-a**

  Print all device variables and their current values. This is the default, if no parameters are given to **wsconsctl**.

- **-f** *file*

  Specify an alternative control device.

- **-n**

  Suppress printing of the variable name in the output.

- *name*=*value*

  Attempt to set the specified variable *name* to *value*. The value can be specified as either an absolute, by using the ‘=’ symbol, or as a relative value, by using the ‘+=’ or ‘-=’ symbols. See the EXAMPLES section for more details.

The **wsconsctl** utility can be used to view and modify aspects of the keyboard, display, and mouse using the standard, machine-independent workstation console device driver [wscons(4)](/wscons/4.md).

The keyboard type can be modified, the keyboard bell's pitch, period, and duration can be modified, the *typematic* value can be changed, and the keyboard encoding can be modified to switch keys, should the user find a keyboard's default layout difficult to use.

Alternatively, the mapping can be modified or an entirely new mapping created for an unsupported keyboard layout. The current mapping can be printed with **wsconsctl** *keyboard.map*. The value for each keycode specifies the keysym that is output when each of *Key*, *Shift* + *Key*, *AltGr* + *Key*, or *Shift* + *AltGr* + *Key* is pressed.

There are also definitions relating to video control and cursor control, which are not applicable to all display types, and to text emulation and graphics (mapped) modes.

Use the [kbd(8)](/kbd/8.md) utility to determine which keyboard encodings are available for your country.

A keyboard encoding can also be specified in */etc/kbdtype*.

## FILES

- */dev/ttyC0*

  display control device

- */dev/wskbd0*

  keyboard control device

- */dev/wsmouse0*

  mouse control device

- */etc/kbdtype*

  default keyboard mapping

- */etc/wsconsctl.conf*

  a list of parameters that get set at system startup time from [rc(8)](/rc/8.md)

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

  keyboard/mouse/display definitions

## EXAMPLES

Set a UK keyboard encoding:

```
# wsconsctl keyboard.encoding=uk
```

Modify the current keyboard encoding so that, when the *Caps* *Lock* key is pressed, the same encoding sequence as *Left* *Control* is sent. For a full list of keysyms, and keycodes, refer to the */usr/include/dev/wscons/wsksymdef.h* file.

```
# wsconsctl keyboard.map+="keysym Caps_Lock = Control_L"
```

Assign the *Right* *Alt* key to be the group modifier (layout is changed while the key is pressed):

```
# wsconsctl keyboard.map+="keycode 184=Mode_switch"
```

Assign the *Right* *Control* key to be the lock for the group modifier. The effect of *Mode\_Lock* and *Mode\_switch* is not mutually exclusive, to be consistent with *Caps* *Lock* and *Shift* behaviour.

```
# wsconsctl keyboard.map+="keycode 157=Mode_Lock"
```

Set a US keyboard encoding, with the *Caps* *Lock* and *Left* *Control* keys swapped. The *.swapctrlcaps* encoding does not work for all national keyboard encodings. For most purposes, the ability to set the value returned by the *Caps* *Lock* key is enough - see the previous example for details.

```
# wsconsctl keyboard.encoding=us.swapctrlcaps
```

Update the keyboard mapping so that the @ symbol is output when the key combination *AltGr* + *L* is pressed as well as a few other tweaks for a German Apple keyboard. Note that the 7 key defines behaviour for all key combinations.

```
# wsconsctl keyboard.map+="keycode 15 = l L at"
```

```
# wsconsctl keyboard.map+="keycode 34 = 5 percent bracketleft"
```

```
# wsconsctl keyboard.map+="keycode 35 = 6 ampersand bracketright"
```

```
# wsconsctl keyboard.map+="keycode 36 = 7 slash bar backslash"
```

```
# wsconsctl keyboard.map+="keycode 37 = 8 parenleft braceleft"
```

```
# wsconsctl keyboard.map+="keycode 38 = 9 parenright braceright"
```

Set the bell pitch to be 1200:

```
# wsconsctl keyboard.bell.pitch=1200
```

Add 200 to the current pitch of the bell:

```
# wsconsctl keyboard.bell.pitch+=200
```

Set the display font to Gallant:

```
# wsconsctl display.font=Gallant
```

## SEE ALSO

[pckbd(4)](/pckbd/4.md), [wscons(4)](/wscons/4.md), [wsconsctl.conf(5)](/wsconsctl.conf/5.md), [kbd(8)](/kbd/8.md), [wsconscfg(8)](/wsconscfg/8.md), [wsfontload(8)](/wsfontload/8.md)

## HISTORY

The **wsconsctl** command first appeared in NetBSD 1.4 and OpenBSD 2.8.
