Klasse Event

Alle implementierten Schnittstellen:
PointerInterface
Bekannte direkte Unterklassen:
ButtonEvent, CrossingEvent, DeleteEvent, DNDEvent, FocusEvent, GrabBrokenEvent, KeyEvent, MotionEvent, PadEvent, ProximityEvent, ScrollEvent, TouchEvent, TouchpadEvent

public class Event extends Pointer
Represents windowing system events.

In GTK applications the events are handled automatically by toplevel
widgets and passed on to the event controllers of appropriate widgets,
so using `GdkEvent` and its related API is rarely needed.

`GdkEvent` structs are immutable.

https://docs.gtk.org/gdk4/class.Event.html

  • Konstruktordetails

  • Methodendetails

    • getClassHandler

      public static ClassHandler getClassHandler()
    • getDevice

      public Device getDevice()
      Returns the device of an event.
      Gibt zurück:
      a `GdkDevice`
    • getDeviceTool

      public DeviceTool getDeviceTool()
      Returns a `GdkDeviceTool` representing the tool that
      caused the event.

      If the was not generated by a device that supports
      different tools (such as a tablet), this function will
      return %NULL.

      Note: the `GdkDeviceTool` will be constant during
      the application lifetime, if settings must be stored
      persistently across runs, see [method@Gdk.DeviceTool.get_serial].
      Gibt zurück:
      The current device tool
    • getDisplay

      public Display getDisplay()
      Retrieves the display associated to the @event.
      Gibt zurück:
      a `GdkDisplay`
    • getEventSequence

      public EventSequence getEventSequence()
      Returns the event sequence to which the event belongs.

      Related touch events are connected in a sequence. Other
      events typically don't have event sequence information.
      Gibt zurück:
      the event sequence that the event belongs to
    • getEventType

      public int getEventType()
      Retrieves the type of the event.
      Gibt zurück:
      a `GdkEvent`Type
    • getModifierState

      public int getModifierState()
      Returns the modifier state field of an event.
      Gibt zurück:
      the modifier state of @event
    • getPointerEmulated

      public boolean getPointerEmulated()
      Returns whether this event is an 'emulated' pointer event.

      Emulated pointer events typically originate from a touch events.
      Gibt zurück:
      %TRUE if this event is emulated
    • getSeat

      public Seat getSeat()
      Returns the seat that originated the event.
      Gibt zurück:
      a `GdkSeat`.
    • getSurface

      public Surface getSurface()
      Extracts the surface associated with an event.
      Gibt zurück:
      The `GdkSurface` associated with the event
    • getTime

      public int getTime()
      Returns the timestamp of @event.

      Not all events have timestamps. In that case, this function
      returns %GDK_CURRENT_TIME.
      Gibt zurück:
      timestamp field from @event
    • ref

      public Event ref()
      Increase the ref count of @event.
      Gibt zurück:
      @event
    • triggersContextMenu

      public boolean triggersContextMenu()
      Returns whether a `GdkEvent` should trigger a context menu,
      according to platform conventions.

      The right mouse button typically triggers context menus.
      On macOS, Control+left mouse button also triggers.

      This function should always be used instead of simply checking for

      ```c
      event->button == GDK_BUTTON_SECONDARY
      ```
      Gibt zurück:
      %TRUE if the event should trigger a context menu.
    • unref

      public void unref()
      Decrease the ref count of @event.

      If the last reference is dropped, the structure is freed.
    • 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()