detect keyboard input without reading it?
From: Scott Shaw (sshaw_at_twmi.rr.com)
Date: 11/09/03
- Previous message: Laszlo: "DBI error"
- Next in thread: J. Romano: "Re: detect keyboard input without reading it?"
- Reply: J. Romano: "Re: detect keyboard input without reading it?"
- Messages sorted by: [ date ] [ thread ] [ subject ] [ author ]
Date: Sun, 09 Nov 2003 17:29:31 GMT
Hi all,
I was wondering if you could help out with this problem that I am having.
What I am trying to do is detect keyboard input in a while loop without
halting/pausing the loop until the key is pressed (without hitting return).
I looked at serveral faq's on the net and installed the cspan readkey module
and neither seems to work most likey its me since I am getting frustrated.
but anyway here's a sample code.
while (1) {
if (keypress) {
print "you've pressed: $key\n";
}
else {
print"Continuing to loop...\n";
sleep 1; # delay the loop incase you need to control-c out.
}
}
TIA!
Scott Shaw
sshaw@twmi.rr.com
- Previous message: Laszlo: "DBI error"
- Next in thread: J. Romano: "Re: detect keyboard input without reading it?"
- Reply: J. Romano: "Re: detect keyboard input without reading it?"
- Messages sorted by: [ date ] [ thread ] [ subject ] [ author ]
Relevant Pages
|
|