I have a very simple app whose task is to launch another subprocess once a user hits the key. However it is a bit complicated as the app must be minimised in the System tray. All works fine unless the app is minimised to the tray icon. The wx.EVT_KEY_DOWN just stops working. As i'm very new to Python and specifically to OOP I suspect I'm doing something wrong. Please advise how this can be fixed.

This is Windows app and there is no need to support the other systems. I tried keyboard listener from Pynput but it creates more problems with the multithreading. I would prefer to avoid using it.

it is natural behavior for all programs in all systems. When you minimise web browser or Excel (etc.) then system doesn't send key/mouse events to this program too. It sends key/mouse events only to active/focused window. If you have two windows on screen then it sends only to active/focused window.
– furasJul 13 at 2:17

some GUI frameworks may have function to register global keys in system (hotkeys) - maybe this will help wxPyWiki RegisterHotKey
– furasJul 13 at 2:22