class Gdk::KeyEvent

Overview

An event related to a key-based device.

Defined in:

lib/gi-crystal/src/auto/gdk-4.0/key_event.cr

Constructors

Class Method Summary

Instance Method Summary

Instance methods inherited from class Gdk::Event

_get_angle(event2 : Gdk::Event, angle : Float64) : Bool _get_angle, _get_center(event2 : Gdk::Event, x : Float64, y : Float64) : Bool _get_center, _get_distance(event2 : Gdk::Event, distance : Float64) : Bool _get_distance, axes(axes : Enumerable(Float64)) : Bool
axes(*axes : Float64)
axes
, axis(axis_use : Gdk::AxisUse, value : Float64) : Bool axis, device : Gdk::Device? device, device_tool : Gdk::DeviceTool? device_tool, display : Gdk::Display? display, event_sequence : Gdk::EventSequence event_sequence, event_type : Gdk::EventType event_type, finalize finalize, history : Enumerable(Gdk::TimeCoord)? history, modifier_state : Gdk::ModifierType modifier_state, pointer_emulated : Bool pointer_emulated, position(x : Float64, y : Float64) : Bool position, seat : Gdk::Seat? seat, surface : Gdk::Surface? surface, time : UInt32 time, to_unsafe : Pointer(Void) to_unsafe, triggers_context_menu : Bool triggers_context_menu

Class methods inherited from class Gdk::Event

g_type : UInt64 g_type

Constructor Detail

def self.new #

Initialize a new KeyEvent.


Class Method Detail

def self.g_type : UInt64 #

Returns the type id (GType) registered in GLib type system.


Instance Method Detail

def consumed_modifiers : Gdk::ModifierType #

Extracts the consumed modifiers from a key event.


def is_modifier : Bool #

Extracts whether the key event is for a modifier key.


def keycode : UInt32 #

Extracts the keycode from a key event.


def keyval : UInt32 #

Extracts the keyval from a key event.


def layout : UInt32 #

Extracts the layout from a key event.


def level : UInt32 #

Extracts the shift level from a key event.


def match(keyval : UInt32, modifiers : Gdk::ModifierType) : Bool #

Gets a keyval and modifier combination that will match the event.

See Gdk::KeyEvent#matches.


def matches(keyval : UInt32, modifiers : Gdk::ModifierType) : Gdk::KeyMatch #

Matches a key event against a keyval and modifiers.

This is typically used to trigger keyboard shortcuts such as Ctrl-C.

Partial matches are possible where the combination matches if the currently active group is ignored.

Note that we ignore Caps Lock for matching.