c++ - X11: how to implement a global hotkey without focusloss -


I have a QT app that holds a key with XGrabKey . If I press the hotkey, then I want to hide and hide my app as well as hide it, if it loses focus it works well with a flaw: XGrabKeyboard which Used by the XGrabKey , the Focus creates these FocusAut events, this means that, if I see the app, I press the hotkey, Focus the event, hide the app and unexpectedly hide the hotkey event get Occurs and shows again.

Can I somehow avoid the x server to generate these focus events?

I do not think so, but you can see the "Mode" field in XFocusChangeEvent. It can be reported, Generic, NotifyWhileGrabbed, NotifyGrab, or NotifyUngrab grabbing keys should produce events in the last two ways, and therefore you can choose to ignore events with these methods, although I'm not sure How do you do with QT?

Comments

Popular posts from this blog

ios - Adding an SKSpriteNode to SKScene from a child SKSpriteNode -

Matlab transpose a table vector -

c# - Textbox not clickable but editable -