> On Oct 30, 2016, at 07:54, Ken MacKenzie <deviloc...@gmail.com> wrote:
> 
> So a curiosity question.  Right now I am reading in a line of terminal input 
> from the user and handling it.  I am thinking of switching the program to 
> handle the input character by character, and just wondering how to do that 
> but also have it seem to the user that the program is waiting for them to 
> press enter, appear the same as a read-line basically.
> 
> The reason I want to do that is trigger some events for certain non-alpha for 
> now, white space and punctuation.  The other thing is eventually I may with 
> to begin some background processing as the user is completing the full input 
> string.  Basically the appearance of better performance using the bottle neck 
> of the time it takes a user to create the input.  Granted I will have to deal 
> with backspace or other cases where the user changes there mind.  Basically 
> doing some predictive text analysis sort of.
> 
> So what is the best way to read keypress or character by character input in 
> racket.  For now dealing with a CLI/terminal interface to keep it simple as I 
> work to test and refine my methods.

This is fundamentally not just a Racket question; for normal shell programs, 
the input buffering happens on the shell side, not on the Racket side. I 
believe this stack overflow answer may be of some use to you, or persuade you 
that it’s not worth it :).

http://stackoverflow.com/questions/4506704/how-to-disable-line-buffering-of-input-in-xterm-from-program#4506801

… actually, reading the comments there, it appears that the buffering doesn’t 
even happen in the shell directly: "The buffering does not take place in the 
terminal. It takes place in the kernel's tty driver.”

Apologies if you already knew all this, or if I’m wrong in some dramatic and 
fundamental way :).

John


-- 
You received this message because you are subscribed to the Google Groups 
"Racket Users" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to racket-users+unsubscr...@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.

Attachment: signature.asc
Description: PGP signature

Reply via email to