Gtk.EventControllerKey¶
- Subclasses:
None
Methods¶
- Inherited:
- Structs:
class |
|
|
|
|
|
|
Virtual Methods¶
- Inherited:
Properties¶
- Inherited:
Signals¶
- Inherited:
Name |
Short Description |
---|---|
Emitted whenever the input method context filters away a keypress and prevents the controller receiving it. |
|
Emitted whenever a key is pressed. |
|
Emitted whenever a key is released. |
|
Emitted whenever the state of modifier keys and pointer buttons change. |
Fields¶
- Inherited:
Class Details¶
- class Gtk.EventControllerKey(**kwargs)¶
- Bases:
- Abstract:
No
- Structure:
GtkEventControllerKey
is an event controller that provides access to key events.- classmethod new()[source]¶
- Returns:
a new
GtkEventControllerKey
- Return type:
Creates a new event controller that will handle key events.
- forward(widget)[source]¶
- Parameters:
widget (
Gtk.Widget
) – aGtkWidget
- Returns:
whether the widget handled the event
- Return type:
Forwards the current event of this self to a widget.
This function can only be used in handlers for the [signal`Gtk`.EventControllerKey::key-pressed], [signal`Gtk`.EventControllerKey::key-released] or [signal`Gtk`.EventControllerKey::modifiers] signals.
- get_group()[source]¶
- Returns:
the key group
- Return type:
Gets the key group of the current event of this self.
See [method`Gdk`.KeyEvent.get_layout].
- get_im_context()[source]¶
- Returns:
the
GtkIMContext
- Return type:
Gets the input method context of the key self.
- set_im_context(im_context)[source]¶
- Parameters:
im_context (
Gtk.IMContext
orNone
) – aGtkIMContext
Sets the input method context of the key self.
Signal Details¶
- Gtk.EventControllerKey.signals.im_update(event_controller_key)¶
- Signal Name:
im-update
- Flags:
- Parameters:
event_controller_key (
Gtk.EventControllerKey
) – The object which received the signal
Emitted whenever the input method context filters away a keypress and prevents the controller receiving it.
See [method`Gtk`.EventControllerKey.set_im_context] and [method`Gtk`.IMContext.filter_keypress].
- Gtk.EventControllerKey.signals.key_pressed(event_controller_key, keyval, keycode, state)¶
- Signal Name:
key-pressed
- Flags:
- Parameters:
event_controller_key (
Gtk.EventControllerKey
) – The object which received the signalkeyval (
int
) – the pressed key.keycode (
int
) – the raw code of the pressed key.state (
Gdk.ModifierType
) – the bitmask, representing the state of modifier keys and pointer buttons.
- Returns:
- Return type:
Emitted whenever a key is pressed.
- Gtk.EventControllerKey.signals.key_released(event_controller_key, keyval, keycode, state)¶
- Signal Name:
key-released
- Flags:
- Parameters:
event_controller_key (
Gtk.EventControllerKey
) – The object which received the signalkeyval (
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.
Emitted whenever a key is released.
- Gtk.EventControllerKey.signals.modifiers(event_controller_key, state)¶
- Signal Name:
modifiers
- Flags:
- Parameters:
event_controller_key (
Gtk.EventControllerKey
) – The object which received the signalstate (
Gdk.ModifierType
) – the bitmask, representing the new state of modifier keys and pointer buttons.
- Return type:
Emitted whenever the state of modifier keys and pointer buttons change.