lib/textbringer/controller.rb in textbringer-0.1.1 vs lib/textbringer/controller.rb in textbringer-0.1.2
- old
+ new
@@ -32,11 +32,11 @@
def command_loop(tag)
catch(tag) do
loop do
begin
- c = Window.current.getch
+ c = Window.current.read_char
Window.echo_area.clear_message
@last_key = c
@key_sequence << @last_key
cmd = key_binding(@key_sequence)
if cmd.is_a?(Symbol) || cmd.respond_to?(:call)
@@ -74,15 +74,15 @@
def wait_input(msecs)
Window.current.wait_input(msecs)
end
def read_char
- Window.current.getch
+ Window.current.read_char
end
def received_keyboard_quit?
- while (key = Window.current.getch_nonblock) && key >= 0
+ while key = Window.current.read_char_nonblock
if GLOBAL_MAP.lookup([key]) == :keyboard_quit
return true
end
end
false
@@ -103,10 +103,10 @@
def key_name(key)
case key
when Integer
if key < 0x80
- s = Ncurses.keyname(key)
+ s = Curses.keyname(key)
case s
when /\AKEY_(.*)/
"<#{$1.downcase}>"
else
s