Configure console keyboard in Openbsd

Example of basic wsconsctl command.

# List out keyboard mapping
wsconsctl keyboard.map

# Display out keyboard encoding
wsconsctl keyboard.encoding

# Set us-encoding with Alt key to send Escape (required for tmux)
# Other mappings can be found in 
wsconsctl keyboard.encoding=us.metaesc

# Extend the keyboard mapping
# Swap Caps_Lock <=> Escape
wsconsctl keyboard.map+="keysym Escape = Caps_Lock keysym Escape = Caps_Lock"

To make it permanent, add it in the /etc/wsconsctl.conf.

Reference