From: Jeffrey Wiegley
Subject: keypresses in lisp, help please...
Date: 
Message-ID: <kuskdmINNkd5@phakt.usc.edu>
could anybody out there tell me how to write a lisp function to input a
single character without having to wait for a return?  I'm writing a
program and I want to move through menus with only a single key stroke.

basically I would like to mimick the C curses library input after

cbreak();
noecho();

is called for character-at-a-time input.
I would like it not to echo the keystroke but if that's hard or impossible
I can live with it being echoed.

thanks ahead of time for any help you can give me!

- Jeff Wiegley   (non-lisp guru, trying though)
-- 
Jeff Wiegley                         "Women are never to be entirely
·······@usc.edu                       trusted- not the best of them."
                                               - Sherlock Holmes
From: Joe Konstan
Subject: Re: keypresses in lisp, help please...
Date: 
Message-ID: <sq4fpINNpp3@agate.berkeley.edu>
In articles <············@phakt.usc.edu>  and <············@phakt.usc.edu>
·······@phakt.usc.edu (Jeffrey Wiegley) asks for a way to do non-echoing
cbreak-mode input.  He apparently received replies about character input, but
is having trouble with configuring the tty for cbreak and noecho.

I don't have your original article handy, so I'm not sure whether you
mentioned a specific lisp version (or OS version) but I'll assume that you are
using a standard common lisp on a unix machine.  For Allegro CL on SunOS, I do
the following:

(run-shell-command "stty -echo cbreak")

and then use read-char

Lucid and most other lisps have a similar function available.  If this is 
too slow, there are other ways to reach stty, but this seems to be the
easiest, and this only need be done when switching modes.  Be sure to change
back before terminating, and it might be a good idea to switch back in an 
error handler as well.

Joe Konstan
·······@cs.berkeley.edu