EventControllerKey
Superclasses: EventController
, Object
GtkEventControllerKey
is an event controller that provides access
to key events.
Constructors
- class EventControllerKey
- classmethod new() EventController
Creates a new event controller that will handle key events.
Methods
- class EventControllerKey
- forward(widget: Widget) bool
Forwards the current event of this
controller
to awidget
.This function can only be used in handlers for the
key_pressed
,key_released
ormodifiers
signals.- Parameters:
widget – a
GtkWidget
- get_group() int
Gets the key group of the current event of this
controller
.See
get_layout
.
Signals
- class EventControllerKey.signals
- im_update() None
Emitted whenever the input method context filters away a keypress and prevents the
controller
receiving it.See
set_im_context
andfilter_keypress
.
- key_pressed(keyval: int, keycode: int, state: ModifierType) bool
Emitted whenever a key is pressed.
- Parameters:
keyval – the pressed key.
keycode – the raw code of the pressed key.
state – the bitmask, representing the state of modifier keys and pointer buttons.
- key_released(keyval: int, keycode: int, state: ModifierType) None
Emitted whenever a key is released.
- Parameters:
keyval – the released key.
keycode – the raw code of the released key.
state – the bitmask, representing the state of modifier keys and pointer buttons.
- modifiers(state: ModifierType) bool
Emitted whenever the state of modifier keys and pointer buttons change.
- Parameters:
state – the bitmask, representing the new state of modifier keys and pointer buttons.