elliottcable wrote:
> However, it still won't fix my problem, as anything Kernel#select will  
> work with (IO objects like STDIN) will only catch input by line,  
> whereas I need it by character. I'm probably going to be stuck finding  
> a way to work with `::getch` >,>

Quoting the ncurses manpage:

"To get character-at-a-time input without echoing (most interactive,
screen oriented programs want this),  the following sequence  should  be
used:

                           initscr(); cbreak(); noecho();"

> At this point, I'm probably going to force all protocols to initialize  
> when the app is started, before Ncurses is even initialized - that  
> way, all of the connections/whatever can be stuffed into their own  
> threads. Maybe those threads, started before the `Ncurses::getch` loop  
> is even created, won't be blocked.

Its not the matter *when* those threads are being created but how those
cooperate. I suggested Kernel#select because the Ruby ncurses module
apparently simply calls getch() in C world, which has no clue about
Ruby's threading, thus blocks until user input.

Once the terminal is in one-character-at-a-time mode select should
return with each single keypress.


Stephan


_______________________________________________
Xmpp4r-devel mailing list
Xmpp4r-devel@gna.org
https://mail.gna.org/listinfo/xmpp4r-devel

Reply via email to