Why XGrabKey generates extra focus-out and focus-in events?

后端 未结 7 2103
时光说笑
时光说笑 2020-12-14 00:33

Does anyone know an xlib function to trap a keypress event without losing the original focus? How to get rid of it?

(or \"to use XGrabKey() without generating Grab-s

7条回答
  •  一个人的身影
    2020-12-14 01:04

    You could use XQueryKeymap to read the events, then you could use XTestKey to send a backspace key event and then the the key you want to be pressed. Better, you could register hotkeys for all the keyboard events and then generate the key event using XTestKey. BTW, KDE's "Custom Shortcuts" control module allows using shortcuts to generate keypresses. Source code.

提交回复
热议问题