Gtk.EventControllerKey

g GObject.Object GObject.Object Gtk.EventController Gtk.EventController GObject.Object->Gtk.EventController Gtk.EventControllerKey Gtk.EventControllerKey Gtk.EventController->Gtk.EventControllerKey

Subclasses:None

Methods

Inherited:Gtk.EventController (5), GObject.Object (37)
Structs:GObject.ObjectClass (5)
class new (widget)
  forward (widget)
  get_group ()
  get_im_context ()
  set_im_context (im_context)

Virtual Methods

Inherited:GObject.Object (7)

Properties

Inherited:Gtk.EventController (2)

Signals

Inherited:GObject.Object (1)
Name Short Description
focus-in  
focus-out  
im-update  
key-pressed This signal is emitted whenever a key is pressed.
key-released This signal is emitted whenever a key is released.
modifiers  

Fields

Inherited:GObject.Object (1)

Class Details

class Gtk.EventControllerKey(**kwargs)
Bases:Gtk.EventController
Abstract:No
Structure:Gtk.EventControllerKeyClass

Gtk.EventControllerKey is an event controller meant for situations where you need access to key events.

This object was added in 3.24.

classmethod new(widget)[source]
Parameters:widget (Gtk.Widget) –
Return type:Gtk.EventController
forward(widget)[source]
Parameters:widget (Gtk.Widget) –
Return type:bool
get_group()[source]
Return type:int
get_im_context()[source]
Returns:the IM context
Return type:Gtk.IMContext

Gets the IM context of a key controller.

New in version 3.24.

set_im_context(im_context)[source]
Parameters:im_context (Gtk.IMContext) –

Signal Details

Gtk.EventControllerKey.signals.focus_in(event_controller_key)
Signal Name:focus-in
Flags:RUN_LAST
Parameters:event_controller_key (Gtk.EventControllerKey) – The object which received the signal
Gtk.EventControllerKey.signals.focus_out(event_controller_key)
Signal Name:focus-out
Flags:RUN_LAST
Parameters:event_controller_key (Gtk.EventControllerKey) – The object which received the signal
Gtk.EventControllerKey.signals.im_update(event_controller_key)
Signal Name:im-update
Flags:RUN_LAST
Parameters:event_controller_key (Gtk.EventControllerKey) – The object which received the signal
Gtk.EventControllerKey.signals.key_pressed(event_controller_key, keyval, keycode, state)
Signal Name:

key-pressed

Flags:

RUN_LAST

Parameters:
Returns:

True if the key press was handled, False otherwise.

Return type:

bool

This signal is emitted whenever a key is pressed.

New in version 3.24.

Gtk.EventControllerKey.signals.key_released(event_controller_key, keyval, keycode, state)
Signal Name:

key-released

Flags:

RUN_LAST

Parameters:
  • event_controller_key (Gtk.EventControllerKey) – The object which received the signal
  • keyval (int) – the released key.
  • keycode (int) – the raw code of the released key.
  • state (Gdk.ModifierType) – the bitmask, representing the state of modifier keys and pointer buttons. See Gdk.ModifierType.

This signal is emitted whenever a key is released.

New in version 3.24.

Gtk.EventControllerKey.signals.modifiers(event_controller_key, object)
Signal Name:

modifiers

Flags:

RUN_LAST

Parameters:
Return type:

bool