Class: Gdk::KeyEvent

Inherits:
Event
  • Object
show all
Defined in:
(unknown)

Overview

An event related to a key-based device.

Constant Summary

Constants inherited from Event

Event::PROPAGATE, Event::STOP

Instance Method Summary collapse

Methods inherited from Event

#_get_angle, #_get_center, #_get_distance, #device, #device_tool, #display, #event_sequence, #event_type, #get_axes, #get_axis, #get_history, #get_position, #modifier_state, #pointer_emulated, #ref, #seat, #send_event?, #surface, #time, #triggers_context_menu, #unref

Instance Method Details

#consumed_modifiers ⇒ Gdk::ModifierType

Extracts the consumed modifiers from a key event.

Returns:

#get_match(keyval, modifiers) ⇒ Boolean

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

See [methodGdk.KeyEvent.matches].

Parameters:

  • keyval (Integer) —

    return location for a keyval

  • modifiers (Gdk::ModifierType) —

    return location for modifiers

Returns:

  • (Boolean) —

    true on success

#is_modifier ⇒ Boolean

Extracts whether the key event is for a modifier key.

Returns:

  • (Boolean) —

    true if the event is for a modifier key

#keycode ⇒ Integer

Extracts the keycode from a key event.

Returns:

  • (Integer) —

    the keycode of event

#keyval ⇒ Integer

Extracts the keyval from a key event.

Returns:

  • (Integer) —

    the keyval of event

#layout ⇒ Integer

Extracts the layout from a key event.

Returns:

  • (Integer) —

    the layout of event

#level ⇒ Integer

Extracts the shift level from a key event.

Returns:

  • (Integer) —

    the shift level of event

#matches(keyval, modifiers) ⇒ 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.

Parameters:

  • keyval (Integer) —

    the keyval to match

  • modifiers (Gdk::ModifierType) —

    the modifiers to match

Returns:

  • (Gdk::KeyMatch) —

    a GdkKeyMatch value describing whether event matches