feat: add pygame keyboard input with intuitive key bindings#397
Open
mrosseel wants to merge 1 commit intobrickbots:mainfrom
Open
feat: add pygame keyboard input with intuitive key bindings#397mrosseel wants to merge 1 commit intobrickbots:mainfrom
mrosseel wants to merge 1 commit intobrickbots:mainfrom
Conversation
When using a pygame display (-fh), capture keyboard events directly in the main event loop instead of relying on PyHotKey/pynput, which cannot access the keyboard on Wayland. Key mapping: - +/= and - for PLUS/MINUS (intuitive, matches the button labels) - Enter/Space/Z for SQUARE (select) - Ctrl+key for ALT_ variants (emulates SQUARE+key on hardware keypad) - Arrow keys, number keys, M for LNG_SQUARE unchanged When pygame display is active with --keyboard local, uses keyboard_none since the main loop handles key capture directly. Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
Collaborator
|
Is that a display keyboard (that shows the keyboard binding in a UI)? I created already some extensive keybindings, see the comment at the top of keyboard_local.py |
Collaborator
Author
hi, no it's not a visualisation, pyhotkey does not work on wayland so I figured a pygame approach to steer the pygame window might be cleaner. I am working on some visualisation though, but that's not something expected to be checked in. |
Collaborator
|
Maybe this fixes my woes with website testing: pyhotkey on Mac delivers keypresses, even if the window is not focused. Hmm, need to look into a null display. |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
--keyboard localflagTest plan
--keyboard local --camera debugand verify all key bindings work🤖 Generated with Claude Code