Klasse Device

Alle implementierten Schnittstellen:
PointerInterface

public class Device extends PropertyHolder
Represents an input device, such as a keyboard, mouse or touchpad.

See the [class@Gdk.Seat] documentation for more information
about the various kinds of devices, and their relationships.

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

  • Felddetails

  • Konstruktordetails

  • Methodendetails

    • getClassHandler

      public static ClassHandler getClassHandler()
    • getActiveLayoutIndex

      public int getActiveLayoutIndex()
      Retrieves the index of the active layout of the keyboard.

      If there is no valid active layout for the `GdkDevice`, this function will
      return -1;

      This is only relevant for keyboard devices.
      Gibt zurück:
      The layout index of the active layout or -1.
    • getCapsLockState

      public boolean getCapsLockState()
      Retrieves whether the Caps Lock modifier of the keyboard is locked.

      This is only relevant for keyboard devices.
      Gibt zurück:
      %TRUE if Caps Lock is on for @device
    • getDeviceTool

      public DeviceTool getDeviceTool()
      Retrieves the current tool for @device.
      Gibt zurück:
      the `GdkDeviceTool`
    • getDirection

      public int getDirection()
      Returns the direction of effective layout of the keyboard.

      This is only relevant for keyboard devices.

      The direction of a layout is the direction of the majority
      of its symbols. See [func@Pango.unichar_direction].
      Gibt zurück:
      %PANGO_DIRECTION_LTR or %PANGO_DIRECTION_RTL if it can determine the direction. %PANGO_DIRECTION_NEUTRAL otherwise
    • getDisplay

      public Display getDisplay()
      Returns the `GdkDisplay` to which @device pertains.
      Gibt zurück:
      a `GdkDisplay`
    • getHasCursor

      public boolean getHasCursor()
      Determines whether the pointer follows device motion.

      This is not meaningful for keyboard devices, which
      don't have a pointer.
      Gibt zurück:
      %TRUE if the pointer follows device motion
    • getModifierState

      public int getModifierState()
      Retrieves the current modifier state of the keyboard.

      This is only relevant for keyboard devices.
      Gibt zurück:
      the current modifier state
    • getName

      public Str getName()
      The name of the device, suitable for showing in a user interface.
      Gibt zurück:
      a name
    • getNumLockState

      public boolean getNumLockState()
      Retrieves whether the Num Lock modifier of the keyboard is locked.

      This is only relevant for keyboard devices.
      Gibt zurück:
      %TRUE if Num Lock is on for @device
    • getNumTouches

      public int getNumTouches()
      Retrieves the number of touch points associated to @device.
      Gibt zurück:
      the number of touch points
    • getProductId

      public Str getProductId()
      Returns the product ID of this device.

      This ID is retrieved from the device, and does not change.
      See [method@Gdk.Device.get_vendor_id] for more information.
      Gibt zurück:
      the product ID
    • getScrollLockState

      public boolean getScrollLockState()
      Retrieves whether the Scroll Lock modifier of the keyboard is locked.

      This is only relevant for keyboard devices.
      Gibt zurück:
      %TRUE if Scroll Lock is on for @device
    • getSeat

      public Seat getSeat()
      Returns the `GdkSeat` the device belongs to.
      Gibt zurück:
      a `GdkSeat`
    • getSource

      public int getSource()
      Determines the type of the device.
      Gibt zurück:
      a `GdkInputSource`
    • getTimestamp

      public int getTimestamp()
      Returns the timestamp of the last activity for this device.

      In practice, this means the timestamp of the last event that was
      received from the OS for this device. (GTK may occasionally produce
      events for a device that are not received from the OS, and will not
      update the timestamp).
      Gibt zurück:
      the timestamp of the last activity for this device
    • getVendorId

      public Str getVendorId()
      Returns the vendor ID of this device.

      This ID is retrieved from the device, and does not change.

      This function, together with [method@Gdk.Device.get_product_id],
      can be used to eg. compose `GSettings` paths to store settings
      for this device.

      ```c
      static GSettings *
      get_device_settings (GdkDevice *device)
      {
      const char *vendor, *product;
      GSettings *settings;
      GdkDevice *device;
      char *path;

      vendor = gdk_device_get_vendor_id (device);
      product = gdk_device_get_product_id (device);

      path = g_strdup_printf ("/org/example/app/devices/%s:%s/", vendor, product);
      settings = g_settings_new_with_path (DEVICE_SCHEMA, path);
      g_free (path);

      return settings;
      }
      ```
      Gibt zurück:
      the vendor ID
    • hasBidiLayouts

      public boolean hasBidiLayouts()
      Determines if layouts for both right-to-left and
      left-to-right languages are in use on the keyboard.

      This is only relevant for keyboard devices.
      Gibt zurück:
      %TRUE if there are layouts with both directions, %FALSE otherwise
    • onChanged

      public SignalHandler onChanged(Device.OnChanged signal)
      Connect to signal "changed".
      See Device.OnChanged.onChanged() for signal description.
      Field SIGNAL_ON_CHANGED contains original signal name and can be used as resource reference.
      Parameter:
      signal - callback function (lambda).
      Gibt zurück:
      SignalHandler. Can be used to disconnect signal and to release callback function.
    • onToolChanged

      public SignalHandler onToolChanged(Device.OnToolChanged signal)
      Connect to signal "tool-changed".
      See Device.OnToolChanged.onToolChanged(ch.bailu.gtk.gdk.DeviceTool) for signal description.
      Field SIGNAL_ON_TOOL_CHANGED contains original signal name and can be used as resource reference.
      Parameter:
      signal - callback function (lambda).
      Gibt zurück:
      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()