Issue
So, I am a Python enthusiast and I want to make a spacebar trecking app (using PyQt). Let's say I want my programm to detect spacebar pressing, play a sound and then deactivate any futher pressings of this key for 30 seconds. My 2 main questions are:
- How do I even catch key event outside the main window? I heard PyQt don't have such features itself, but there is some additional libraties to help it. Sadly, I don't know which one to use, what exactly I need to code and etc.
- Deactivating the spacebar for other programms is also not an easy task I believe. The only thing I know how to do is a 30 seconds timer and that's it.
I think my app should somehow mess with a keyboard as a device or a system itself, but I know absolutely nothing about how Windows handles inputs. So I came here for help. Help me please
PS I haven't been working with PyQt for nearly six months and it doesn't help either.
Solution
You need to use keyboard hook for that, for example keyboard library
Answered By - mugiseyebrows
0 comments:
Post a Comment
Note: Only a member of this blog may post a comment.