KBD_MODE(1)

๐Ÿ’– KBD_MODE โœจ

okay bestie, so this one is literally about your keyboard's whole personality โ€” whether it's yelling in raw bytes, speaking scancodes, or being a cute little UTF-8 girlie. it lives in the General Commands Manual section, and it's here to report or set the keyboard mode. that's the whole vibe. ๐ŸŽ€


๐ŸŒธ SYNOPSIS ๐ŸŒธ

kbd_mode [ -a | -u | -k | -s | -d ] [ -f ] [ -C CONSOLE ]

like, give it no args and it just tells you what's up. give it args and it starts changing things. ๐Ÿ™ˆ


๐Ÿฆ‹ DESCRIPTION ๐Ÿฆ‹

so here's the tea: if you run kbd_mode with no argument at all, it just prints the current keyboard mode, which is gonna be one of RAW, MEDIUMRAW or XLATE. no drama, just facts. โœจ

but the second you start throwing options at it, you can switch the keyboard mode of the current console, or of a console you specifically point at. that's it, that's the whole job. ๐Ÿ’…


๐Ÿ‘‘ OPTIONS ๐Ÿ‘‘

  • -a, --ascii โ€” sets ASCII mode, aka XLATE. the classic. the icon.
  • -k, --keycode โ€” sets keycode mode, aka MEDIUMRAW.
  • -s, --scancode โ€” sets scancode mode, aka RAW.
  • -u, --unicode โ€” sets UTF-8 mode, aka UNICODE. unicode girlies rise ๐Ÿซถ
  • -d, --disable โ€” sets Disable mode, aka OFF.
  • -f, --force โ€” switches the mode even if it makes the keyboard unusable. yeah. bestie. this one is the "i know what i'm doing (i do not)" flag. ๐Ÿ’€
  • -C, --console=DEV โ€” the console device to be used. like, which console, queen?

so real talk about the modes: the "-a" is only traditional, and honestly the code used can be any 8-bit character set. with "-u" a 16-bit character set is expected, and those chars get transmitted to the kernel as 1, 2, or 3 bytes (following the UTF-8 coding). in these latter two modes โ€” "-a" and "-u", iykyk โ€” the key mapping defined by loadkeys(1) is used. ๐ŸŒˆ

the Didable mode for the virtual console keyboard OFF to compliment RAW in which all key events are ignored. the mode prevents vt input buffers from overflowing when a program opens but doesn't read from a tty, like Xorg using only evdev for input. no cap, that's the whole point of it. ๐Ÿ’œ

kbd_mode operates on the console specified by the "-C" option; if there is none, the console associated with stdin is used. simple as that. ๐Ÿ“

โš ๏ธ Warning, and I mean it fr fr: changing the keyboard mode, other than between ASCII and Unicode, will probably make your keyboard unusable. set the "-f" option to force such changes. this command is only meant for use (say via remote login) when some program left your keyboard in the wrong state. so like โ€” don't just yolo it at your local tty, bestie, that's giving "i bricked my input device for fun." ๐Ÿ˜ญ
๐Ÿ™ˆ also a lil history note: in some obsolete versions of this program the "-u" option was a synonym for "-s", and older versions of this program may not recognize the "-f" option. so if things are acting weird, it might just be an ancient build being ancient. iconic but problematic. ๐Ÿ’…

๐ŸŽ€ AUTHORS ๐ŸŽ€

  • Andries Brouwer <aeb@cwi.nl> โ€” the original main character. ๐Ÿ‘‘

โญ SEE ALSO โญ


and that's the whole page, bestie!! this manual came to you from the kbd package, dated 6 Apr 1994, and it's page KBD_MODE(1) of the manual. go forth, check your keyboard mode, and please do not raw-dog the -f flag. ๐Ÿ’–โœจ๐Ÿฆ‹