Michael W. Ryder
9/17/2007 7:46:00 AM
Michael Linfield wrote:
> Tom Cloyd wrote:
>> A beginner question for sure, but one on which I'm stuck: I'm trying to
>> determine if it's possible, by any means whatsoever, to display a line
>> of text on the console and allow the user to edit it, before pressing
>> Enter to cause it to be read back in. As far as I can tell, this is only
>> possible in a GUI display object. Before I move in that direction I
>> thought I'd check to see if I've missed anything.
>>
>> Thanks for any help anyone has.
>>
>> t.
>
> I dont quite understand why you would in fact want to have a line of
> text that can be edited in a console...They would have to backspace to
> change anything which would defeat the purpose. A GUI would be the way
> to go in this case, and if u need help with that just say so. :)
I have a C routine that does exactly this without using any GUI. It
recognizes the keys to move and edit. Since it does not display the
keys pressed I am not sure if this is possible in Ruby without using
something like Curses. The original version used the hardware directly
and will probably not work with most current Operating Systems but it
was an easy conversion to use Curses.