Is there a way to block mouse and key press events to a certain program / window?

Viewed 17

I have an application written in Java, but I am also using the JNI to execute C++ written by myself. I would now like to generate mouse and key press events programmatically. For reasons, events from the "real mouse" interfere with those that are generated. Is there a way to completely block any mouse and key events being sent to that application/window?

The program is running on Ubuntu 20 and hence it uses the X Window system.

Edit: A solution which intercepts mouse/keyboard events on a very low-level and simply ignores them is equally appreciated. I simply don't want them to reach the windows created from Java code.

0 Answers
Related