in reply to perl keylogger on linux
Term::ReadKey, Term::ReadLine, and Term::VT102 on CPAN will be a help. You can roll your own with getc and print statements if you want.
I recommend reading up on terminal emulation and stty.
xterm windows are just a /dev/pty* file that can be read and written. Type tty at a prompt. It will tell you the terminal.
Read perlfaq8.
In Section
Seekers of Perl Wisdom