home *** CD-ROM | disk | FTP | other *** search
- Path: sparky!uunet!portal!cup.portal.com!Chris_F_Chiesa
- From: Chris_F_Chiesa@cup.portal.com
- Newsgroups: comp.os.vms
- Subject: Re: Question: Reading keys with command procedures.
- Message-ID: <73051@cup.portal.com>
- Date: Wed, 6 Jan 93 18:27:19 PST
- Organization: The Portal System (TM)
- Distribution: world
- References: <930104121153.48acb@JEFLIN.TJU.EDU>
- Lines: 30
-
- David Gitlin (dgitlin@jeflin.tju.edu) writes:
-
- >Is there any way to get a command
- >procedure to read a single key stroke without the user having to hit
- >enter/return. This would be useful under several conditions. Also can you read
- >arrow keys under DCL command procedures. [...]
- >
- >(P.S. I know you can do this easily via any programing language like Macro,
- >C, etc I want to know if it can be done strictly from DCL command procedures.)
-
- Strictly speaking, NO. There's no native "get a raw keystroke" verb in
- DCL.
-
- It's easy to implement your own, though -- as you have already noted, it's
- easy to "get a keystroke" in any compilable language, and it's also easy to
- assign the obtained keystroke (I recommend VAX BASIC if you have it, because
- its INKEY$ function implicitly parses the function keys for you and returns
- strings such as "UP" for the up-arrow, "DOWN" for the down-arrow, etc. (as
- distinguished from you typing D,O,W,N, which would generate a "D" the first
- time you called INKEY$, an "O" the second time, etc., e.g.) to a DCL symbol.
-
- (I've implemented a GETKEY verb any number of times; hasn't everybody?
- :-) I even went to the extreme of implementing a system of menus with a
- keystroke-controlled, SMG$-style highlight cursor, in DCL with a homegrown
- GETKEY verb - but I don't recommend it, as it was too slow-responding to be
- practical... And before anyone asks, no, I no longer have this code. I'd
- hand it out if I had it, but I don't.)
-
- Chris Chiesa
- Chris_F_Chiesa@cup.portal.com
-