I'm working on an application, which I need to run in the background and run a function when a certain combination of buttons is pressed. I kind of understand that this requires a platform-specific API call (WIN32, X11, etc.), but I don't really know how to start. Also, is there a multi-platform way to achieve this? I really need this to work on Windows, Linux, and OSX.
To summarize:
. 2. seems the best option so far. Though it is not longer maintained it currently works with Qt5.
Take a look at https://github.com/kwhat/libuiohook
Its a c library that can easily be integrated with Qt. Allows both global keyboard and mouse events listeners.
or
https://github.com/Skycoder42/QHotkey
This one is a Qt based library and seems to be maintained.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With