Ah, I didn't know Ncurses' methods would actually affect how gets works. Thanks! I'll fiddle with that, if nothing else maybe I can work around it with this knowledge (-:
On Jul 24, 2008, at 4:12 PM, Stephan Maka wrote: > 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 --------------------------------------------------------- elliott cable _ _ +1.919.636.4204 ( \---/ ) elliottcable.name ) . . ( [EMAIL PROTECTED] ____________________,--._(___Y___)_,--.__________________ `--' `--' THIS MESSAGE (and any attached materials) IS INTENDED ONLY FOR THE USE OF THE INDIVIDUAL OR ENTITY TO WHICH IT IS ADDRESSED AND MAY CONTAIN INFORMATION THAT IS PRIVILEGED, CONFIDENTIAL, AND EXEMPT FROM DISCLOSURE UNDER APPLICABLE LAW. If you, the reader of this message, are not the intended recipient or the agent responsible for delivering the message to the intended recipient, you are hereby notified that any dissemination, distribution, or copying of this communication is strictly prohibited. If you have received this communication in error, please notify me immediately by replying to this message and deleting all traces of it from your computer. Thank you. five.sentenc.es _________________________________________________________ Signature licensed under Creative Commons BY-NC-SA 3.0 Do not use it, unless you follow those terms! _______________________________________________ Xmpp4r-devel mailing list Xmpp4r-devel@gna.org https://mail.gna.org/listinfo/xmpp4r-devel