I looked into how I could achieve something similar and I found that on Windows I can set up low level hooks for mouse and keyboard events.
Inside my hook handler function I have the choice to send the event to the
https://solitaire.onl/next hook or just "swallow" it. If I swallow an event wit
https://9apps.ooo/ h my application, other applications will essentially not register the event.
I tried looking for something similar on Linux, but so far the only way I found was to call xmodmap.
My question is: Is there any API that would let an application from userspace hook into the keyboard and mouse input events, then have the possibility to "swallow" that event so that other applications would not see it?