Path: utzoo!utgpu!water!watmath!clyde!att!osu-cis!tut.cis.ohio-state.edu!husc6!necntc!dandelion!ulowell!hawes
From: hawes@dino.ulowell.edu (Bill Hawes)
Newsgroups: comp.sys.amiga
Subject: Re: Using Software Interrupts for Menu Handling
Message-ID: <1991@dino.ulowell.edu>
Date: 3 Jul 88 21:59:07 GMT
References: <8806212054.AA00815@cory.Berkeley.EDU> <430@draken.nada.kth.se>
Reply-To: hawes@dino.ulowell.edu (Bill Hawes)
Organization: University of Lowell Productivity Center, Lowell MA.
Lines: 19



Sending CMD_FLUSH to the console device directly won't work, as no matter
what was returned, the console handler will simply go back to read more.

If you're not in a position to try closing the console (ie if your program
doesn't really own it), all is not lost.  ConMan supports the ACTION_FLUSH
packet that empties the internal queues to get rid of any random stuff
that may have been typed but not yet returned, and supports a private
ACTION_FORCE packet (code 2001) that will place whatever characters you
send into the read stream, just like they had been typed.  The parameters
are the same for an ACTION_WRITE packet, so just send along a newline
or carriage return and fgets() will get unstuck.

I'm open to suggestions as to whether ACTION_FLSUH should knock any 
waiting read loose, or whether another mechanism is needed to effectively
abort a read operation.

  -Bill Hawes