The
gtk:event-controller-key object is an event controller meant
for situations where you need access to key events.
Signal Details
The "im-update" signal
lambda (controller) :run-last
- controller
- The gtk:event-controller-key object which received the signal.
The signal is emitted whenever the input method context filters away a
keypress and prevents the controller receiving it. See the
gtk:event-controller-key-im-context and
gtk:im-context-filter-keypress functions.
The "key-pressed" signal
lambda (controller keyval keycode state) :run-last
- controller
- The gtk:event-controller-key object which received the signal.
- keyval
- The unsigned integer with the pressed key.
- keycode
- The unsigned integer with the raw code of the pressed key.
- state
- The gdk:modifier-type bitmask representing the state of modifier keys and pointer buttons.
- Returns
- True if the key press was handled, false otherwise.
The signal is emitted whenever a key is pressed.
The "key-released" signal
lambda (controller keyval keycode state) :run-last
- controller
- The gtk:event-controller-key object which received the signal.
- keyval
- The unsigned integer with the released key.
- keycode
- The unsigned integer with the raw code of the released key.
- state
- The gdk:modifier-type bitmask representing the state of modifier keys and pointer buttons.
The signal is emitted whenever a key is released.
The "modifiers" signal
lambda (controller state) :run-last
- controller
- The gtk:event-controller-key object on which received the signal.
- state
- The gdk:modifier-type bitmask, representing the state of modifier keys and pointer buttons.
- Returns
- The boolean whether to ignore modifiers.
This signal is emitted whenever the state of modifier keys and pointer
buttons change.