Class: RubySketch::VirtualKey::KeyEvent

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

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(type, chars, key) ⇒ KeyEvent

Returns a new instance of KeyEvent.



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

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

Instance Attribute Details

#charsObject (readonly)

Returns the value of attribute chars.



135
136
137
# File 'lib/rubysketch/window.rb', line 135

def chars
  @chars
end

#keyObject (readonly)

Returns the value of attribute key.



135
136
137
# File 'lib/rubysketch/window.rb', line 135

def key
  @key
end

#typeObject (readonly)

Returns the value of attribute type.



135
136
137
# File 'lib/rubysketch/window.rb', line 135

def type
  @type
end

Instance Method Details

#down?Boolean

Returns:

  • (Boolean)


141
142
143
# File 'lib/rubysketch/window.rb', line 141

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

#up?Boolean

Returns:

  • (Boolean)


145
146
147
# File 'lib/rubysketch/window.rb', line 145

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