moses-palmer / pynput

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

Support `injected` with types #550

Open abrichr opened 1 year ago

abrichr commented 1 year ago

This PR is based off the implementation in https://github.com/moses-palmer/pynput/tree/feature-injected, but contains modifications to support callbacks with type hints, and works on the latest version of MacOS (directly importing CoreFoundation and Quartz produced errors on my machine, and importing their submodules directly was necessary to work around it).

Note that it is untested on Linux, and likely does not work considering the comment here. However, I am submitted this PR in case someone else finds it helpful.

If there are any suggestions for Linux I would be happy to include them here as well!

abrichr commented 5 months ago

The pynput --> oa_pynput changes were required to deploy via pip as a dependency in https://github.com/OpenAdaptAI/OpenAdapt but are not necessary to merge upstream.

TODO: modify PR to merge from feat/inject branch with unnecessary changes reverted