Xorg/DE always handles some keyboard/mouse input events rather than the currently focused window, which is useful, but I want to make an exception for a particular app (because reasons).

That is, is it possible to either execute or code an app in such a way that it captures and handles all input (while open and focused)?

A black hole for all inputs if you will, no input can escape the window.

E.g. Ctrl+Alt F3 exits the DE and enters a virtual console, I don't want that to happen when I'm running this app, I want the app to handle that input (and do nothing with it), while Xorg/DE knowing nothing about it.

1 Answer 1


X11 supports applications grabbing a key so that particular key always goes to that application. It is also possible to lock focus to a particular window. I would expect wayland to support focus lock but not key grabbing, but I'm not sure.

Having said that, an application can't grab something like Ctrl+Alt F3 because the graphics server itself interprets that before it gets to the application layer. However, both X11 and wayland support changing the keyboard map to disable or remove actions for these special keys.

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .