Package ch.bailu.gtk.gdk
Class Device
java.lang.Object
ch.bailu.gtk.type.Type
ch.bailu.gtk.type.Pointer
ch.bailu.gtk.gobject.Object
ch.bailu.gtk.gdk.Device
- All Implemented Interfaces:
PointerInterface
The `GdkDevice` object represents an input device, such
as a keyboard, a mouse, or a touchpad.
See the [class@Gdk.Seat] documentation for more information
about the various kinds of devices, and their relationships.
as a keyboard, a mouse, or a touchpad.
See the [class@Gdk.Seat] documentation for more information
about the various kinds of devices, and their relationships.
-
Nested Class Summary
Modifier and TypeClassDescriptionstatic interface
static interface
Nested classes/interfaces inherited from class ch.bailu.gtk.gobject.Object
Object.OnBindingTransformFunc, Object.OnDestroyNotify, Object.OnDuplicateFunc, Object.OnNotify, Object.OnToggleNotify, Object.OnWeakNotify
-
Field Summary
Fields inherited from class ch.bailu.gtk.gobject.Object
SIGNAL_ON_NOTIFY
-
Constructor Summary
-
Method Summary
Modifier and TypeMethodDescriptionboolean
Retrieves whether the Caps Lock modifier of the keyboard is locked.static ClassHandler
Retrieves the current tool for @device.int
Returns the direction of effective layout of the keyboard.Returns the `GdkDisplay` to which @device pertains.boolean
Determines whether the pointer follows device motion.static int
int
Retrieves the current modifier state of the keyboard.getName()
The name of the device, suitable for showing in a user interface.boolean
Retrieves whether the Num Lock modifier of the keyboard is locked.int
Retrieves the number of touch points associated to @device.static long
static TypeSystem.TypeSize
Returns the product ID of this device.boolean
Retrieves whether the Scroll Lock modifier of the keyboard is locked.getSeat()
Returns the `GdkSeat` the device belongs to.int
Determines the type of the device.int
Returns the timestamp of the last activity for this device.static long
static TypeSystem.TypeSize
Returns the vendor ID of this device.boolean
Determines if layouts for both right-to-left and
left-to-right languages are in use on the keyboard.onChanged
(Device.OnChanged signal) Connect to signal "changed".onToolChanged
(Device.OnToolChanged signal) Connect to signal "tool-changed".Methods inherited from class ch.bailu.gtk.gobject.Object
addToggleRef, bindProperty, bindProperty, bindPropertyFull, bindPropertyFull, bindPropertyWithClosures, bindPropertyWithClosures, compatControl, connect, connect, disconnect, disconnect, dupData, dupData, dupQdata, forceFloating, freezeNotify, get, get, getData, getData, getProperty, getProperty, getQdata, interfaceFindProperty, interfaceInstallProperty, isFloating, notify, notify, notifyByPspec, onNotify, ref, refSink, removeToggleRef, replaceData, replaceData, replaceQdata, runDispose, set, set, setData, setData, setDataFull, setDataFull, setProperty, setProperty, setQdata, setQdataFull, stealData, stealData, stealQdata, takeRef, thawNotify, unref, watchClosure, weakRef, weakUnref
Methods inherited from class ch.bailu.gtk.type.Pointer
asCPointer, cast, connectSignal, disconnectSignals, disconnectSignals, equals, hashCode, throwIfNull, throwNullPointerException, toString, unregisterCallbacks, unregisterCallbacks
Methods inherited from class ch.bailu.gtk.type.Type
asCPointer, asCPointer, asCPointerNotNull, asJnaPointer, asJnaPointer, asPointer, asPointer, cast, cast, throwIfNull
Methods inherited from class java.lang.Object
clone, finalize, getClass, notify, notifyAll, wait, wait, wait
Methods inherited from interface ch.bailu.gtk.type.PointerInterface
asCPointerNotNull, asJnaPointer, asPointer, isNotNull, isNull
-
Field Details
-
SIGNAL_ON_CHANGED
- See Also:
-
SIGNAL_ON_TOOL_CHANGED
- See Also:
-
-
Constructor Details
-
Device
-
-
Method Details
-
getClassHandler
-
getCapsLockState
public boolean getCapsLockState()Retrieves whether the Caps Lock modifier of the keyboard is locked.
This is only relevant for keyboard devices.- Returns:
- %TRUE if Caps Lock is on for @device
-
getDeviceTool
Retrieves the current tool for @device.- Returns:
- 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].- Returns:
- %PANGO_DIRECTION_LTR or %PANGO_DIRECTION_RTL if it can determine the direction. %PANGO_DIRECTION_NEUTRAL otherwise
-
getDisplay
Returns the `GdkDisplay` to which @device pertains.- Returns:
- 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.- Returns:
- %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.- Returns:
- the current modifier state
-
getName
The name of the device, suitable for showing in a user interface.- Returns:
- a name
-
getNumLockState
public boolean getNumLockState()Retrieves whether the Num Lock modifier of the keyboard is locked.
This is only relevant for keyboard devices.- Returns:
- %TRUE if Num Lock is on for @device
-
getNumTouches
public int getNumTouches()Retrieves the number of touch points associated to @device.- Returns:
- the number of touch points
-
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.- Returns:
- 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.- Returns:
- %TRUE if Scroll Lock is on for @device
-
getSeat
Returns the `GdkSeat` the device belongs to.- Returns:
- a `GdkSeat`
-
getSource
public int getSource()Determines the type of the device.- Returns:
- 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).- Returns:
- the timestamp of the last activity for this device
-
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;
}
```- Returns:
- 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.- Returns:
- %TRUE if there are layouts with both directions, %FALSE otherwise
-
onChanged
Connect to signal "changed".
SeeDevice.OnChanged.onChanged()
for signal description.
FieldSIGNAL_ON_CHANGED
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.
-
onToolChanged
Connect to signal "tool-changed".
SeeDevice.OnToolChanged.onToolChanged(ch.bailu.gtk.gdk.DeviceTool)
for signal description.
FieldSIGNAL_ON_TOOL_CHANGED
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
-
getParentTypeSize
-
getInstanceSize
public static int getInstanceSize()
-