Newsgroups: comp.lang.perl
From: dbc@tc.fluke.COM (Dan Carson)
Subject: Re: raw input (keyboard) in msdos-perl?
Message-Id: <1992Sep28.172209.7928@tc.fluke.COM>
Organization: John Fluke Mfg. Co., Inc., Everett, WA
References: <kebsch.716737968@neurotic>
Date: Mon, 28 Sep 1992 17:22:09 GMT
Lines: 19

In article <kebsch.716737968@neurotic> kebsch@neurotic.sni.de (Waldemar Kebsch) writes:
>
>Hi,
>
>how I can enable raw input (keyboard) in msdos-perl? I wish to get the key,
>when it is pressed and not when the enter-key is pressed.

Looking at Ralf Brown's interrupt list and msdos.c in the perl distribution,
plus some trial and error, I came up with these subroutines:

sub raw { ioctl(STDIN,1,0xd3 | 0x20); }  # Bit 5 is the "raw" bit
sub unraw { ioctl(STDIN,1,0xd3); }       # 0xd3 is a "sane" value

This would be a good item for the FAQ list.

Dan Carson
dbc@tc.fluke.COM
John Fluke Mfg.
Everett, WA


