simple sudoless X11 keylogger
Simple X11 keylogger.
stdout
per key event.sudo
.Given no options, xkbcat
prints only keypresses, one per line. Here's the
output when I type "Hi":
Shift_L
h
i
With key-ups enabled (xkbcat -up
), the format changes to show them:
+Shift_L
+h
-h
-Shift_L
+i
-i
Lines starting +
are key-downs; -
are key-ups.
Just make
.
Don't have X11/extensions/XInput2.h
? Install your distro's libxi-devel
package.
Options you can pass (all optional):
-display <display>
: set target X display (default :0
)-up
: also prepend key-ups (default: don't)-help
: print usage hints and exitThen just use your computer as usual. Interrupt signal (C-c
) to quit.
sudo
.xspy
or logkeys
xkbcat
ts
. These answers featurexkbcat
is running, you can temporarily disable terminal echo withstty -echo && xkbcat
. (stty
is in coreutils.)xinput invoked as xinput --test-xi2 --root
logs everything
input-related; even mouse movements and clicks, and touchpad stuff. Its
output is very comprehensive, but harder to parse.
If you need to log X11 events more generally, various protocol monitoring programs are listed in the X11 debugging guide.
The git-tagged version numbers follow semver.
Error outputs (on stderr) are intended to be read by people. Changes to their wording are not considered breaking changes. Don't parse them programmatically.
ISC.