NetBSD-Bugs archive

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index][Old Index]

Re: kern/60918: Keyboard modifier keys are not checked correctly when sent simultaneously



The following reply was made to PR kern/60918; it has been noted by GNATS.

From: mlelstv%serpens.de@localhost (Michael van Elst)
To: gnats-bugs%netbsd.org@localhost
Cc: 
Subject: Re: kern/60918: Keyboard modifier keys are not checked correctly when sent simultaneously
Date: Fri, 23 Oct 2026 06:50:12 -0000 (UTC)

 gnats-admin%NetBSD.org@localhost ("phil%hagelb.org@localhost via gnats") writes:
 
 >When a keyboard sends a shift key pressed in one USB frame followed by an A keypress in another frame, it correctly detects that the shift key is pressed, resulting in "A".
 
 >But when a keyboard sends a shift *and* an A keypress in the same frame, the A is checked first, resulting in a lowercase "a".
 
 
 The ukbd driver needs to keep track of the key status (== key is held)
 that is transmitted via USB HID reports. It then generates events for keys
 that are being pressed or released for wskbd.
 
 When you see a modifier and a regular key pressed at the same time,
 you get the regular key press first, because it has a lower keycode
 than the modifier.
 
 This needs to be handled differently so that modifier events are
 passed first to wskbd.
 
 
 We have a second decoder for USB HID reports that handles key status
 for "Dynamic Variable" (used by modifiers) values separate from
 "Selectors" (used by regular keys) and transmits the DV events first.
 
 I'm not sure if that is the correct behaviour, but it solves the
 problem.
 
 Another possibility is to generate events for the modifier keycodes
 224..231 first, or by simply scanning the keycodes in reverse order.
 
 



Home | Main Index | Thread Index | Old Index