[plt-scheme] Re: Scan key code in non-gui mode

From: nandehutu (chaguidiao at gmail.com)
Date: Sun Feb 7 21:14:47 EST 2010

Hi all

Thanks a lot for all the suggestions.  I guess there is currently no
cross-platform, standardized way of doing this.  Probably I need to
spend some effort to come out with a generic tty+win32 way of higher
level routine to handle it.

Thanks again, it helps.

On Feb 7, 7:07 pm, Jakub Piotr Cłapa <jpc... at zenburn.net> wrote:
> On 06-02-10 17:17, Thomas Chust wrote:
>
> > If you want to do this in a terminal on a POSIX compliant system, I
> > would suggest using the external stty program to set an appropriate
> > input/output mode before simply reading characters or bytes from the
> > terminal device using standard Scheme procedures. An example program is
> > attached to this message -- save the two modules in the same directory
> > and run mzscheme -t- keys.ss in a terminal to try it out.
>
> You could also use ncurses but it may be an overkill for such a simple
> thing.
>
> > In a Windows terminal window you would have to use some native C API to
> > achieve the same effect.
>
> I attached a simple Python module that does this and a little more
> (mainly changing window size and text/background colors). It is based on
> pywin32 which closely follows the C Win32 API. It should be easy to port
> the code to Scheme FFI with a little help from MSDN.
>
> --
> regards,
> Jakub Piotr Cłapa
>
>  WConio.py
> 3KViewDownload
>
> _________________________________________________
>   For list-related administrative tasks:
>  http://list.cs.brown.edu/mailman/listinfo/plt-scheme


Posted on the users mailing list.