class Eagle::KeyEvent

Overview

A keyboard key went down or up. Key repeat sends more presses with #repeat? set. For typed text, use TextEvent, which handles keyboard layouts and dead keys.

Defined in:

eagle/core/events.cr

Constructors

Instance Method Summary

Instance methods inherited from class Eagle::Event

handled=(handled : Bool) handled=, handled? : Bool handled?

Constructor Detail

def self.new(key : Eagle::Key, pressed : Bool, repeat : Bool = false, mods : Eagle::KeyMod = KeyMod::None) #

Creates a key event, for Eagle.inject and tests.


Instance Method Detail

def key : Key #

The key, by physical position.


def mods : KeyMod #

Modifier keys held at the time.


def pressed? : Bool #

True for a press, false for a release.


def released? : Bool #

True when the key was released.


def repeat? : Bool #

True for presses generated by holding the key down.