Class: Text2048::CursesView::Keyboard
- Inherits:
-
Object
- Object
- Text2048::CursesView::Keyboard
- Includes:
- Curses
- Defined in:
- lib/text2048/curses_view/keyboard.rb
Overview
Handles user inputs in curses
Constant Summary collapse
- KEYS =
{ 'h' => :left, 'l' => :right, 'k' => :up, 'j' => :down, Key::LEFT => :left, Key::RIGHT => :right, Key::UP => :up, Key::DOWN => :down, '+' => :larger, '-' => :smaller, 'q' => :quit }
Instance Method Summary collapse
Instance Method Details
#read ⇒ Object
20 21 22 23 |
# File 'lib/text2048/curses_view/keyboard.rb', line 20 def read maybe_init KEYS[getch] end |
#wait_any_key ⇒ Object
25 26 27 |
# File 'lib/text2048/curses_view/keyboard.rb', line 25 def wait_any_key getch end |