struct

Espresso::KeyboardKeyEvent

Inherits Espresso::KeyboardEvent / Espresso::WindowEvent / Struct / Value / Object

Event triggered when a physical keyboard key is pressed or released.

Instance methods

key

Keyboard key that is pressed or released.

Source
key_name?

Retrieves the name of the key, encoded as UTF-8. If the key is printable, a string will be returned, nil otherwise.

Source
mods

Any modifier keys that were held down when the event occurred.

Source
pressed?

Indicates whether the key was pressed.

Source
released?

Indicates whether the key was released.

Source
scancode

The scancode of a key is specific to that platform or sometimes even to that machine. Scancodes are intended to allow users to bind keys that don't have a GLFW Key token. Such keys have #key set to Key::Unknown, their state is not saved and so it cannot be queried with Keyboard#key.

Sometimes GLFW needs to generate synthetic key events, in which case the scancode may be zero.

Source
state

State of the key.

Source