Strange. For Me it works like this: (pressed a, b, c, then ctrl-c)
Code: Select all
$> xinput test 10 | awk '{print $3}' | cat
abc^C
and this:
Code: Select all
$> xinput test 10 | awk '{print $1}' | cat
abc^C
It looks like
xinput is printing directly to terminal somehow, not to stdout ->
awk gets nothing, and so nothing is passed to
cat
The
echo is printing to stdout, so the first pipe works as expected.
As you can see, on my system xinput is printing the letters, not keycodes. (Debian10 amd64, xfce-terminal)
So the question is: what system You're using and which terminal emulator? Do You use standard xorg config?