Class: Hokusai::KeyUpEvent

Inherits:
KeyboardEvent show all
Defined in:
ui/src/hokusai/events/keyboard.rb

Instance Attribute Summary

Attributes inherited from KeyboardEvent

#input

Attributes inherited from Event

#bubbles, #captures, #stopped

Instance Method Summary collapse

Methods inherited from KeyboardEvent

#hovered, #initialize, #to_json

Methods inherited from Event

#bubble, #matches, name, #name, #stop, #to_json

Constructor Details

This class inherits a constructor from Hokusai::KeyboardEvent

Instance Method Details

#capture(block, _) ⇒ Object



54
55
56
# File 'ui/src/hokusai/events/keyboard.rb', line 54

def capture(block, _)
  captures << block if matches(block) && released_len > 0
end

#charObject



50
51
52
# File 'ui/src/hokusai/events/keyboard.rb', line 50

def char
  code.chr
end

#codeObject



46
47
48
# File 'ui/src/hokusai/events/keyboard.rb', line 46

def code
  keyboard_key[:char_code]
end

#keyObject



42
43
44
# File 'ui/src/hokusai/events/keyboard.rb', line 42

def key
  keyboard_key[:key][:key]
end

#keyboard_keyObject



38
39
40
# File 'ui/src/hokusai/events/keyboard.rb', line 38

def keyboard_key
  input.raw[:keyboard][:released]
end