USB Keyboard not working properly (10.2)

ajohnl

New Member


Messages: 13

I'm interested in using FreeBSD on my desktop, but the keyboard might be a problem. During installation I thought the keyboard wasn't detected at all but after some testing through virtual machines and connecting the keyboard to a FreeBSD laptop, I've found out that 95% of the keys don't do anything, and the ones that do input wrong keys (w=a, r=3, etc).


The keyboard works perfectly on the latest Linux kernels (however, older distros wouldn't make use of the caps lock and num lock lights), and right now I'm on Funtoo Linux, with kernel version 4.5. The keyboard is a "keep out f85", but registers as "Holtec USB gaming keyboard".

Thanks in advance.
 

wblock@

Beastie Himself
Developer

Reaction score: 3,726
Messages: 13,851

Use usbconfig(8) to determine the device number of the keyboard, ugenX.Y.

Then add a quirk for that device:
usbconfig -d ugen[I]0[/I].[I]3[/I] add_quirk UQ_KBD_BOOTPROTO

Adapted from the quirk for a Corsair gaming keyboard in PR 193279. If it works, it can be added permanently.
 
OP
ajohnl

ajohnl

New Member


Messages: 13

Use usbconfig(8) to determine the device number of the keyboard, ugenX.Y.

Then add a quirk for that device:
usbconfig -d ugen[I]0[/I].[I]3[/I] add_quirk UQ_KBD_BOOTPROTO

Adapted from the quirk for a Corsair gaming keyboard in PR 193279. If it works, it can be added permanently.

Ok, I tested it in a virtual machine and input the command with my phone over ssh, after unplugging the keyboard and plugging it back in it works perfectly. Now, how would I go about adding this permanently? To install it on my desktop I'll see if I can borrow a keyboard, but I wouldn't want to borrow it every time I boot :p

Thanks
 

wblock@

Beastie Himself
Developer

Reaction score: 3,726
Messages: 13,851

Please show the output of usbconfig -d ugen[I]0[/I].[I]3[/I] dump_device_desc.

Short-term, the quirk can be set in /boot/loader.conf. Longer-term, it can be added to the operating system.
 

wblock@

Beastie Himself
Developer

Reaction score: 3,726
Messages: 13,851

This line is the equivalent when placed in /boot/loader.conf:
Code:
hw.usb.quirk.0="0x04d9 0xa030 0 0xffff UQ_KBD_BOOTPROTO"

Test that. If it works, please enter a new bug report with that information, just like PR 193279, and please add me to the Cc list on that bug.
 
OP
ajohnl

ajohnl

New Member


Messages: 13

This line is the equivalent when placed in /boot/loader.conf:
Code:
hw.usb.quirk.0="0x04d9 0xa030 0 0xffff UQ_KBD_BOOTPROTO"

Test that. If it works, please enter a new bug report with that information, just like PR 193279, and please add me to the Cc list on that bug.

The problem still persists even with the the loader.conf modification, I have loader.rc set to use loader.conf (as the man page for loader.conf() said). The loader.conf is basically an empty file with the line you told me to use, not sure if it's supposed to look like that.

Also, I've been looking into the corsair solution, they mention something about editing these files:
/sys/dev/usb/quirk/usb_quirk.c
/sys/dev/usb/usbdevs

But I don't really understand how, I tried adding
Code:
USB_QUIRK(HOLTEK, F85, 0x0000, 0xffff, UQ_KBD_BOOTPROTO),
to the former, and
Code:
product HOLTEK F85     0xa030 Holtek keyboard
to the latter without success.

Lastly, not sure if it's relevant but on boot the keyboard is detected as "HOLTEK USB GAMING KEYBOARD", and it makes me wonder if it has "product" and "vendor" set somewhere else than the files I mentioned.
 

Phishfry

Beastie's Twin

Reaction score: 2,574
Messages: 5,459

Yes. I usually backup the original source file (usbdev ect...) before editing..
 

wblock@

Beastie Himself
Developer

Reaction score: 3,726
Messages: 13,851

The problem still persists even with the the loader.conf modification, I have loader.rc set to use loader.conf (as the man page for loader.conf() said).
There is no reason to modify or touch loader.rc for this. If you changed that file, please restore it.

I would find out what the problem is with the dynamic setting before modifying the source.
 
OP
ajohnl

ajohnl

New Member


Messages: 13

Yes. I usually backup the original source file (usbdev ect...) before editing..

Tested it in a virtual machine and it works perfectly now :)
Also, FreeBSD kernel configuration is a lot less tedious than in Gentoo, I'm very interested in using it, since after Gentoo I'm in love with building from source and while Gentoo gives me that it feels like it's more native to the BSDs.
 
OP
ajohnl

ajohnl

New Member


Messages: 13

There is no reason to modify or touch loader.rc for this. If you changed that file, please restore it.

I would find out what the problem is with the dynamic setting before modifying the source.

Anyways, thanks for excellent support. And should I still file a bug report? I've never done one before...
 

wblock@

Beastie Himself
Developer

Reaction score: 3,726
Messages: 13,851

Yes, definitely file a bug report. Not only will this help others with similar keyboards, it will help you when you install FreeBSD on some new system.

Go to https://bugs.freebsd.org/bugzilla/enter_bug.cgi?product=Base System. Set Component to USB. Use Add support for Holtec/Keep Out F85 USB gaming keyboard for a summary, and describe the problem in the Description.

The usb_quirk(4) man page has very few examples, so I'm going to add this as a real-life useful one.
 

ethoms

Active Member

Reaction score: 17
Messages: 118

This line is the equivalent when placed in /boot/loader.conf:
Code:
hw.usb.quirk.0="0x04d9 0xa030 0 0xffff UQ_KBD_BOOTPROTO"

Test that. If it works, please enter a new bug report with that information, just like PR 193279, and please add me to the Cc list on that bug.

Thanks for this, it fixed my Velocifire TKL02WS wireless keyboard when using a USB-C cable into a USB 2.0 slot on my laptop. I was not getting any modifier keys working (Shift, Alt), so no capital letters without using CapsLock.

For the sake of others, this is the line in my /boot/loader.conf for this model of keyboard:

Code:
hw.usb.quirk.0="0x062a 0x8503 0 0xffff UQ_KBD_BOOTPROTO"


I will try to remember to make a bug report as described above when I get time.
 
Top