There are two ways you can run Factor: in the terminal, or using our UI.

For the terminal, you will have to set the input mode to non-canonical using 
tcsetattr and termios. We don't usually do this...
http://tldp.org/HOWTO/Serial-Programming-HOWTO/x115.html

Or you can uses curses, specifically the nodelay() call. In extra/curses/, call 
nodelay after you make a curses-window.


Using the UI, you can do something similar to gesture-logger.
"gesture-logger" run


Cheers,
Doug



> 
> On Fri, Nov 4, 2011 at 6:14 PM, John Porubek <jporu...@gmail.com> wrote:
> I'm having fun learning Factor and imagining the cool things I'll be
> able to do with it someday. But for now, most of my coding involves
> translating simple things I've done before in Forth. Sometimes this
> can be frustrating. For example, in Forth I might have the following:
> 
> : foo  begin ." Hi" ?key until ;
> 
> If I execute foo, it will print 'Hi' continuously until I hit a key
> (any key). My roughly analogous attempt in Factor is:
> 
> : foo  ( -- ) [ 1 read "q" = not ] [ "Hi" print ] while ;
> 
> This is problematic for a couple of reasons. For one, I have to enter
> a <cr> to have it print 'Hi'. For another, I have to enter the test
> for a specific character ('q' in this case) to break out of the loop.
> I read about key gestures, but they seem like overkill for what I'm
> looking for. Is there a simple way to get the functionality Forth's
> 'key?' offers in Factor? Or, if I have to use key gestures, what's the
> simplest possible way to use them?
> 
> Thanks,
> 
> --John
> 
> ------------------------------------------------------------------------------
> RSA(R) Conference 2012
> Save $700 by Nov 18
> Register now
> http://p.sf.net/sfu/rsa-sfdev2dev1
> _______________________________________________
> Factor-talk mailing list
> Factor-talk@lists.sourceforge.net
> https://lists.sourceforge.net/lists/listinfo/factor-talk
> 
> 
> ------------------------------------------------------------------------------
> RSA(R) Conference 2012
> Save $700 by Nov 18
> Register now
> http://p.sf.net/sfu/rsa-sfdev2dev1_______________________________________________
> Factor-talk mailing list
> Factor-talk@lists.sourceforge.net
> https://lists.sourceforge.net/lists/listinfo/factor-talk

------------------------------------------------------------------------------
RSA(R) Conference 2012
Save $700 by Nov 18
Register now
http://p.sf.net/sfu/rsa-sfdev2dev1
_______________________________________________
Factor-talk mailing list
Factor-talk@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/factor-talk

Reply via email to