Skip to content

USB HID support#57

Merged
eldruin merged 4 commits into
mainfrom
usb-support
Jun 16, 2025
Merged

USB HID support#57
eldruin merged 4 commits into
mainfrom
usb-support

Conversation

@thejpster

Copy link
Copy Markdown
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.

@eldruin eldruin left a comment

Copy link
Copy Markdown
Member

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
Copy Markdown
Member Author

Yeah, just needs a rebase.

@thejpster

Copy link
Copy Markdown
Member Author

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

@thejpster

Copy link
Copy Markdown
Member Author

Force pushed with fixed formatting

@thejpster thejpster mentioned this pull request Jun 13, 2025
@thejpster

thejpster commented Jun 14, 2025

Copy link
Copy Markdown
Member Author

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

eldruin commented Jun 16, 2025

Copy link
Copy Markdown
Member

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

@thejpster

Copy link
Copy Markdown
Member Author

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

@eldruin eldruin left a comment

Copy link
Copy Markdown
Member

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