Beefy Boxes and Bandwidth Generously Provided by pair Networks
"be consistent"
 
PerlMonks  

Unbuffered keyboard input?

by rje (Deacon)
on Jan 19, 2002 at 00:31 UTC ( [id://139940]=perlquestion: print w/replies, xml ) Need Help??

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

Log In?
Username:
Password:

What's my password?
Create A New User
Domain Nodelet?
Node Status?
node history
Node Type: perlquestion [id://139940]
Approved by root
help
Chatterbox?
and the web crawler heard nothing...

How do I use this?Last hourOther CB clients
Other Users?
Others making s'mores by the fire in the courtyard of the Monastery: (4)
As of 2024-03-29 02:11 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    No recent polls found