Class: Yeah::Keyboard Abstract
- Inherits:
-
Object
- Object
- Yeah::Keyboard
- Defined in:
- lib/yeah/_platform/keyboard.rb
Overview
This class is abstract.
Provided by a Platform.
The Keyboard provides keyboard input handling.
Constant Summary collapse
- KEYS =
[0, 1, 2, 3, 4, 5, 6, 7, 8, 9, :a, :alt, :b, :backquote, :backslash, :backspace, :c, :caps_lock, :comma, :ctrl, :d, :delete, :dot, :down, :e, :end, :enter, :equals, :escape, :f, :f1, :f10, :f11, :f12, :f2, :f3, :f4, :f5, :f6, :f7, :f8, :f9, :fn, :g, :h, :home, :i, :insert, :j, :k, :l, :left, :left_bracket, :m, :minus, :n, :num0, :num1, :num2, :num3, :num4, :num5, :num6, :num7, :num8, :num9, :num_asterisk, :num_dot, :num_lock, :num_minus, :num_plus, :num_slash, :o, :p, :page_down, :page_up, :pause, :q, :quote, :r, :right, :right_bracket, :s, :scroll_lock, :semicolon, :shift, :slash, :super, :t, :tab, :u, :up, :v, :w, :x, :y, :z]
Instance Method Summary collapse
-
#initialize(options = {}) ⇒ Keyboard
constructor
A new instance of Keyboard.
-
#pressed?(key) ⇒ Boolean
Whether key was just pressed.
-
#pressing?(key) ⇒ Boolean
Whether key is pressed.
-
#released?(key) ⇒ Boolean
Whether key was just released.
Constructor Details
#initialize(options = {}) ⇒ Keyboard
Returns a new instance of Keyboard.
21 22 23 |
# File 'lib/yeah/_platform/keyboard.rb', line 21 def initialize( = {}) raise NotImplementedError end |
Instance Method Details
#pressed?(key) ⇒ Boolean
Returns whether key was just pressed.
|
|
# File 'lib/yeah/_platform/keyboard.rb', line 29
|
#pressing?(key) ⇒ Boolean
Returns whether key is pressed.
|
|
# File 'lib/yeah/_platform/keyboard.rb', line 25
|
#released?(key) ⇒ Boolean
Returns whether key was just released.
|
|
# File 'lib/yeah/_platform/keyboard.rb', line 33
|