[comp.os.vms] cbreak

hobbit@AIM.RUTGERS.EDU ("*Hobbit*") (04/24/87)

I seem to remember a message about this a long time back, but don't remember
the details.  I want to do single-character getchar()'s in C, but getchar()
doesn't do genuine 1-char QIOs.  It seems to want char + <ret>.  Can cbreak
mode easily be simulated without replacing the getchar() call with a qio?

_H*
------

iwm@doc.ic.ac.uk (Ian W Moor) (04/30/87)

In article <8704260033.AA24777@ucbvax.Berkeley.EDU> "*Hobbit*" <hobbit@aim.rutgers.edu> writes:
>I want to do single-character getchar()'s in C, but getchar()
>doesn't do genuine 1-char QIOs.  It seems to want char + <ret>.  Can cbreak
>mode easily be simulated without replacing the getchar() call with a qio?

Something that I have used is the Screen manager routines, they are rather
higher level than QIO and are used by VMS curses although VMS curses doesnt
seem to simulate cbreak. If you are not using curses create a virtual keyboard:
unsigned kb;
SMG$CREATE_VIRTUAL_KEYBOARD(&kb);

then use read_keystroke

short key;
SMG$READ_KEYSTROKE(&kb,&key);

key is a short because function and arrow keys are  coded as numbers out of
ascii range. I used this method to add arrow key support for the VMS Rogue
that was posted a while back. Terminal independent  decoding of arrow keys !


-- 
Ian W Moor
  UUCP: seismo!mcvax!ukc!icdoc!iwm
  ARPA: iwm%icdoc@ucl                        
           
 Department of Computing   Whereat a great and far-off voice was heard, saying,
 Imperial College.         Poop-poop-poopy, and it was even so; and the days
 180 Queensgate            of Poopy Panda were long in the land.
 London SW7 Uk.