S
Stanislaw Halik
Heya,
I'm trying to learn the Ncurses module. However, nonblocking getch()
doesn't work. A simple test case:
-->--
#!/usr/bin/env ruby
require 'ncurses'
Ncurses.initscr
Ncurses.start_color
Ncurses.noecho
Ncurses.cbreak
Ncurses.noraw
Ncurses.stdscr.nodelay(true)
Ncurses.stdscr.keypad(true)
Ncurses.refresh
while ch = Ncurses.getch
Ncurses.printw ch.to_s
Ncurses.refresh
end
--<--
prints '10' every time no characters are in the buffer. There's no
constant defined to be a '10' in both ncurses.h and the Ruby wrapper.
According to getch(3), it's supposed to return an 'ERR' constant, being
'-1'. It, however, returns '10' for some reason.
Now i'm out of luck. There's no support contact listed on ruby-ncurses
project's site and the Curses module seems obsolete - it doesn't
implement w*printw()-related functions which i like using much.
Is there some other ncurses module that actually works?
I'm trying to learn the Ncurses module. However, nonblocking getch()
doesn't work. A simple test case:
-->--
#!/usr/bin/env ruby
require 'ncurses'
Ncurses.initscr
Ncurses.start_color
Ncurses.noecho
Ncurses.cbreak
Ncurses.noraw
Ncurses.stdscr.nodelay(true)
Ncurses.stdscr.keypad(true)
Ncurses.refresh
while ch = Ncurses.getch
Ncurses.printw ch.to_s
Ncurses.refresh
end
--<--
prints '10' every time no characters are in the buffer. There's no
constant defined to be a '10' in both ncurses.h and the Ruby wrapper.
According to getch(3), it's supposed to return an 'ERR' constant, being
'-1'. It, however, returns '10' for some reason.
Now i'm out of luck. There's no support contact listed on ruby-ncurses
project's site and the Curses module seems obsolete - it doesn't
implement w*printw()-related functions which i like using much.
Is there some other ncurses module that actually works?