rje has asked for the wisdom of the Perl Monks concerning the following question:

Fellow perl.monks:

Is there a way to get keystroke input, instead of waiting for eol? I remember Commodore BASIC had the 'get' operation (or whatever it was called) that returned the next keypress. This was useful for text-menu navigation and games.

rje

Replies are listed 'Best First'.
Re: Unbuffered keyboard input?
by thraxil (Prior) on Jan 19, 2002 at 00:39 UTC
Re: Unbuffered keyboard input?
by KILNA (Acolyte) on Jan 19, 2002 at 07:53 UTC
    On a related note, I have an interest in getting waaaaay-raw keyboard input... keydown and keyup events. The jist is, I'd like to make a PC keyboard play as a MIDI instrument by binding keypresses and releases to midi events using the MIDI::Music module. I'm dreading doing something rash like resorting to Win32 API calls, is there some way I can get keydown and keyup messages in Perl on Linux? Is it in Term::Readkey and I'm just missing it in the docs? 'cause Term::Readkey's raw mode still looks like its interpreting it as a terminal ASCII stream and not the raw keyboard events that I really want to get at.
Re: Unbuffered keyboard input?
by Malus (Acolyte) on Jan 19, 2002 at 03:52 UTC
    TermReadKey -2.16 by Jonathan Stowe Released: 2001 Nov 29