moses-palmer / pynput

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

make Listener.canonical a staticmethod, this make the call from callabacks easier. #520

Open paolopas opened 1 year ago

paolopas commented 1 year ago

I have added the script tools/keyboard-mixin-test.py as a proof of the concept. Tested with Linux (xorg). But I was unable to run the tests, sorry.

paolopas commented 1 year ago

One last thing I suggest is to uniform the on_activate callback of HotKey to the same protocol of other events callback (i.e. on_press and on_release). That is a return False into an on_activate should stop the listener too (currently a StopException is needed). To achieve this a minor HotKey.press modification should suffice.