Re: keyboard has a weird layout after boot

Lev Serebryakov <[email protected]> Tue, 14 Jul 2020 17:37:36 +0300
Newsgroups gmane.os.freebsd.devel.hardware,gmane.os.freebsd.devel.usb
Organization FreeBSD
Message-ID <[email protected]>
On 14.07.2020 16:48, László Lajos Jánszky wrote:

>>>>> I have an Obins Anne Pro keyboard, which is a 60% mechanical NKRO
>>>>> keyboard
>>>>> http://en.obins.net/anne-pro It works properly in the UEFI and in the
>>>>> rescue shell when I quit the boot menu, but after FreeBSD booted up
>>>>> and I got the login screen it changes layout to something weird. For example
>>>>> I got "a" when pressing backspace or "w". Most of the keys stop working.
>>>>> anything about it in the manual, so probably this keyboard is NKRO
>>>>> only...
>>>>> Any idea how to make it work with FreeBSD or what causes this problem?

 As far as I know, NKRO USB keyboards could work in two modes: "Legacy" and "Bitmap/NKRO".

 HID (and each USB Keyboard is HID device) is very flexible standard, and it allows several ways to report pressed/released buttons: as event with 8 modifier keys and up to 6 "simple" keys per event, or by transferring bitmap with bit for each button (pretends that all buttons are modifier ones, which allows NKRO).

 "Standard" events could have only 6 different keys reported due to packet size constrains. But this way was historically first and "standard" keyboards work this way to this day.

 "Bitmap" reporting could transmit any state of keyboard with as many pressed keys as there are keys total (NKRO!), but requires additional support from drirver.

 NKRO keyboards start in "Legacy"/"Boot" mode because many BIOSes/EFI can not understand "bitmap" reporting. Conditions to switch to "bitmap" reporting are different for different NKRO keyboards.

 You could read more here: https://www.devever.net/~hl/usbnkro

 Looks like, FreeBSD HID/kbd driver has problem with "bitmap" reporting and this keyboard switch to NKRO mode after boot regardless.

 I've CC: this message to usb@ mailing list, as it looks like USB problem on FreeBSD side, in HID driver.

-- 
// Lev Serebryakov
signature.asc (application/pgp-signature, 963 B)
-----BEGIN PGP SIGNATURE-----

iQKTBAEBCgB9FiEE+W0coLX0MYtnSzMK6rA8WL/cR48FAl8NwzBfFIAAAAAALgAo
aXNzdWVyLWZwckBub3RhdGlvbnMub3BlbnBncC5maWZ0aGhvcnNlbWFuLm5ldEY5
NkQxQ0EwQjVGNDMxOEI2NzRCMzMwQUVBQjAzQzU4QkZEQzQ3OEYACgkQ6rA8WL/c
R49cYRAAy8udW2K8s+wm8jNGf/+tV+l97yan0fnNcgeg1z97JLQM9bM83yWGjpmx
+UHJgs8M75NaHOjplSUApzsjFDT3ZOpMI+fgjnujR96S1d1GUiOC44LK+UlnHY0e
iChHHPI9/D01f5EhHIs7Z2ScPLFJ77omZmhP+PUlFM/bqtTAilIHg/PEVCI9gqA1
pOhvRmorIimLtulPT5iVfngeCuOgQaNvovNsE++Pcfe3qeXubxQ4UzvtaDsRwsRl
Li5lZ8TVQh72TQ7v1yb1D7UL5NGox7RnmAZniICPHl+xWNzjAA9hQ+F4yrYibtk+
sJikjBpHI4qdA1KzIH0IrWEACTSY7YglPvTMignc2Dor2fkuRXaOnbU1k5JYSMH0
0VW6TJsxyGAZKHuzI2f2BuYtoa0b41k7yPYqPCTIIk7BfaN0lgBaQeFmq3py4ruB
zDynWpjh0C6737JRbc2xtjKHz8YepfiuJNFMRpPSiNBSn1Pl9ItJDzIGiebgpQ4c
5ZIMyqmiezQXQZ093ivY8rOq43ZoxHMSXlcTPcpEr8vRiB4nxP0SY30PqSQ5yXJu
BF1ZdKneQsVzzkTDs+/ZyTrz2JehArhPy+UM4We2+LVYvsQR0i6BQZJA1yaUP/iF
bSMmdjp9ys+HG3pN9CYnl2KrDN65W7Xb5LKk0knTekelQQJIqZY=
=nRow
-----END PGP SIGNATURE-----