From: Sam S. <sd...@gn...> - 2002-12-15 20:39:54
|
> > * In message <103...@wo...> > > * On the subject of "Re: [clisp-list] ext:with-keyboard / ext:*keyboard-input* and listen" > > * Sent on 15 Dec 2002 18:29:45 +0900 > > * Honorable Jamison Masse <ja...@re...> writes: > > > > > note that this is a "busywait" loop, i.e., it will get your loadavg to 1. > > I'm aware of that (and unhappy about it), does clisp have a mechanism > > that will raise some sort of event when a stream's got something to say? > > I want to grab keyboard input and keep an eye on a socket at the same > > time. > > SOCKET-STATUS > <http://clisp.cons.org/impnotes/socket.html#so-status> you will need the appended patch to make SOCKET-STATUS work with keyboard-streams too. (or use CVS head) -- Sam Steingold (http://www.podval.org/~sds) running RedHat8 GNU/Linux <http://www.camera.org> <http://www.iris.org.il> <http://www.memri.org/> <http://www.mideasttruth.com/> <http://www.palestine-central.com/links.html> Garbage In, Gospel Out Index: stream.d =================================================================== RCS file: /cvsroot/clisp/clisp/src/stream.d,v retrieving revision 1.325 retrieving revision 1.326 diff -u -w -b -u -b -w -i -B -r1.325 -r1.326 --- stream.d 13 Dec 2002 16:04:39 -0000 1.325 +++ stream.d 15 Dec 2002 20:08:16 -0000 1.326 @@ -14822,6 +14822,11 @@ if (out_sock) *out_sock = (SOCKET)stdout_handle; if (char_p) *char_p = true; return; + case strmtype_keyboard: + if (in_sock) + *in_sock = TheSocket(TheStream(obj)->strm_keyboard_handle); + if (char_p) *char_p = true; + return; case strmtype_twoway_socket: obj = TheStream(obj)->strm_twoway_socket_input; if (in_sock) *in_sock = SocketChannel(obj); |