Operating System - OpenVMS
cancel
Showing results for 
Search instead for 
Did you mean: 

Small Program To Return Single Keystrokes

 
SOLVED
Go to solution
Highlighted
Robert Atkinson
Respected Contributor

Small Program To Return Single Keystrokes


This is a plea to the programmers out there for a small program to return the ASCII value of a key-press, or to time-out after a given amount of time.

Basically, I want to capture the cursor keys being pressed and feed that into a DCL routine. If this is already achievable in DCL, I'd be interested to know how.

Happy to take any language, as long as it's pre-compiled to OBJ (if necessary), PERL is also fine.

Thanks in advance, Robert.
11 REPLIES 11
Joseph Huber_1
Honored Contributor
Solution

Re: Small Program To Return Single Keystrokes


If nothing else, I have saved 2 programs in my "little utilities" archive at

http://wwwvms.mppmu.mpg.de/~huber/util/main/

Look at getkey.for and taste.for, (and make_*.com, *_table.cld).

If You need Alpha .obj, please reply.
Alpha executables are present in
http://wwwvms.mppmu.mpg.de/util/exe/taste.exe
and getkey.exe.
http://www.mpp.mpg.de/~huber
Robert Atkinson
Respected Contributor

Re: Small Program To Return Single Keystrokes

Superb stuff!!!

Any chance of getting a timeout added to BAS$INKEY?

There are some excellent utilities there - expecially like the read/write mailbox ones. Why don't you submit them to Hunter Goatley or OpenVMS.org?

I'm sure people would find them really useful.

Rob.
Ian Miller.
Honored Contributor

Re: Small Program To Return Single Keystrokes

See http://www.encompasserve.org/~miller/rk.zip

____________________
Purely Personal Opinion
Ian Miller.
Honored Contributor

Re: Small Program To Return Single Keystrokes

I have just uploaded an updated version of RK with allows specification of the symbol name and the timeout value. Its a Q&D program but seems to work.
____________________
Purely Personal Opinion
Robert Atkinson
Respected Contributor

Re: Small Program To Return Single Keystrokes

Ian, that appears to work perfectly.

For completeness, could you capture the "%SYSTEM-F-TIMEOUT, device timeout" and return it in the symbol as "TIMEOUT" instead of the error message?

Sorry guys - I know I'm being a pain here.

Rob.
Joseph Huber_1
Honored Contributor

Re: Small Program To Return Single Keystrokes


>Any chance of getting a timeout added to BAS$INKEY?

I know too little about DEC Baswic implementation and the call standard to implement it. If You have time to read the Basic ref. manual, and have time to play, then try to insert arg 2 or 3 of bas$inkey to see an effect.
And in taste.for it can easily be implemented by combining it with Ian Millers code, just add it in arg 4 of the smg$read_keystroke call. To add it as an option takes a bit more time, maybe this evening ...

>There are some excellent utilities there - >expecially like the read/write mailbox ones. >Why don't you submit them to Hunter Goatley or >OpenVMS.org?

Well finding the time to package it ...
There is a pointer to my dite in the OpenVMS FAQ already ( http://wwwvms.mppmu.mpg.de/vmssig/src/ ), which in turn has a link to my personal stuff.
http://www.mpp.mpg.de/~huber
Ian Miller.
Honored Contributor

Re: Small Program To Return Single Keystrokes

I have updated rk to set the symbol to TIMEOUT.
____________________
Purely Personal Opinion
Ian Miller.
Honored Contributor

Re: Small Program To Return Single Keystrokes

Joseph, would you mind if I added a link to your page to this page
http://www.openvms.org/pages.php?page=OpenSource
____________________
Purely Personal Opinion
Robert Atkinson
Respected Contributor

Re: Small Program To Return Single Keystrokes

Cheers Ian and Joseph - you're both absolute stars.......and I give you whole-hearted permission to go out an have a beer tonight :-)

Rob.