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
wsconsctl
manual page man 8 wsconsctlwsconsctl.conf
manual page man 5 wsconsctl- List of keycodes and keysyms found in
/usr/include/dev/wscons/wsksymdef.h
- Manual page for list of keyboard encoding man 4 pckbd