Path: utzoo!attcan!uunet!super!udel!rochester!rutgers!uwvax!astroatc!nicmad!madnix!aaron From: aaron@madnix.UUCP (Aaron Avery) Newsgroups: comp.sys.amiga.tech Subject: Re: Non-blocking keyboard reads Message-ID: <406@madnix.UUCP> Date: 18 Jan 89 11:01:20 GMT References: <1004@husc6.harvard.edu> Reply-To: aaron@madnix.UUCP (Aaron Avery) Organization: ASDG Incorporated Lines: 24 In article <1004@husc6.harvard.edu> wen@husc4.UUCP (A. Wen) writes: >That is, if I am waiting for the timer to wake me up, but I need to be notified >of any keystrokes that may occur in the meantime, is there anything simple >(short of busy-waiting) that I can do? Absolutely. You arrange for the timer message to come into one message port which has its own sigbit, and you arrange for the keyboard message to come in a different port, which has its own different sigbit. There are many ways to arrange for those keyboard messages, too. One would be accessing the console.device directly. Also, you can use the keyboard.device, or intuition's RAWKEY events coming into an IDCMP port. Now, you need to wait for these signals. You want to use the Exec function Wait(). It takes a single argument which is a signal mask, indicating all of the sigbits you want to be awakened for. When Wait() returns, it returns a mask of all signals to which you're responding, by which you can tell why you were awakened. For a better description, please look up Wait() in your nearest Rom Kernel Manual. -- Aaron Avery, ASDG Inc. "A mime is a terrible thing to waste." -- Robin Williams ARPA: madnix!aaron@cs.wisc.edu {uunet|ncoast}!marque! UUCP: {harvard|rutgers|ucbvax}!uwvax!astroatc!nicmad!madnix!aaron