KBDCONTROL(1)

πŸ“¦ version 15.1, in freebsd 14.5, freebsd 15.1

✨ KBDCONTROL(1) ✨ β€” the keyboard glow-up manual, bestie edition πŸ’…

okay so picture this: it's kbdcontrol, a General Commands Manual situation, and it's literally the system video console keyboard control/configuration utility πŸŽΉπŸ’– she's the one who handles all your keyboard vibes on the console β€” no cap.


🌸 NAME 🌸

kbdcontrol β€” system video console keyboard control/configuration utility 🫢


πŸŽ€ SYNOPSIS πŸŽ€

kbdcontrol [-dFKix] [-A name] [-a name] [-b duration.pitch | belltype]
           [-r delay.repeat | speed] [-l keymap_file] [-f # string]
           [-k keyboard_device] [-L keymap_file] [-P path]

πŸ’– DESCRIPTION πŸ’–

kbdcontrol is the girl who sets all your keyboard-related options for the syscons(4) or vt(4) console driver and the keyboard drivers β€” key map, keyboard repeat and delay rates, bell characteristics, the whole cute package ✨

Keyboard options can also be set up automatically at system boot time by setting variables in /etc/rc.conf. Peep β€œBoot Time Configuration” down below πŸ‘‡

The following command line options are supported, and yes, we're covering every single one 🧚

  • -A name β€” detaches the keyboard, the one specified by the keyboard device name, from the keyboard multiplexer. when you use this option, the standard input of the kbdcontrol process should be redirected from the keyboard multiplexer keyboard device (if the keyboard multiplexer is not the active keyboard) or /dev/console (if the keyboard multiplexer is the active keyboard and you're not working on the system console). ok? ok 🫢
  • -a name β€” attaches the keyboard, specified by the keyboard device name, to the keyboard multiplexer. when you use this option, the standard input of the kbdcontrol process should be redirected from the keyboard multiplexer keyboard device (if the keyboard multiplexer is not the active keyboard) or /dev/console (if the keyboard multiplexer is the active keyboard and you're not working on the system console). same deal as -A but the attach direction πŸ’…
  • -b duration.pitch | belltype β€” sets the bell duration in milliseconds and pitch in hertz. if a belltype argument is specified, it can be one of normal, which sets sound parameters back to normal values, off, which disables the bell entirely, or visual, which sets the bell to visual mode, i.e. flashes the screen instead. if belltype is preceded by the word quiet., the bell will not be rung when the ringing process is in the background vty. the visual bell, when chosen, applies to all vtys; other bell types can be set individually for each vty. iconique πŸ””βœ¨
  • -r delay.repeat | speed β€” sets keyboard delay (250, 500, 750, 1000) and repeat (34, 38, 42, 46, 50, 55, 59, 63, 68, 76, 84, 92, 100, 110, 118, 126, 136, 152, 168, 184, 200, 220, 236, 252, 272, 304, 336, 368, 400, 440, 472, 504) rates. or, if a speed argument is specified, it can be one of slow (1000.504), fast (250.34) or normal (500.126). yes those are all the numbers, don't @ me ⚑
  • -l keymap_file β€” installs the keyboard map file from keymap_file. you can also load the keyboard map file from a menu-driven command, kbdmap(1). the format of keyboard map files is documented in the kbdmap(5) manual page πŸ—ΊοΈπŸ’–
  • -d β€” dumps the current keyboard map onto stdout. the output may be redirected to a file and can be loaded back to the kernel later by the -l option above. round trip slay πŸ”
  • -f # string β€” sets function key number # to send string. refer to the man page for the keyboard driver (e.g. atkbd(4)) for available function keys and their numbers 🎯
  • -F β€” sets function keys back to the standard definitions. factory reset energy, but just for the function keys πŸ™ˆ
  • -x β€” uses hexadecimal numbers in the keyboard map dump πŸ”’
  • -i β€” prints brief information about the keyboard ℹ️
  • -K β€” disconnects the keyboard from the console. you need to use the -k option below to associate a keyboard with the console again. heads up, this one literally unplugs your keyboard's connection to the console, so don't be dramatic about it πŸ’€
  • -k keyboard_device β€” uses the specified device as the console keyboard. when using this option, the standard input of the kbdcontrol process should be redirected from /dev/console if you're not working on the system console (see the β€œEXAMPLES” section) 🎹
  • -L keymap_file β€” loads the keyboard map file from keymap_file and writes the struct keymap compiled from it to stdout. this option is primarily intended for programmers and is probably of little use under normal circumstances. nerd territory, respectfully πŸ€“
  • -P path β€” searches for the keymap file in path. the -P option may be specified multiple times. stack 'em like little bracelets πŸŽ€

πŸ¦‹ ENVIRONMENT πŸ¦‹

the environment variable KEYMAP_PATH can hold an alternative path to the keyboard map files πŸ’œ


πŸ‘‘ KEYBOARD CONFIGURATION πŸ‘‘

⭐ Boot Time Configuration ⭐

you may set variables in /etc/rc.conf or /etc/rc.conf.local in order to configure the keyboard at boot time. here's the list of relevant variables, bestie:

  • keymap β€” specifies a keyboard map file for the -l option πŸ—ΊοΈ
  • keyrate β€” sets the keyboard repeat rate for the -r option ⚑
  • keychange β€” lists function key strings for the -f option 🎯

see rc.conf(5) for details ✨

🌈 Driver Configuration 🌈

the keyboard device driver may let you change default configuration options, such as the default keyboard map, so that you don't need to set up the options at boot time. see keyboard driver manuals (e.g. atkbd(4), ukbd(4)) for details 🫢


πŸ“ FILES πŸ“

  • /usr/share/syscons/keymaps/* β€” keyboard map files for syscons
  • /usr/share/vt/keymaps/* β€” keyboard map files for vt

πŸ”₯ EXAMPLES πŸ”₯

the following command will load the keyboard map file /usr/share/syscons/keymaps/ru.koi8-r.kbd:

kbdcontrol -l /usr/share/syscons/keymaps/ru.koi8-r.kbd

so long as the keyboard map file resides in /usr/share/syscons/keymaps (if using syscons(4)) or /usr/share/vt/keymaps (if using vt(4)), you may abbreviate the file name as ru.koi8-r. since vt(4) uses Unicode, the corresponding keyboard file names omit the encoding and typically are just a country code, e.g. ru:

kbdcontrol -l ru.koi8-r

the following command will make the function key 10 emit "telnet myhost":

kbdcontrol -f 10 "telnet myhost"

in order to get the visual effect for the bell, but prevent the screen from flashing if the bell is to ring in the background screen, run the following command:

kbdcontrol -b quiet.visual

to change the default console keyboard to another keyboard, for example the first USB keyboard (see ukbd(4)), use the following command:

kbdcontrol -k /dev/ukbd0 < /dev/console

to switch back to the default keyboard, use this command:

kbdcontrol -k /dev/kbd0

to allow using both the second USB keyboard and the first AT keyboard at the same time on console via the kbdmux(4) driver, use the following sequence of commands:

kbdcontrol -K < /dev/console
kbdcontrol -a atkbd0 < /dev/kbdmux0
kbdcontrol -a ukbd1 < /dev/kbdmux0
kbdcontrol -k /dev/kbdmux0 < /dev/console
fr fr copy those exactly, every character matters πŸ’–

🧚 SEE ALSO 🧚

kbdmap(1), vidcontrol(1), atkbd(4), kbdmux(4), keyboard(4), screen(4), syscons(4), ukbd(4), vt(4), kbdmap(5), rc.conf(5) β€” the whole friend group πŸ’…


πŸ’œ AUTHORS πŸ’œ

SΓΈren Schmidt <sos@FreeBSD.org> β€” icon, legend, the moment πŸ‘‘


πŸ’€ BUGS πŸ’€

report when found. that's it, that's the whole policy πŸ™ˆ


and that's the page, bestie!! πŸŽ€ this lil masterpiece lives in the Debian General Commands Manual, dated July 7, 2024. go forth and configure your keyboard, you gorgeous nerd πŸ¦‹πŸ’–βœ¨
πŸ“¦ where this page comes from