class Amun::Application

singleton Amun application, it initialize curses, have the frame and handles keyboard

Constants

ESCDELAY

Attributes

frame[W]

Public Instance Methods

frame() click to toggle source
# File lib/amun/application.rb, line 17
def frame
  @frame ||= Windows::Frame.new
end
run() click to toggle source
# File lib/amun/application.rb, line 21
def run
  init_curses
  frame.render
  FeaturesLoader.load
  keyboard_thread.join
end

Private Instance Methods

init_curses() click to toggle source
# File lib/amun/application.rb, line 36
def init_curses
  Curses.init_screen
  Curses.curs_set 0
  Curses.raw
  Curses.noecho
  Curses.start_color
  Curses.stdscr.keypad = true
  Curses.ESCDELAY = 0
end
keyboard_thread() click to toggle source
# File lib/amun/application.rb, line 46
def keyboard_thread
  Thread.new do
    chain = []
    while (ch = Helpers::Keyboard.char)
      chain << ch
      chain.clear if frame.trigger(chain.join(' ')) != EventManager::CHAINED
      frame.render
    end
  end
end