Capturing Keystrokes in GNU/Linux in C without X11
问题 If I am working in an application and I press key from keyboard, how can I capture that key (or string), including the source application's name, in C, under GNU/LINUX, in userland, without X11 :) Thanks. 回答1: Well, without X11 this problem is way more difficult. For the keystroke part you can use a code similar to this one, but you have to pass as an argument the device that you are reading (keyboard, usually /dev/input/event0 ) #include <linux/input.h> #include <sys/types.h> #include <sys