KBD(4)

✨ KBD(4) ✨ β€” the keyboard input driver, bestie edition πŸ’…

okay so. this is a kernel interfaces manual page, and the manual it lives in is section 4 β€” yes, KBD(4), we're in the kernel interfaces chapter, come on in 🫢


🌸 NAME 🌸

kbd β€” Keyboard input driver. that's it. that's the whole name. slay.


πŸŽ€ SYNOPSIS πŸŽ€

Section "InputDevice"
  Identifier "idevname"
  Driver "kbd"
  ...
EndSection

look at her. so simple. so iconic. πŸ‘‘


πŸ¦‹ DESCRIPTION πŸ¦‹

so kbd is an Xorg input driver for keyboards β€” like, it's the thing that makes your keyboard actually talk to Xorg. she speaks the standard OS-provided keyboard interface, no cap.

but here's the tea β˜•: right now those interfaces are only available to this driver module on Linux, BSD, and Solaris. that's the vibe check. everywhere else, no keyboard for her, sorry bestie 😭

this driver is literally the replacement for the built-in keyboard driver that used to be baked into Xorg. glow-up fr fr ✨

and functionally? kbd serves as a keyboard input device. main character energy, no notes.


πŸ’– CONFIGURATION DETAILS πŸ’–

okay so depending on which X server version you're running, you can set your input device options in one of these places:

  • a xorg.conf file
  • an xorg.conf.d snippet
  • or the configuration files that get read by the Hardware Abstraction Layer (HAL) daemon, aka hald(1)

please go read xorg.conf(5) for the general config lore and for all the options that work with every input driver. this section right here? she only covers the stuff that's specific to this driver. periodt.

the following driver Options are supported, and yes, we're going through every single one πŸ’…

  • Option "Device" "string" β€” specify the keyboard device. Default: the OS's default console keyboard input source. Property: "Device Node" (read-only β€” so don't even think about writing to it).
  • Option "Protocol" "string" β€” specify the keyboard protocol. the valid protocol types include:
Standard, Xqueue.
heads up bestie: not all protocols are supported on all platforms. it's giving "read the room, check your platform." Default: "Standard".
  • Option "XLeds" "ledlist" β€” makes the keyboard LEDs listed in ledlist available for client use instead of doing their traditional job (Scroll Lock, Caps Lock, and Num Lock). the numbers in that list live in the range 1 to 3. Default: empty list.
  • Option "XkbRules" "rules" β€” specifies which XKB rules file to use when interpreting the XkbModel, XkbLayout, XkbVariant, and XkbOptions settings. Default: "base" for most platforms. and ooh β€” if you're using the "base" value, you can find a listing of all valid values for those four options in the /usr/share/X11/xkb/rules/base.lst file. go look, it's right there πŸ“
  • Option "XkbModel" "modelname" β€” specifies the XKB keyboard model name. Default: "pc105" for most platforms.
  • Option "XkbLayout" "layoutname" β€” specifies the XKB keyboard layout name. this is usually the country or language type of the keyboard. Default: "us" for most platforms.
  • Option "XkbVariant" "variants" β€” specifies the XKB keyboard variant components. these can be used to enhance the keyboard layout details. Default: not set.
  • Option "XkbOptions" "options" β€” specifies the XKB keyboard option components. these can be used to enhance the keyboard behaviour. Default: not set.

and for a list of available XKB options, go see xkeyboard-config(7). ✨


🌈 EXAMPLE 🌈

the following xorg.conf fragment ensures that user will be able to switch between us and sk layouts by pressing the "menu" key. the scroll lock LED shows which layout is currently active. honestly? iconic. obsessed. πŸ”₯

the XkbVariant option defines which variants of the two layouts should be used. in the case of the us layout, its default variant is used. in the case of the sk layout, its qwerty variant is used. iykyk.

Section "InputDevice"
    Identifier   "Generic Keyboard"
    Driver       "kbd"
    Option       "CoreKeyboard"
    Option       "XkbRules"      "base"
    Option       "XkbModel"      "pc105"
    Option       "XkbLayout"     "us,sk"
    Option       "XkbVariant"    ",qwerty"
    Option       "XkbOptions"    "grp:menu_toggle,grp_led:scroll"
EndSection

πŸ‘‘ SEE ALSO πŸ‘‘


and that's the page, bestie!! 🫢 this one's from X Version 11, it's xf86-input-keyboard 1.9.0, and yeah she's filed under KBD(4) πŸ’œ go forth and keyboard, you absolute legend 🌟