in reply to Reading directly from a keyboard device, not simply <STDIN>

There are some techniques in y/n input in a captive interface

Here is something I played with for reading raw mouse. It locks up the X server, but may show a way.

#!/usr/bin/perl use strict; # WARNING: will probably lock up your X-server my $data; my $fd; my $buf; use POSIX; $fd = POSIX::open("/dev/mouse", &POSIX::O_RDONLY) || die ($!); while($data = POSIX::read($fd, $buf, 1)) { print "READ $data Bytes: " . join("", map(sprintf("%x",ord($_)), sp +lit(//, $buf))) . "\n"; }

I'm not really a human, but I play one on earth Remember How Lucky You Are