Class: Reflex::KeyEvent

Inherits:
Event
  • Object
show all
Defined in:
lib/reflex/key_event.rb

Instance Method Summary collapse

Instance Method Details

#down?Boolean

Returns:

  • (Boolean)


27
28
29
# File 'lib/reflex/key_event.rb', line 27

def down?()
  get_action == DOWN
end

#get_modifiers!Object



21
# File 'lib/reflex/key_event.rb', line 21

alias_method :get_modifiers!, :modifiers

#inspectObject



39
40
41
42
43
44
45
46
47
48
49
# File 'lib/reflex/key_event.rb', line 39

def inspect()
  "#<Reflex::KeyEvent action:%s chars:%s key:%s code:0x%X mod:%s repeat:%d captured?:%s>" % [
    action,
    chars ? "'#{chars}'" : :nil,
    key ? key : :nil,
    code,
    modifiers.join(','),
    repeat,
    captured?
  ]
end

#modifiers(locks: true) ⇒ Object



23
24
25
# File 'lib/reflex/key_event.rb', line 23

def modifiers(locks: true)
  locks ? get_modifiers! : (get_modifiers! - LOCK_MODIFIER_SYMBOLS.keys)
end

#repeat?Boolean

Returns:

  • (Boolean)


35
36
37
# File 'lib/reflex/key_event.rb', line 35

def repeat?()
  repeat >= 1
end

#up?Boolean

Returns:

  • (Boolean)


31
32
33
# File 'lib/reflex/key_event.rb', line 31

def up?()
  get_action == UP
end