I'm writing a macro generator/ keyboard remapper in python, for xubuntu.
I've figured out how to intercept and record keystrokes, and send keystrokes I want to record, but I haven't figured out how to block keystrokes. I need to disable keyboard input to remap a key. For example, if I wanted to send 'a' when I press the 's' key, I can currently record the 'a' keystroke, and set it to playback when I press the 's' key. I cannot, however keep the 's' keystroke from being sent alongside it.
I used the pyxhook module from an open source keyboard-logger for the hooks, and a again, the xtest fake input method from the python x library.
I remember reading somewhere about somebody blocking all keyboard input by redirecting all keystrokes to an invisible window by using tkinter. If somebody could post that method that'd be great.
I need something that will block all keystrokes, but not turn off my keyboard hooks.