Closed Pandaft closed 2 months ago
Thank you for your report.
If your expectation is that pressing the hotkey combination and additional keys should not trigger the hotkey, I think that I will have to update the documentation. More specifically the description of the GlobalHotKeys
class should explain that it is a convenience class built on top of a key listener, so it only has access to the keyboard events that arrive serially and gradually build its internal state; it does not have access to the keyboard state.
As a side note, please be aware that many keyboards are only able to distinguish three pressed key simultaneously, so separating ctrl+alt+h and ctrl+shift+alt+h may not be possible.
Thank you for your patient reply.
I think this is beyond my abilities, and I cannot achieve it on my own. Fortunately, I tried another library called 'keyboard' that meets my requirements. At the moment, I neither need to control the mouse nor the keyboard; I only need to monitor the keyboard, making the 'keyboard' library more suitable for my needs.
However, I still appreciate your help very much.
Description Additional keys can still trigger events.
Platform and pynput version
To Reproduce The code comes from: https://pynput.readthedocs.io/en/latest/keyboard.html#global-hotkeys
The expected result is that only pressing
Ctrl+Alt+h
will trigger it, but actually pressingCtrl+Shift+Alt+h
will also trigger it.