This is the console application that checks keyboard events and prints the button that was pressed/released. It uses only typical unistd library.
To find correct keydoard event-file you can use console commands:
$sudo cat /sys/class/input/input<x>/name
- shows name of device. - numbers of input devices from (e.g. 4 or 6)
sudo cat /dev/input/event<X>
- shows input stream for device (ASCII codes for pressed keyboard button).