Class: Rubydraw::Events::KeyPressed

Inherits:
KeyboardEvent show all
Defined in:
lib/rubydraw/events.rb

Overview

Created when any keyboard button is pressed, specifying the key.

@key

An integer specifying the key, which can be matched with a Rubydraw button constants.

Instance Attribute Summary

Attributes inherited from KeyboardEvent

#key

Class Method Summary collapse

Methods inherited from KeyboardEvent

from_sdl_event, #initialize

Methods inherited from Event

#event?, from_sdl_event, matches?

Constructor Details

This class inherits a constructor from Rubydraw::Events::KeyboardEvent

Class Method Details

.matching_sdl_typeObject



109
110
111
# File 'lib/rubydraw/events.rb', line 109

def self.matching_sdl_type
  SDL::KEYDOWN
end

.wants_to_match?Boolean

Returns:

  • (Boolean)


105
106
107
# File 'lib/rubydraw/events.rb', line 105

def self.wants_to_match?
  true
end