Class: Chamomile::KeyEvent

Inherits:
Data
  • Object
show all
Defined in:
lib/chamomile/messages.rb

Instance Attribute Summary collapse

Instance Method Summary collapse

Instance Attribute Details

#keyObject (readonly)

Returns the value of attribute key

Returns:

  • (Object)

    the current value of key



10
11
12
# File 'lib/chamomile/messages.rb', line 10

def key
  @key
end

#modObject (readonly)

Returns the value of attribute mod

Returns:

  • (Object)

    the current value of mod



10
11
12
# File 'lib/chamomile/messages.rb', line 10

def mod
  @mod
end

Instance Method Details

#alt?Boolean

Returns:

  • (Boolean)


13
# File 'lib/chamomile/messages.rb', line 13

def alt?   = mod.include?(:alt)

#ctrl?Boolean

Returns:

  • (Boolean)


11
# File 'lib/chamomile/messages.rb', line 11

def ctrl?  = mod.include?(:ctrl)

#shift?Boolean

Returns:

  • (Boolean)


12
# File 'lib/chamomile/messages.rb', line 12

def shift? = mod.include?(:shift)

#to_sObject



14
# File 'lib/chamomile/messages.rb', line 14

def to_s   = mod.empty? ? key.to_s : "#{mod.join("+")}+#{key}"