xscast is a tool for creating mini-screencasts of a terminal or other window. It displays a bar on top of the terminal (with dzen2) that shows keys as you press them, and it outputs an animated GIF.
ffmpeg convert xwininfo xinput dzen2.
Available on the AUR as
./xscast.sh out.gif (for more information, see
xscast -h or