Skip to content

USB HID support #57

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

Merged
merged 4 commits into from
Jun 16, 2025
Merged

USB HID support #57

merged 4 commits into from
Jun 16, 2025

Conversation

thejpster
Copy link
Member

Adds a USB Keyboard type which can handle USB HID frames from a Keyboard in Boot Mode.

Builds on #52 so merge that first.

Copy link
Member

@eldruin eldruin left a comment

Choose a reason for hiding this comment

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

Thank you! Could you have a look at the conflicts?

@thejpster
Copy link
Member Author

Yeah, just needs a rebase.

@thejpster
Copy link
Member Author

Added a test case using reports captured from my actual keyboard - works as expected. Also added a CHANGELOG entry.

@thejpster
Copy link
Member Author

Force pushed with fixed formatting

@thejpster thejpster mentioned this pull request Jun 13, 2025
@thejpster
Copy link
Member Author

thejpster commented Jun 14, 2025

It appears USB HID keyboards don't send repeated reports when a key is held down - unlike PS/2 keyboards. Therefore we'll need some way of submitting a 'blank' report, which causes every key currently pressed to get emitted again. But you'll want to time that right because if the timer fires immediately after a key is pressed, you'll get a double character that you don't want. Maybe we'll end up needing a HashMap of (Keycode, TimeSincePressed).

Or just not worry about it. On a modern macOS machine, it doesn't even do repeated characters when a key is held - it pops up an accented character picker instead.

@eldruin
Copy link
Member

eldruin commented Jun 16, 2025

Interesting. Do you want to do more changes about that here or should this be merged as-is?

@thejpster
Copy link
Member Author

Oh this is fine as-is. Typematic repeats can be a separate thing.

Copy link
Member

@eldruin eldruin left a comment

Choose a reason for hiding this comment

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

Thank you!

@eldruin eldruin merged commit 6d03cf7 into main Jun 16, 2025
8 checks passed
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.

2 participants