Bug 268129 - Add USB quirk for Keychron Q3 keyboard
Summary: Add USB quirk for Keychron Q3 keyboard
Status: Open
Alias: None
Product: Base System
Classification: Unclassified
Component: usb (show other bugs)
Version: CURRENT
Hardware: Any Any
: --- Affects Some People
Assignee: freebsd-usb (Nobody)
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2022-12-02 16:07 UTC by David Pedersen
Modified: 2024-01-19 16:02 UTC (History)
4 users (show)

See Also:


Attachments
Patch (1.86 KB, patch)
2022-12-02 16:07 UTC, David Pedersen
no flags Details | Diff
hid-recorder 1 (1.34 KB, text/plain)
2023-02-05 20:52 UTC, David Pedersen
no flags Details
hid-recorder 2 (34.98 KB, text/plain)
2023-02-05 20:53 UTC, David Pedersen
no flags Details

Note You need to log in before you can comment on or make changes to this bug.
Description David Pedersen 2022-12-02 16:07:51 UTC
Created attachment 238492 [details]
Patch

This patch will make the Keychron Q3 keyboard function on FreeBSD. Without the patch, FreeBSD detects the device but nothing registers when pressing the keys.

usbconfig -u 0 -a 4 dump_device_desc

ugen0.4: <Keychron Keychron Q3> at usbus0, cfg=0 md=HOST spd=FULL (12Mbps) pwr=ON (500mA)
  bLength = 0x0012
  bDescriptorType = 0x0001
  bcdUSB = 0x0200
  bDeviceClass = 0x0000  <Probed by interface class>
  bDeviceSubClass = 0x0000
  bDeviceProtocol = 0x0000
  bMaxPacketSize0 = 0x0040
  idVendor = 0x3434
  idProduct = 0x0120
  bcdDevice = 0x0103
  iManufacturer = 0x0001  <Keychron>
  iProduct = 0x0002  <Keychron Q3>
  iSerialNumber = 0x0000  <no string>
  bNumConfigurations = 0x0001
Comment 1 Hans Petter Selasky freebsd_committer freebsd_triage 2022-12-02 23:11:31 UTC
Patch looks good. Adding wulf@ aswell.
Comment 2 Graham Perrin freebsd_committer freebsd_triage 2022-12-04 16:12:40 UTC
Triage: [patch] is amongst the summary line tags that are deprecated.
Comment 3 Vladimir Kondratyev freebsd_committer freebsd_triage 2022-12-06 22:41:22 UTC
(In reply to Hans Petter Selasky from comment #1)

We may try to add support for report (native) protocol of the keyboard.

Please take USB HID report descriptor and report data.

To do that, add to /boot/loader.conf:

hw.usb.usbhid.enable=1
usbhid_load="YES"
hidraw_load="YES"

Than reboot and run hid-recorder utility from sysutils/hid-tools port against your keyboard. Both decrypted HID report descriptor (large dump at beginning) and decrypted reaction on key presses is interesting.
Comment 4 David Pedersen 2023-02-05 20:52:48 UTC
Created attachment 239930 [details]
hid-recorder 1
Comment 5 David Pedersen 2023-02-05 20:53:05 UTC
Created attachment 239931 [details]
hid-recorder 2
Comment 6 David Pedersen 2023-02-05 20:55:20 UTC
I've attached hid-recorder outputs for the keyboard. There were two different devices in the list, so I did one log for each.
Comment 7 Mark Linimon freebsd_committer freebsd_triage 2024-01-19 16:02:32 UTC
^Triage: PR does not appear to be "In Progress".

A quick look shows that it is probably still valid, however.