I am looking to use boost::asio to read from a 12 digit keypad. I currently can do it without boost, this way:
fd = open ("/dev/input/event0", 0_NONBLOCK);
read (fd, &ev, sizeof ev);
Do you know how I could do this with boost::asio? I am using Linux and c++. This post and this post are useful. I would not use serial port port (io, "/dev/usb/hiddev0") because its not serial, right?
Thank you.
On my system,
event2
represents the mouse, and the following simplereadloop
program works like a charm.Run as root:
Typical output: