XP is just a number | |
PerlMonks |
Re: Capturing Arrow Keys Inputby jakobi (Pilgrim) |
on Sep 30, 2009 at 00:02 UTC ( [id://798218]=note: print w/replies, xml ) | Need Help?? |
Unix side of things: Welcome, you just found a nest of killer-bees in your way:) Very Short Version: There are no arrow keys (sensu key code in terminal windows). Use cat -vet to know what sequence to expect for a key. Moderately Short Version: On a Unix box, check man termcap, terminfo, maybe also stty, tput, setterm, and possibly curses (there are a number of perl modules as well, incl. for curses use; but I think you should stop well before curses unless you really need it). Termcap and terminfo make sense of the TERM variable (often one of xterm or vt100) and translate that to the actual capabilities to expect from the terminal (/pty/tty; if not avoidable: read up on the master/slave side of ptys as well; also raw, cooked, cbreak; the notions of process groups and controlling ttys). This page from the docs of the rxvt-unicode X graphical terminal emulator http://pwet.fr/man/linux/conventions/urxvt might serve to give you some impression of terminal apps and the (historical) esc-codes controllig their use, going back all the way to the use of the earliest typewriters as terminals on mini computers (and most of that cruft is still retained). Which keys to expect: how about cat -vet in a shell window. Note that for X, there was a change, so rxvt (and vt100/screen I think?) tend to use the older style, xterm provides the newer cursor/function key codes
In Section
Seekers of Perl Wisdom
|
|