Class: SDL2::Event::Keyboard

Inherits:
SDL2::Event show all
Defined in:
ext/sdl2_ext/event.c,
lib/sdl2/event.rb,
ext/sdl2_ext/event.c

Overview

This class represents keyboard event.

You don't handle the instance of this class directly, but you handle the instances of two subclasses of this subclasses: KeyDown and KeyUp.

Direct Known Subclasses

KeyDown, KeyUp

Instance Attribute Summary collapse

Attributes inherited from SDL2::Event

#timestamp, #type

Instance Method Summary collapse

Methods inherited from SDL2::Event

enable=, enabled?, poll, #window

Instance Attribute Details

#modInteger

current key modifier

Returns:

  • (Integer)

See Also:

#pressedInteger Also known as: pressed?

key is pressed

Returns:

  • (Integer)

#repeatInteger Also known as: repeat?

key repeat

Returns:

  • (Integer)

#scancodeInteger

physical key code

Returns:

  • (Integer)

See Also:

#symInteger

virtual key code

Returns:

  • (Integer)

See Also:

#window_idInteger

the associate window id

Returns:

  • (Integer)

Instance Method Details

#inspectString

Returns inspection string.

Returns:

  • (String)

    inspection string



359
360
361
362
363
364
365
366
# File 'ext/sdl2_ext/event.c', line 359

def inspect
	"<#{self.class.inspect}: " \
		"timestamp=#{timestamp.inspect} " \
		"window_id=#{window_id.inspect} " \
		"repeat=#{repeat.inspect} " \
		"scancode=#{SDL2::Key::Scan.name_of(scancode).inspect} " \
		"sym=#{SDL2::Key.name_of(sym).inspect}>"
end