문제 설명
xlib를 사용하여 키 누름 이벤트 캡처 (capture key press event using xlib)
F1을 캡처하려고 하는 동안 문제가 있습니다. 캡처할 수 없습니다. 시스템 후크가 내 프로그램보다 먼저 "도움말" 내용을 표시하면서 실행되었기 때문입니다. 누군가 나를 도울 수 있습니까? 시스템 후크 전에 내 후크를 실행하는 방법이 있습니까? Linux에서 Xserver는 후크를 실행할 때 동일한 키 누름 이벤트에서 다음 후크를 실행하지 않습니다. 도움이 될 수 있습니다.
참조 솔루션
방법 1:
There is no “system hook” in X, just programs that started before yours and already grabbed the key (in this case, probably the window manager). If this is just for your use, change the configuration of the other program. If this is a program you're making for others, you'll need to make your keys configurable anyway, since you never know what keys the users have already assigned to other applications to use, and they're more likely to discard your app if you try to force your keybindings on them.