Class: RubySketch::VirtualKey::KeyEvent

Inherits:
Object
  • Object
show all
Defined in:
lib/rubysketch/virtual_key.rb

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(type, chars, key) ⇒ KeyEvent

Returns a new instance of KeyEvent.



139
140
141
# File 'lib/rubysketch/virtual_key.rb', line 139

def initialize(type, chars, key)
  @type, @chars, @key = type, chars, key
end

Instance Attribute Details

#charsObject (readonly)

Returns the value of attribute chars.



137
138
139
# File 'lib/rubysketch/virtual_key.rb', line 137

def chars
  @chars
end

#keyObject (readonly)

Returns the value of attribute key.



137
138
139
# File 'lib/rubysketch/virtual_key.rb', line 137

def key
  @key
end

#typeObject (readonly)

Returns the value of attribute type.



137
138
139
# File 'lib/rubysketch/virtual_key.rb', line 137

def type
  @type
end

Instance Method Details

#down?Boolean

Returns:

  • (Boolean)


143
144
145
# File 'lib/rubysketch/virtual_key.rb', line 143

def down?()
  @type == :down
end

#up?Boolean

Returns:

  • (Boolean)


147
148
149
# File 'lib/rubysketch/virtual_key.rb', line 147

def up?()
  @type == :up
end