0

I'm writing a Windows Python application using the Pyside2 Qt5 binding. I want the user to be able to press a combination of hot keys(e.g "j" + "k") regardless of whether or not the Qt application is in focus or not in focus/minimized.

I ideally want to take advantage of signals and slots, so when the specific key combination is emitted I can intercept it via a slot to perform a specific function. I looked into QShortcut, but I can't seem to get the functionality I want when the Qt application is minimized in the backround/out of focus. One workaround I've had some success with is using Pynput, however, I was hoping for a Qt specific solution.

Mrcitrusboots
  • 317
  • 3
  • 14
  • PyQt can only detect the keyboard if the focus is somewhere in the widget, so the solution does not depend on the GUI but on the OS, in the question that marks as duplicate is the answer. – eyllanesc Jul 09 '18 at 08:19
  • This has already been asked many times and the recommendation is always the same. Those tasks are handled by the OS, not the GUI. – eyllanesc Jul 09 '18 at 08:20

0 Answers0