Class GestureLongPress

All Implemented Interfaces:
PointerInterface

public class GestureLongPress extends GestureSingle
`GtkGestureLongPress` is a `GtkGesture` for long presses.

This gesture is also known as “Press and Hold”.

When the timeout is exceeded, the gesture is triggering the
[signal@Gtk.GestureLongPress::pressed] signal.

If the touchpoint is lifted before the timeout passes, or if
it drifts too far of the initial press point, the
[signal@Gtk.GestureLongPress::cancelled] signal will be emitted.

How long the timeout is before the ::pressed signal gets emitted is
determined by the [property@Gtk.Settings:gtk-long-press-time] setting.
It can be modified by the [property@Gtk.GestureLongPress:delay-factor]
property.

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

  • Field Details

  • Constructor Details

    • GestureLongPress

      public GestureLongPress(PointerContainer pointer)
    • GestureLongPress

      public GestureLongPress()
      Returns a newly created `GtkGesture` that recognizes long presses.
  • Method Details

    • getClassHandler

      public static ClassHandler getClassHandler()
    • getDelayFactor

      public double getDelayFactor()
      Returns the delay factor.
      Returns:
      the delay factor
    • setDelayFactor

      public void setDelayFactor(double delay_factor)
      Applies the given delay factor.

      The default long press time will be multiplied by this value.
      Valid values are in the range [0.5..2.0].
      Parameters:
      delay_factor - The delay factor to apply
    • onCancelled

      public SignalHandler onCancelled(GestureLongPress.OnCancelled signal)
      Connect to signal "cancelled".
      See GestureLongPress.OnCancelled.onCancelled() for signal description.
      Field SIGNAL_ON_CANCELLED 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.
    • onPressed

      public SignalHandler onPressed(GestureLongPress.OnPressed signal)
      Connect to signal "pressed".
      See GestureLongPress.OnPressed.onPressed(double, double) for signal description.
      Field SIGNAL_ON_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.
    • 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()