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.
Here's the beginning of something I wanted to do for a long time: Use pythons typing system to distinguish key types, i.e. use actual classes instead the self-made type system that compares fake key codes against
FIRST_KMK_INTERNAL_KEY
.Also gone: secretly changing the meaning of keys with the
has_modifiers
attribute. Modified keys are now their own class, they work for any key (including for example mouse and media), not just keyboard HID -- a limitation that was never documented in the first place. Shifted keys are handled by theModifiedKeys
handlers and are no longer a special case deep insidehid.py
, which will make resolving issues like #642 easier.Coming soon: getting rid of
key.meta
, aka: "we already use classes for key types, but only sometimes, and we hide it behind a layer of indirection".