Thanks to visit codestin.com
Credit goes to github.com

Skip to content

Add HID feature report for extended keyboard attrs#26280

Open
TorstenSchmitz wants to merge 4 commits into
qmk:developfrom
TorstenSchmitz:draft-hutrr42-pr
Open

Add HID feature report for extended keyboard attrs#26280
TorstenSchmitz wants to merge 4 commits into
qmk:developfrom
TorstenSchmitz:draft-hutrr42-pr

Conversation

@TorstenSchmitz

@TorstenSchmitz TorstenSchmitz commented Jun 20, 2026

Copy link
Copy Markdown

HUTTR42c could be what bCountryCode never was.
A way for us to report our layout to the OS.

This exposes a Get_Report(FEATURE) to get these attributes to the OS which specify physical layout (ISO, ANSI, KS, JIS, ABNT) and locale of the printed key set (e.g. "en-US", "de-CH-1996") as specified in ietf bcp47.
This could in theory be used to select appropriate keyboard layouts when plugging in a device.
To my knowledge no OS makes use of this today.

I have not added the input report for Keyboard Assist hotkeys (e.g previous/next suggesition, accept/cancel suggestion).

Description

Adds HID Feature report for USAGE(EXTENDED_KEYBOARD_ATTRIBUTES).
Adds (usually PROGMEM) keyboard_extended_attributes and get_report(FEATURE) handling for

  • lufa
  • V-USB
  • ChibiOS

Todo:

  • Add/cleanup/rename feature gate macros
  • Add configuration macros for the various fields
  • Document the macros/config

Open questions :

  • Should the 6-7 byte struct of the report live in PROGMEM, if so:
    • Is setting usbMsgPtr to a PROGMEM pointer in vusb fine?
    • Can Endpoint_Write_Control_Stream_LE in lufa.c take PROGMEM pointers?
    • Can usbSetupTransfer in chibios take PROGMEM pointers directly making my memcp_P unnecessary?

Future work:

  • Add Consumer Remote Control Report Descriptor for Keyboard Assist Control Hotkeys?

Issues Fixed or Closed by This PR

Types of Changes

  • Core
  • New feature
  • Enhancement/optimization
  • Keyboard (addition or update)
  • Keymap/layout (addition or update)
  • Documentation

Checklist

  • My code follows the code style of this project: C, Python
  • I have read the PR Checklist document and have made the appropriate changes.
  • My change requires a change to the documentation.
  • I have updated the documentation accordingly.
  • I have read the CONTRIBUTING document.
  • I have added tests to cover my changes.
  • I have tested the changes and verified that they work and don't break anything (as well as I can manage).

@github-actions github-actions Bot added the core label Jun 20, 2026
@TorstenSchmitz TorstenSchmitz marked this pull request as draft June 20, 2026 15:03
@zvecr zvecr added the no-ci Signals to the CI runners not to build. label Jun 20, 2026
@drashna

drashna commented Jun 21, 2026

Copy link
Copy Markdown
Member

I do believe that the EVENT_USB_Device_ControlRequest and similar functions are what is called by the respective frameworks, and is the lowest level that QMK can go.

However, the examples you've posted look to be part of the shared/keyboard report, and not lower than that. (but I'm not an expert with the usb and hid control stuff)

As for the reports, these are handled as progmem, in part because they can be rather large, which is not AVR friendly. That would mean mean that it's also compile time only.

Also, do you know if linux, windows and/or macos actually looks for an honors this?

@TorstenSchmitz

TorstenSchmitz commented Jun 21, 2026

Copy link
Copy Markdown
Author

I'll update the PR with the handling of the report once I'm happier with my local changes.

Also, do you know if linux, windows and/or macos actually looks for an honors this?

Linux should (fingers crossed) expose this in the sysfs tree somewhere. Linux doesn't expose it in sysfs today.
I'm looking into a libusb driver that makes use of it though.

Microsoft requested the HUTRR so presumably they want to do something with it eventually, though I would be surprised if they do so today.

@TorstenSchmitz TorstenSchmitz force-pushed the draft-hutrr42-pr branch 5 times, most recently from d48e896 to 11e7b64 Compare June 21, 2026 12:11
@drashna drashna requested a review from a team June 22, 2026 17:04
[HUTTR42c](https://www.usb.org/sites/default/files/hutrr42c_0.pdf)

This could be what bCountryCode never was.
A way for us to report our layout to the OS.
@github-actions github-actions Bot added documentation dd Data Driven Changes labels Jun 26, 2026
@TorstenSchmitz TorstenSchmitz marked this pull request as ready for review June 26, 2026 20:38
@TorstenSchmitz TorstenSchmitz changed the title WIP: Add HID descriptor for extended keyboard attrs Add HID descriptor for extended keyboard attrs Jun 26, 2026
@TorstenSchmitz

Copy link
Copy Markdown
Author

If you'd like tests for this please advice me on where those should go.
I have tested pulling the report with rawhid, but that doesn't guarantee I didn't mess up the HID descriptors.

@TorstenSchmitz TorstenSchmitz changed the title Add HID descriptor for extended keyboard attrs Add HID feature report for extended keyboard attrs Jun 28, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

core dd Data Driven Changes documentation no-ci Signals to the CI runners not to build.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants