Class: Gdk::KeyEvent

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

Overview

An event related to a key-based device.

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, #surface, #time, #triggers_context_menu, #unref

Instance Method Details

#consumed_modifiersGdk::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_modifierBoolean

Extracts whether the key event is for a modifier key.

Returns:

  • (Boolean)

    true if the event is for a modifier key

#keycodeInteger

Extracts the keycode from a key event.

Returns:

  • (Integer)

    the keycode of event

#keyvalInteger

Extracts the keyval from a key event.

Returns:

  • (Integer)

    the keyval of event

#layoutInteger

Extracts the layout from a key event.

Returns:

  • (Integer)

    the layout of event

#levelInteger

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