X11 stop windows/supper key event from reaching the OS

261 views Asked by At

I am making a program that locks my computer by creating a full-screen window and disabling all ways to unfocus the window. For that I need to programmatically disable/enable the Windows key:

enter image description here

Is there a way to catch and stop the windows key event from being passed on to the OS (Ubuntu 21.10) using libX11? From what I understand I am supposed to use XGrabKey but it only blocks Alt-Tab:

XGrabKey(display, ANY_KEY, ANY_MODIFIER, window, False, GRAB_MODE_SYNC,
         GRAB_MODE_SYNC)

Also I don't want to disable the whole keyboard.

0

There are 0 answers