🚀 go-pugleaf

RetroBBS NetNews Server

Inspired by RockSolid Light RIP Retro Guy

Article View: comp.sys.amiga.tech
Article #11061

Re: Non-blocking keyboard reads

#11061
From: Markus Schmidt
Date: Thu, 19 Jan 1989 10:20
25 lines
1133 bytes
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?

Create a Port an d IOtwio 
Create a port and two messages for the port. Use one of the
messages for the timer.device, the other for the console.device 
(creating both messages for the one port).

The WaitPort(yourPort) and see what arrived:
msg= GetMsg(yourPort);
if (msg==timerMsg) {
   ... timer stuff ...
}
else
if (msg==consoleMsg) {
   ... keystuff ...
}
else {
   ... curse and wait for another message ...
}

Cu
Markus
Technical Details
Message-ID: <475@infohh.rmi.de>
Path: arc1-ca.pugleaf.net!utzoo!attcan!uunet!mcvax!unido!rmi!infoac!infohh!shimoda
References: <1004@husc6.harvard.edu>

Show Full Headers
Complete Article Headers
Path: arc1-ca.pugleaf.net!utzoo!attcan!uunet!mcvax!unido!rmi!infoac!infohh!shimoda
From: shimoda@infohh.rmi.de (Markus Schmidt)
Newsgroups: comp.sys.amiga.tech
Subject: Re: Non-blocking keyboard reads
Message-ID: <475@infohh.rmi.de>
Date: 19 Jan 89 10:20:44 GMT
References: <1004@husc6.harvard.edu>
Reply-To: shimoda@infohh.rmi.de (Markus Schmidt)
Organization: RMI Net * Aachen/Hamburg/Flensburg * W.Germany
Lines: 25