moses-palmer / pynput

Sends virtual input commands
GNU Lesser General Public License v3.0
1.74k stars 244 forks source link

Use `KeyCode`s as enum values for `Key` in _base.py #537

Closed Amund211 closed 1 year ago

Amund211 commented 1 year ago

This brings the dummy backend in line with the real backends in terms of the values on the Key enum being KeyCode instances. This would also warrant an update in typeshed (https://github.com/python/typeshed/blob/main/stubs/pynput/pynput/keyboard/_base.pyi) which would fix the incorrect types, as currently mypy says that Key.value is an int, which is not true for the real backends.

moses-palmer commented 1 year ago

Thank you for your contribution, and I apologise for this very long delay!

I merged this into the repository now; it will be included in the next release.