The problem is that my script works well with all the GUI applications I've tested except for (ironically) my preferred text editor, xfwrite. It seems that xfwrite is somehow immune to the keylogger.
To reproduce the issue, open up a terminal emulator then:
$ sudo apt install xinput xfe
$ xinput test <your_keyboard_id> # mine is 9
Leave the terminal emulator open then launch a different application (e.g., web browser) and type something; you'll notice that xinput test detects your keystrokes. Now launch xfwrite and type something; you'll notice that xinput test does not seem to detect any keystrokes and produces no ouput.
I tried recompiling libfox and libfox-dev with the --with-xinput flag to configure then recompiling xfe, but it made no difference. UNIX wizards who frequent this forum: Any idea what needs to be done so that xinput test can detect keystrokes while typing in xfwrite?
]]>