Path: utzoo!utgpu!news-server.csri.toronto.edu!cs.utexas.edu!samsung!think.com!mintaka!bloom-beacon!eru!hagbard!sunic!mcsun!hp4nl!ruuinf!ruunsa!neviatar From: neviatar@ruunsa.fys.ruu.nl (Hadass Eviatar) Newsgroups: comp.os.os9 Subject: single character read Summary: How do you read single keystrokes under OS9 Message-ID: <1728@ruunsa.fys.ruu.nl> Date: 2 Nov 90 10:56:43 GMT Organization: University of Utrecht, Dept. of Physics Lines: 37 Hi netters, Anyone out there who knows how to read a single keystroke under OS9? The manual tells me to do a read (1, &buffer, 1); ^= # of chars ^= input channel but when I call this function, it reads the first keystroke, puts it in the buffer and waits... It waits until the second key is struck, and then the function returns the information on the first keystroke, and puts the second keystroke in the buffer and waits... Of course, I tried other buffer-lengths than 1 (even zero!), but to no avail. What I need is a procedure that waits for a key to be struck (i.e. either an ASCII character or a function-key) and reports this keystroke IMMEDIATELY (i.e. without waiting for the enter/return key to be hit) to the calling program. If anyone knows how, please let me know. Thanks in advance. ==================================================================== Hadass Eviatar, Dept. of Molecular Biophysics, University of Utrecht Physically: Buys Ballot Laboratory, Princetonpl. 5, 3584 CC Utrecht Electronically: neviatar@ruunsa.fys.ruu.nl Acoustically: 030 - 531555/2839/2951 Always yield to temptation - Oscar Wilde. ====================================================================