Bug 295839 - Keyboard remains in K_RAW mode after being detached from kbdmux
Summary: Keyboard remains in K_RAW mode after being detached from kbdmux
Status: New
Alias: None
Product: Base System
Classification: Unclassified
Component: kern (show other bugs)
Version: 15.1-RELEASE
Hardware: Any Any
: --- Affects Some People
Assignee: freebsd-bugs (Nobody)
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2026-06-04 05:07 UTC by Wesha
Modified: 2026-06-04 05:07 UTC (History)
0 users

See Also:


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description Wesha 2026-06-04 05:07:46 UTC
When a new USB keyboard is connected to the system, kbdmux innediately grabs it and switches into K_RAW mode:

----------------kbdmux.c------------------------
case KBADDKBD: /* add keyboard to the mux */
  [.............]
  mode = K_RAW;
  error = kbdd_ioctl(k->kbd, KDSKBMODE, (caddr_t)&mode);
  [.............] 
------------------------------------------------

However, when the user detaches that keyboard from kbdmux by doing

   kbdcontrol -A hkbd0 < /dev/kbdmux0

kbdmux does not switch that keyboard to "normal" mode; it remains in K_RAW mode and cannot be used normally.

One use case for this is one computer used by 2 people, each with their own keyboard and monitor.
Another is devices that present themselves as HID keyboards, one such example being a barcode scanner.

Desired behavior:
* Option 1: upon detaching the keyboard from kbdmux, it is returned into "normal" mode;
* Option 2: add capability to switch a keyboard into the desired mode to kbdcontrol utility.