Relay-Version: version B 2.10 5/3/83; site utzoo.UUCP Posting-Version: version B 2.10.3 alpha 4/15/85; site ucbvax.ARPA Path: utzoo!watmath!clyde!cbosgd!ucbvax!info-vax From: info-vax@ucbvax.ARPA Newsgroups: fa.info-vax Subject: Single character input to a C program Message-ID: <8416@ucbvax.ARPA> Date: Sun, 23-Jun-85 13:54:23 EDT Article-I.D.: ucbvax.8416 Posted: Sun Jun 23 13:54:23 1985 Date-Received: Mon, 24-Jun-85 06:37:13 EDT Sender: daemon@ucbvax.ARPA Organization: University of California at Berkeley Lines: 30 From: John M Sellens Under VMS 4.1, I want to write a C program that can obtain single character input from the keyboard, without any editing, and without waiting for the user to press return. The character should not be echoed on the screen, my program will do all the necessary echoing. I am using the SMG$ routines for screen output. I tried using SMG$ENABLE_UNSOLICITED_INPUT to enable a routine that will be activated each time a key is pressed. I tried to make it reasonably intelligent, but I seemed to have very little luck. One problem that I ran into was that I couldn't convince it to accept an escape character without a following escape sequence (our program uses escape to indicate "undo" or "stop what I'm doing"). I would also like to be able to inquire whather or not a character or characters is waiting (or alternatively, do something like a non-blocking getchar()). There is only a small amount of VMS expertise here a Waterloo, so asking around hasn't been too successful. I will greatly appreciate any help that you can offer me. Thanks! John UUCP: {decvax|utzoo|ihnp4|allegra|clyde}!watmath!jmsellens CSNET: jmsellens%watmath@waterloo.csnet ARPA: jmsellens%watmath%waterloo.csnet@csnet-relay.arpa