Class: Mac::KeyCode
- Inherits:
-
Object
- Object
- Mac::KeyCode
- Defined in:
- lib/mac/key_code.rb,
lib/mac/key_code/version.rb
Constant Summary collapse
- VERSION =
"0.0.2"
Instance Method Summary collapse
-
#initialize(key_code) ⇒ KeyCode
constructor
A new instance of KeyCode.
- #printable? ⇒ Boolean
- #to_s ⇒ Object
Constructor Details
#initialize(key_code) ⇒ KeyCode
Returns a new instance of KeyCode.
6 7 8 9 |
# File 'lib/mac/key_code.rb', line 6 def initialize(key_code) @key_code = key_code @char = KeyCodeNative.key_code_to_char(@key_code) end |
Instance Method Details
#printable? ⇒ Boolean
11 12 13 |
# File 'lib/mac/key_code.rb', line 11 def printable? @char =~ /^[[:print:]\s]+/ end |
#to_s ⇒ Object
15 16 17 |
# File 'lib/mac/key_code.rb', line 15 def to_s @char end |