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 the ModifiedKeys handlers and are no longer a special case deep inside hid.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".
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 thehas_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".