views:

185

answers:

1

Hello.

I want to use these functions from the conio.c library (Borland) in Ruby, specially getch().

getch() gets a key from the keyboard without press enter.

textcolor() changes the color of the text in the terminal.

gotoxy() moves the cursor to other position of the terminal.

Someone knows the equivalents?

Thanks.

+3  A: 

On ruby-forum I found a discussion about this, see Ncurses like library. There are both Ncurses and Curses. Not sure if there are other libs.

neoneye
I knew for example ncruses-ruby project. But I'm looking for standard functions.+1 for the option of use external libraries.
a0rtega
if you are in a unix terminal then there are no standard functions, only escape sequences and these vary a lot depending on the terminal type. The best lib for escape sequences are ncurses or curses and I used it for my ruby programming editor some years ago, see:http://aeditor.rubyforge.org/aeditor_shots/044.png
neoneye
Ok, as I can see doesn't exist standard functions to do those things ... Thanks you, I will try with libraries ;-)
a0rtega