home *** CD-ROM | disk | FTP | other *** search
- Path: sparky!uunet!munnari.oz.au!comp.vuw.ac.nz!zl2tnm!toyunix!don
- Newsgroups: comp.os.vms
- Subject: Re: Question: Reading keys with command procedures.
- Message-ID: <3698007@zl2tnm.gen.nz>
- From: don@zl2tnm.gen.nz (Don Stokes)
- Date: 8 Jan 93 14:29:55 GMT
- Sender: news@zl2tnm.gen.nz (GNEWS Version 2.0 news poster.)
- References: <73051@cup.portal.com>
- Distribution: world
- Organization: The Wolery
- Lines: 47
-
- Chris_F_Chiesa@cup.portal.com writes:
- > 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.
-
- For those without VAX BASIC, a calling sequence of:
-
- BAS$INKEY( key by descriptor, 0 by value, 0 by value, 0 by value)
-
- (where key is the destination string for the key) will do the same thing.
- What follows is a MACRO program that will call BAS$INKEY and place the
- result in the symbol GETKEY_KEY.
-
- Note that this fits into the "not supported but will break too much if it
- goes away" category. All bets are off on Alpha. 8-)
-
- .title GETKEY Get key and place in GETKEY_KEY
- .ident "9/1/93/dcs"
-
- $DSCDEF ; Descriptor definitions
-
- key: .word 0 ; Dynamic descriptor to return key in
- .byte DSC$K_DTYPE_T
- .byte DSC$K_CLASS_D
- .long 0
- sym: .ascid "GETKEY_KEY" ; Name of symbol to return key pressed
-
- .entry GETKEY, ^M<>
- pushl #0 ; Four parameters to BAS$INKEY
- pushl #0 ; First parameter is string to return
- pushl #0 ; key pressed in (placed on stack last)
- pushaq key
- calls #4, g^BAS$INKEY
- blbc R0, 99$ ; Abort on error
- pushaq key ; LIB$SET_SYMBOL(sym,key)
- pushaq sym
- calls #1, g^LIB$SET_SYMBOL
- 99$: ret ; Done
-
- .end GETKEY
-
- --
- Don Stokes, ZL2TNM (DS555) don@zl2tnm.gen.nz (home)
- Network Manager, Computing Services Centre don@vuw.ac.nz (work)
- Victoria University of Wellington, New Zealand +64-4-495-5052
-