Class EventControllerKey

All Implemented Interfaces:
PointerInterface

public class EventControllerKey extends EventController
`GtkEventControllerKey` is an event controller that provides access
to key events.

https://docs.gtk.org/gtk4/class.EventControllerKey.html

  • Field Details

  • Constructor Details

    • EventControllerKey

      public EventControllerKey(PointerContainer pointer)
    • EventControllerKey

      public EventControllerKey()
      Creates a new event controller that will handle key events.
  • Method Details

    • getClassHandler

      public static ClassHandler getClassHandler()
    • forward

      public boolean forward(@Nonnull Widget widget)
      Forwards the current event of this @controller 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.
      Parameters:
      widget - a `GtkWidget`
      Returns:
      whether the @widget handled the event
    • getGroup

      public int getGroup()
      Gets the key group of the current event of this @controller.

      See [method@Gdk.KeyEvent.get_layout].
      Returns:
      the key group
    • getImContext

      public IMContext getImContext()
      Gets the input method context of the key @controller.
      Returns:
      the `GtkIMContext`
    • setImContext

      public void setImContext(@Nullable IMContext im_context)
      Sets the input method context of the key @controller.
      Parameters:
      im_context - a `GtkIMContext`
    • onImUpdate

      public SignalHandler onImUpdate(EventControllerKey.OnImUpdate signal)
      Connect to signal "im-update".
      See EventControllerKey.OnImUpdate.onImUpdate() for signal description.
      Field SIGNAL_ON_IM_UPDATE contains original signal name and can be used as resource reference.
      Parameters:
      signal - callback function (lambda).
      Returns:
      SignalHandler. Can be used to disconnect signal and to release callback function.
    • onKeyPressed

      public SignalHandler onKeyPressed(EventControllerKey.OnKeyPressed signal)
      Connect to signal "key-pressed".
      See EventControllerKey.OnKeyPressed.onKeyPressed(int, int, int) for signal description.
      Field SIGNAL_ON_KEY_PRESSED contains original signal name and can be used as resource reference.
      Parameters:
      signal - callback function (lambda).
      Returns:
      SignalHandler. Can be used to disconnect signal and to release callback function.
    • onKeyReleased

      public SignalHandler onKeyReleased(EventControllerKey.OnKeyReleased signal)
      Connect to signal "key-released".
      See EventControllerKey.OnKeyReleased.onKeyReleased(int, int, int) for signal description.
      Field SIGNAL_ON_KEY_RELEASED contains original signal name and can be used as resource reference.
      Parameters:
      signal - callback function (lambda).
      Returns:
      SignalHandler. Can be used to disconnect signal and to release callback function.
    • onModifiers

      public SignalHandler onModifiers(EventControllerKey.OnModifiers signal)
      Connect to signal "modifiers".
      See EventControllerKey.OnModifiers.onModifiers(int) for signal description.
      Field SIGNAL_ON_MODIFIERS contains original signal name and can be used as resource reference.
      Parameters:
      signal - callback function (lambda).
      Returns:
      SignalHandler. Can be used to disconnect signal and to release callback function.
    • getTypeID

      public static long getTypeID()
    • getParentTypeID

      public static long getParentTypeID()
    • getTypeSize

      public static TypeSystem.TypeSize getTypeSize()
    • getParentTypeSize

      public static TypeSystem.TypeSize getParentTypeSize()
    • getInstanceSize

      public static int getInstanceSize()