Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix maximum keycode in keyboard HID descriptor #2764

Merged
merged 1 commit into from
Apr 11, 2020

Conversation

larsks
Copy link

@larsks larsks commented Apr 11, 2020

The HID descriptor reported by circuitpython erroneously limited the
maximum keycode to 101, which prevented circuitpython from sending a
number of otherwise valid keycodes.

I've tested this change on my Gemma M0 and it works as expected.

Closes #2761

@larsks
Copy link
Author

larsks commented Apr 11, 2020

Prior to this change, the report descriptor (decoded using hidrd-convert -o xml) included:

<usage_maximum>keyboard_kb_application<!-- Keyboard Application (65h, selector) --></usage_maximum>

After this change, it includes:

<usage_maximum>keyboard_kp_hexadecimal<!-- Keypad Hexadecimal (DDh, selector) --></usage_maximum>

Copy link
Collaborator

@dhalbert dhalbert left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks, you beat me to it. I was going to look at setting a country code, too (which is not done in this descriptor), because on the Mac the keyboard shows up as "unknown" the first few times. I may add a commit for that before merging.

tools/hid_report_descriptors.py Outdated Show resolved Hide resolved
@dhalbert dhalbert self-requested a review April 11, 2020 14:00
Copy link
Collaborator

@dhalbert dhalbert left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

oops, need to fix comments first

The HID descriptor reported by circuitpython erroneously limited the
maximum keycode to 101, which prevented circuitpython from sending a
number of otherwise valid keycodes.

Closes micropython#274
@larsks
Copy link
Author

larsks commented Apr 11, 2020

Oops! I have corrected the comments.

Copy link
Collaborator

@dhalbert dhalbert left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

OK, thanks! Never mind about "unidentified keyboard": it's not the country code. I checked some commercial keyboards.

@dhalbert dhalbert merged commit 76f3aa4 into adafruit:master Apr 11, 2020
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Keyboard HID descriptor has too low a maximum
2 participants