DeviceProtocol
public protocol DeviceProtocol : ObjectProtocol
The DeviceProtocol protocol exposes the methods and properties of an underlying GdkDevice instance.
The default implementation of these can be found in the protocol extension below.
For a concrete class that implements these methods and properties, see Device.
Alternatively, use DeviceRef as a lighweight, unowned reference if you already have an instance you just want to use.
The GdkDevice object represents an input device, such
as a keyboard, a mouse, or a touchpad.
See the [classGdk.Seat] documentation for more information
about the various kinds of devices, and their relationships.
-
Untyped pointer to the underlying
GdkDeviceinstance.Declaration
Swift
var ptr: UnsafeMutableRawPointer! { get } -
device_ptrDefault implementationTyped pointer to the underlying
GdkDeviceinstance.Default Implementation
Return the stored, untyped pointer as a typed pointer to the
GdkDeviceinstance.Declaration
Swift
var device_ptr: UnsafeMutablePointer<GdkDevice>! { get } -
Required Initialiser for types conforming to
DeviceProtocolDeclaration
Swift
init(raw: UnsafeMutableRawPointer)
-
bind(property:Extension methodto: _: flags: transformFrom: transformTo: ) Bind a
DevicePropertyNamesource property to a given target object.Declaration
Swift
@discardableResult @inlinable func bind<Q, T>(property source_property: DevicePropertyName, to target: T, _ target_property: Q, flags f: BindingFlags = .default, transformFrom transform_from: @escaping GLibObject.ValueTransformer = { $0.transform(destValue: $1) }, transformTo transform_to: @escaping GLibObject.ValueTransformer = { $0.transform(destValue: $1) }) -> BindingRef! where Q : PropertyNameProtocol, T : ObjectProtocolParameters
source_propertythe source property to bind
targetthe target object to bind to
target_propertythe target property to bind to
flagsthe flags to pass to the
Bindingtransform_fromValueTransformerto use for forward transformationtransform_toValueTransformerto use for backwards transformationReturn Value
binding reference or
nilin case of an error -
get(property:Extension method) Get the value of a Device property
Declaration
Swift
@inlinable func get(property: DevicePropertyName) -> GLibObject.ValueParameters
propertythe property to get the value for
Return Value
the value of the named property
-
set(property:Extension methodvalue: ) Set the value of a Device property. Note that this will only have an effect on properties that are writable and not construct-only!
Declaration
Swift
@inlinable func set(property: DevicePropertyName, value v: GLibObject.Value)Parameters
propertythe property to get the value for
Return Value
the value of the named property
-
connect(signal:Extension methodflags: handler: ) Connect a Swift signal handler to the given, typed
DeviceSignalNamesignalDeclaration
Swift
@discardableResult @inlinable func connect(signal s: DeviceSignalName, flags f: ConnectFlags = ConnectFlags(0), handler h: @escaping SignalHandler) -> IntParameters
signalThe signal to connect
flagsThe connection flags to use
dataA pointer to user data to provide to the callback
destroyDataA
GClosureNotifyC function to destroy the data pointed to byuserDatahandlerThe Swift signal handler (function or callback) to invoke on the given signal
Return Value
The signal handler ID (always greater than 0 for successful connections)
-
connect(signal:Extension methodflags: data: destroyData: signalHandler: ) Connect a C signal handler to the given, typed
DeviceSignalNamesignalDeclaration
Swift
@discardableResult @inlinable func connect(signal s: DeviceSignalName, flags f: ConnectFlags = ConnectFlags(0), data userData: gpointer!, destroyData destructor: GClosureNotify? = nil, signalHandler h: @escaping GCallback) -> IntParameters
signalThe signal to connect
flagsThe connection flags to use
dataA pointer to user data to provide to the callback
destroyDataA
GClosureNotifyC function to destroy the data pointed to byuserDatasignalHandlerThe C function to be called on the given signal
Return Value
The signal handler ID (always greater than 0 for successful connections)
-
onChanged(flags:Extension methodhandler: ) Emitted either when the the number of either axes or keys changes.
On X11 this will normally happen when the physical device routing events through the logical device changes (for example, user switches from the USB mouse to a tablet); in that case the logical device will change to reflect the axes and keys on the new physical device.
Note
This represents the underlyingchangedsignalDeclaration
Swift
@discardableResult @inlinable func onChanged(flags: ConnectFlags = ConnectFlags(0), handler: @escaping (_ unownedSelf: DeviceRef) -> Void) -> IntParameters
flagsFlags
unownedSelfReference to instance of self
handlerThe signal handler to call Run the given callback whenever the
changedsignal is emitted -
changedSignalExtension methodTyped
changedsignal for using theconnect(signal:)methodsDeclaration
Swift
static var changedSignal: DeviceSignalName { get } -
onToolChanged(flags:Extension methodhandler: ) Emitted on pen/eraser devices whenever tools enter or leave proximity.
Note
This represents the underlyingtool-changedsignalDeclaration
Swift
@discardableResult @inlinable func onToolChanged(flags: ConnectFlags = ConnectFlags(0), handler: @escaping (_ unownedSelf: DeviceRef, _ tool: DeviceToolRef) -> Void) -> IntParameters
flagsFlags
unownedSelfReference to instance of self
toolThe new current tool
handlerThe signal handler to call Run the given callback whenever the
toolChangedsignal is emitted -
toolChangedSignalExtension methodTyped
tool-changedsignal for using theconnect(signal:)methodsDeclaration
Swift
static var toolChangedSignal: DeviceSignalName { get } -
onNotifyCapsLockState(flags:Extension methodhandler: ) The notify signal is emitted on an object when one of its properties has its value set through
g_object_set_property(),g_object_set(), et al.Note that getting this signal doesn’t itself guarantee that the value of the property has actually changed. When it is emitted is determined by the derived GObject class. If the implementor did not create the property with
G_PARAM_EXPLICIT_NOTIFY, then any call tog_object_set_property()results innotifybeing emitted, even if the new value is the same as the old. If they did passG_PARAM_EXPLICIT_NOTIFY, then this signal is emitted only when they explicitly callg_object_notify()org_object_notify_by_pspec(), and common practice is to do that only when the value has actually changed.This signal is typically used to obtain change notification for a single property, by specifying the property name as a detail in the
g_signal_connect()call, like this: (C Language Example):g_signal_connect (text_view->buffer, "notify::paste-target-list", G_CALLBACK (gtk_text_view_target_list_notify), text_view)It is important to note that you must use canonical parameter names as detail strings for the notify signal.
Note
This represents the underlyingnotify::caps-lock-statesignalDeclaration
Swift
@discardableResult @inlinable func onNotifyCapsLockState(flags: ConnectFlags = ConnectFlags(0), handler: @escaping (_ unownedSelf: DeviceRef, _ pspec: ParamSpecRef) -> Void) -> IntParameters
flagsFlags
unownedSelfReference to instance of self
pspecthe
GParamSpecof the property which changed.handlerThe signal handler to call Run the given callback whenever the
notifyCapsLockStatesignal is emitted -
notifyCapsLockStateSignalExtension methodTyped
notify::caps-lock-statesignal for using theconnect(signal:)methodsDeclaration
Swift
static var notifyCapsLockStateSignal: DeviceSignalName { get } -
onNotifyDirection(flags:Extension methodhandler: ) The notify signal is emitted on an object when one of its properties has its value set through
g_object_set_property(),g_object_set(), et al.Note that getting this signal doesn’t itself guarantee that the value of the property has actually changed. When it is emitted is determined by the derived GObject class. If the implementor did not create the property with
G_PARAM_EXPLICIT_NOTIFY, then any call tog_object_set_property()results innotifybeing emitted, even if the new value is the same as the old. If they did passG_PARAM_EXPLICIT_NOTIFY, then this signal is emitted only when they explicitly callg_object_notify()org_object_notify_by_pspec(), and common practice is to do that only when the value has actually changed.This signal is typically used to obtain change notification for a single property, by specifying the property name as a detail in the
g_signal_connect()call, like this: (C Language Example):g_signal_connect (text_view->buffer, "notify::paste-target-list", G_CALLBACK (gtk_text_view_target_list_notify), text_view)It is important to note that you must use canonical parameter names as detail strings for the notify signal.
Note
This represents the underlyingnotify::directionsignalDeclaration
Swift
@discardableResult @inlinable func onNotifyDirection(flags: ConnectFlags = ConnectFlags(0), handler: @escaping (_ unownedSelf: DeviceRef, _ pspec: ParamSpecRef) -> Void) -> IntParameters
flagsFlags
unownedSelfReference to instance of self
pspecthe
GParamSpecof the property which changed.handlerThe signal handler to call Run the given callback whenever the
notifyDirectionsignal is emitted -
notifyDirectionSignalExtension methodTyped
notify::directionsignal for using theconnect(signal:)methodsDeclaration
Swift
static var notifyDirectionSignal: DeviceSignalName { get } -
onNotifyDisplay(flags:Extension methodhandler: ) The notify signal is emitted on an object when one of its properties has its value set through
g_object_set_property(),g_object_set(), et al.Note that getting this signal doesn’t itself guarantee that the value of the property has actually changed. When it is emitted is determined by the derived GObject class. If the implementor did not create the property with
G_PARAM_EXPLICIT_NOTIFY, then any call tog_object_set_property()results innotifybeing emitted, even if the new value is the same as the old. If they did passG_PARAM_EXPLICIT_NOTIFY, then this signal is emitted only when they explicitly callg_object_notify()org_object_notify_by_pspec(), and common practice is to do that only when the value has actually changed.This signal is typically used to obtain change notification for a single property, by specifying the property name as a detail in the
g_signal_connect()call, like this: (C Language Example):g_signal_connect (text_view->buffer, "notify::paste-target-list", G_CALLBACK (gtk_text_view_target_list_notify), text_view)It is important to note that you must use canonical parameter names as detail strings for the notify signal.
Note
This represents the underlyingnotify::displaysignalDeclaration
Swift
@discardableResult @inlinable func onNotifyDisplay(flags: ConnectFlags = ConnectFlags(0), handler: @escaping (_ unownedSelf: DeviceRef, _ pspec: ParamSpecRef) -> Void) -> IntParameters
flagsFlags
unownedSelfReference to instance of self
pspecthe
GParamSpecof the property which changed.handlerThe signal handler to call Run the given callback whenever the
notifyDisplaysignal is emitted -
notifyDisplaySignalExtension methodTyped
notify::displaysignal for using theconnect(signal:)methodsDeclaration
Swift
static var notifyDisplaySignal: DeviceSignalName { get } -
onNotifyHasBidiLayouts(flags:Extension methodhandler: ) The notify signal is emitted on an object when one of its properties has its value set through
g_object_set_property(),g_object_set(), et al.Note that getting this signal doesn’t itself guarantee that the value of the property has actually changed. When it is emitted is determined by the derived GObject class. If the implementor did not create the property with
G_PARAM_EXPLICIT_NOTIFY, then any call tog_object_set_property()results innotifybeing emitted, even if the new value is the same as the old. If they did passG_PARAM_EXPLICIT_NOTIFY, then this signal is emitted only when they explicitly callg_object_notify()org_object_notify_by_pspec(), and common practice is to do that only when the value has actually changed.This signal is typically used to obtain change notification for a single property, by specifying the property name as a detail in the
g_signal_connect()call, like this: (C Language Example):g_signal_connect (text_view->buffer, "notify::paste-target-list", G_CALLBACK (gtk_text_view_target_list_notify), text_view)It is important to note that you must use canonical parameter names as detail strings for the notify signal.
Note
This represents the underlyingnotify::has-bidi-layoutssignalDeclaration
Swift
@discardableResult @inlinable func onNotifyHasBidiLayouts(flags: ConnectFlags = ConnectFlags(0), handler: @escaping (_ unownedSelf: DeviceRef, _ pspec: ParamSpecRef) -> Void) -> IntParameters
flagsFlags
unownedSelfReference to instance of self
pspecthe
GParamSpecof the property which changed.handlerThe signal handler to call Run the given callback whenever the
notifyHasBidiLayoutssignal is emitted -
notifyHasBidiLayoutsSignalExtension methodTyped
notify::has-bidi-layoutssignal for using theconnect(signal:)methodsDeclaration
Swift
static var notifyHasBidiLayoutsSignal: DeviceSignalName { get } -
onNotifyHasCursor(flags:Extension methodhandler: ) The notify signal is emitted on an object when one of its properties has its value set through
g_object_set_property(),g_object_set(), et al.Note that getting this signal doesn’t itself guarantee that the value of the property has actually changed. When it is emitted is determined by the derived GObject class. If the implementor did not create the property with
G_PARAM_EXPLICIT_NOTIFY, then any call tog_object_set_property()results innotifybeing emitted, even if the new value is the same as the old. If they did passG_PARAM_EXPLICIT_NOTIFY, then this signal is emitted only when they explicitly callg_object_notify()org_object_notify_by_pspec(), and common practice is to do that only when the value has actually changed.This signal is typically used to obtain change notification for a single property, by specifying the property name as a detail in the
g_signal_connect()call, like this: (C Language Example):g_signal_connect (text_view->buffer, "notify::paste-target-list", G_CALLBACK (gtk_text_view_target_list_notify), text_view)It is important to note that you must use canonical parameter names as detail strings for the notify signal.
Note
This represents the underlyingnotify::has-cursorsignalDeclaration
Swift
@discardableResult @inlinable func onNotifyHasCursor(flags: ConnectFlags = ConnectFlags(0), handler: @escaping (_ unownedSelf: DeviceRef, _ pspec: ParamSpecRef) -> Void) -> IntParameters
flagsFlags
unownedSelfReference to instance of self
pspecthe
GParamSpecof the property which changed.handlerThe signal handler to call Run the given callback whenever the
notifyHasCursorsignal is emitted -
notifyHasCursorSignalExtension methodTyped
notify::has-cursorsignal for using theconnect(signal:)methodsDeclaration
Swift
static var notifyHasCursorSignal: DeviceSignalName { get } -
onNotifyModifierState(flags:Extension methodhandler: ) The notify signal is emitted on an object when one of its properties has its value set through
g_object_set_property(),g_object_set(), et al.Note that getting this signal doesn’t itself guarantee that the value of the property has actually changed. When it is emitted is determined by the derived GObject class. If the implementor did not create the property with
G_PARAM_EXPLICIT_NOTIFY, then any call tog_object_set_property()results innotifybeing emitted, even if the new value is the same as the old. If they did passG_PARAM_EXPLICIT_NOTIFY, then this signal is emitted only when they explicitly callg_object_notify()org_object_notify_by_pspec(), and common practice is to do that only when the value has actually changed.This signal is typically used to obtain change notification for a single property, by specifying the property name as a detail in the
g_signal_connect()call, like this: (C Language Example):g_signal_connect (text_view->buffer, "notify::paste-target-list", G_CALLBACK (gtk_text_view_target_list_notify), text_view)It is important to note that you must use canonical parameter names as detail strings for the notify signal.
Note
This represents the underlyingnotify::modifier-statesignalDeclaration
Swift
@discardableResult @inlinable func onNotifyModifierState(flags: ConnectFlags = ConnectFlags(0), handler: @escaping (_ unownedSelf: DeviceRef, _ pspec: ParamSpecRef) -> Void) -> IntParameters
flagsFlags
unownedSelfReference to instance of self
pspecthe
GParamSpecof the property which changed.handlerThe signal handler to call Run the given callback whenever the
notifyModifierStatesignal is emitted -
notifyModifierStateSignalExtension methodTyped
notify::modifier-statesignal for using theconnect(signal:)methodsDeclaration
Swift
static var notifyModifierStateSignal: DeviceSignalName { get } -
onNotifyNAxes(flags:Extension methodhandler: ) The notify signal is emitted on an object when one of its properties has its value set through
g_object_set_property(),g_object_set(), et al.Note that getting this signal doesn’t itself guarantee that the value of the property has actually changed. When it is emitted is determined by the derived GObject class. If the implementor did not create the property with
G_PARAM_EXPLICIT_NOTIFY, then any call tog_object_set_property()results innotifybeing emitted, even if the new value is the same as the old. If they did passG_PARAM_EXPLICIT_NOTIFY, then this signal is emitted only when they explicitly callg_object_notify()org_object_notify_by_pspec(), and common practice is to do that only when the value has actually changed.This signal is typically used to obtain change notification for a single property, by specifying the property name as a detail in the
g_signal_connect()call, like this: (C Language Example):g_signal_connect (text_view->buffer, "notify::paste-target-list", G_CALLBACK (gtk_text_view_target_list_notify), text_view)It is important to note that you must use canonical parameter names as detail strings for the notify signal.
Note
This represents the underlyingnotify::n-axessignalDeclaration
Swift
@discardableResult @inlinable func onNotifyNAxes(flags: ConnectFlags = ConnectFlags(0), handler: @escaping (_ unownedSelf: DeviceRef, _ pspec: ParamSpecRef) -> Void) -> IntParameters
flagsFlags
unownedSelfReference to instance of self
pspecthe
GParamSpecof the property which changed.handlerThe signal handler to call Run the given callback whenever the
notifyNAxessignal is emitted -
notifyNAxesSignalExtension methodTyped
notify::n-axessignal for using theconnect(signal:)methodsDeclaration
Swift
static var notifyNAxesSignal: DeviceSignalName { get } -
onNotifyName(flags:Extension methodhandler: ) The notify signal is emitted on an object when one of its properties has its value set through
g_object_set_property(),g_object_set(), et al.Note that getting this signal doesn’t itself guarantee that the value of the property has actually changed. When it is emitted is determined by the derived GObject class. If the implementor did not create the property with
G_PARAM_EXPLICIT_NOTIFY, then any call tog_object_set_property()results innotifybeing emitted, even if the new value is the same as the old. If they did passG_PARAM_EXPLICIT_NOTIFY, then this signal is emitted only when they explicitly callg_object_notify()org_object_notify_by_pspec(), and common practice is to do that only when the value has actually changed.This signal is typically used to obtain change notification for a single property, by specifying the property name as a detail in the
g_signal_connect()call, like this: (C Language Example):g_signal_connect (text_view->buffer, "notify::paste-target-list", G_CALLBACK (gtk_text_view_target_list_notify), text_view)It is important to note that you must use canonical parameter names as detail strings for the notify signal.
Note
This represents the underlyingnotify::namesignalDeclaration
Swift
@discardableResult @inlinable func onNotifyName(flags: ConnectFlags = ConnectFlags(0), handler: @escaping (_ unownedSelf: DeviceRef, _ pspec: ParamSpecRef) -> Void) -> IntParameters
flagsFlags
unownedSelfReference to instance of self
pspecthe
GParamSpecof the property which changed.handlerThe signal handler to call Run the given callback whenever the
notifyNamesignal is emitted -
notifyNameSignalExtension methodTyped
notify::namesignal for using theconnect(signal:)methodsDeclaration
Swift
static var notifyNameSignal: DeviceSignalName { get } -
onNotifyNumLockState(flags:Extension methodhandler: ) The notify signal is emitted on an object when one of its properties has its value set through
g_object_set_property(),g_object_set(), et al.Note that getting this signal doesn’t itself guarantee that the value of the property has actually changed. When it is emitted is determined by the derived GObject class. If the implementor did not create the property with
G_PARAM_EXPLICIT_NOTIFY, then any call tog_object_set_property()results innotifybeing emitted, even if the new value is the same as the old. If they did passG_PARAM_EXPLICIT_NOTIFY, then this signal is emitted only when they explicitly callg_object_notify()org_object_notify_by_pspec(), and common practice is to do that only when the value has actually changed.This signal is typically used to obtain change notification for a single property, by specifying the property name as a detail in the
g_signal_connect()call, like this: (C Language Example):g_signal_connect (text_view->buffer, "notify::paste-target-list", G_CALLBACK (gtk_text_view_target_list_notify), text_view)It is important to note that you must use canonical parameter names as detail strings for the notify signal.
Note
This represents the underlyingnotify::num-lock-statesignalDeclaration
Swift
@discardableResult @inlinable func onNotifyNumLockState(flags: ConnectFlags = ConnectFlags(0), handler: @escaping (_ unownedSelf: DeviceRef, _ pspec: ParamSpecRef) -> Void) -> IntParameters
flagsFlags
unownedSelfReference to instance of self
pspecthe
GParamSpecof the property which changed.handlerThe signal handler to call Run the given callback whenever the
notifyNumLockStatesignal is emitted -
notifyNumLockStateSignalExtension methodTyped
notify::num-lock-statesignal for using theconnect(signal:)methodsDeclaration
Swift
static var notifyNumLockStateSignal: DeviceSignalName { get } -
onNotifyNumTouches(flags:Extension methodhandler: ) The notify signal is emitted on an object when one of its properties has its value set through
g_object_set_property(),g_object_set(), et al.Note that getting this signal doesn’t itself guarantee that the value of the property has actually changed. When it is emitted is determined by the derived GObject class. If the implementor did not create the property with
G_PARAM_EXPLICIT_NOTIFY, then any call tog_object_set_property()results innotifybeing emitted, even if the new value is the same as the old. If they did passG_PARAM_EXPLICIT_NOTIFY, then this signal is emitted only when they explicitly callg_object_notify()org_object_notify_by_pspec(), and common practice is to do that only when the value has actually changed.This signal is typically used to obtain change notification for a single property, by specifying the property name as a detail in the
g_signal_connect()call, like this: (C Language Example):g_signal_connect (text_view->buffer, "notify::paste-target-list", G_CALLBACK (gtk_text_view_target_list_notify), text_view)It is important to note that you must use canonical parameter names as detail strings for the notify signal.
Note
This represents the underlyingnotify::num-touchessignalDeclaration
Swift
@discardableResult @inlinable func onNotifyNumTouches(flags: ConnectFlags = ConnectFlags(0), handler: @escaping (_ unownedSelf: DeviceRef, _ pspec: ParamSpecRef) -> Void) -> IntParameters
flagsFlags
unownedSelfReference to instance of self
pspecthe
GParamSpecof the property which changed.handlerThe signal handler to call Run the given callback whenever the
notifyNumTouchessignal is emitted -
notifyNumTouchesSignalExtension methodTyped
notify::num-touchessignal for using theconnect(signal:)methodsDeclaration
Swift
static var notifyNumTouchesSignal: DeviceSignalName { get } -
onNotifyProductId(flags:Extension methodhandler: ) The notify signal is emitted on an object when one of its properties has its value set through
g_object_set_property(),g_object_set(), et al.Note that getting this signal doesn’t itself guarantee that the value of the property has actually changed. When it is emitted is determined by the derived GObject class. If the implementor did not create the property with
G_PARAM_EXPLICIT_NOTIFY, then any call tog_object_set_property()results innotifybeing emitted, even if the new value is the same as the old. If they did passG_PARAM_EXPLICIT_NOTIFY, then this signal is emitted only when they explicitly callg_object_notify()org_object_notify_by_pspec(), and common practice is to do that only when the value has actually changed.This signal is typically used to obtain change notification for a single property, by specifying the property name as a detail in the
g_signal_connect()call, like this: (C Language Example):g_signal_connect (text_view->buffer, "notify::paste-target-list", G_CALLBACK (gtk_text_view_target_list_notify), text_view)It is important to note that you must use canonical parameter names as detail strings for the notify signal.
Note
This represents the underlyingnotify::product-idsignalDeclaration
Swift
@discardableResult @inlinable func onNotifyProductId(flags: ConnectFlags = ConnectFlags(0), handler: @escaping (_ unownedSelf: DeviceRef, _ pspec: ParamSpecRef) -> Void) -> IntParameters
flagsFlags
unownedSelfReference to instance of self
pspecthe
GParamSpecof the property which changed.handlerThe signal handler to call Run the given callback whenever the
notifyProductIdsignal is emitted -
notifyProductIdSignalExtension methodTyped
notify::product-idsignal for using theconnect(signal:)methodsDeclaration
Swift
static var notifyProductIdSignal: DeviceSignalName { get } -
onNotifyScrollLockState(flags:Extension methodhandler: ) The notify signal is emitted on an object when one of its properties has its value set through
g_object_set_property(),g_object_set(), et al.Note that getting this signal doesn’t itself guarantee that the value of the property has actually changed. When it is emitted is determined by the derived GObject class. If the implementor did not create the property with
G_PARAM_EXPLICIT_NOTIFY, then any call tog_object_set_property()results innotifybeing emitted, even if the new value is the same as the old. If they did passG_PARAM_EXPLICIT_NOTIFY, then this signal is emitted only when they explicitly callg_object_notify()org_object_notify_by_pspec(), and common practice is to do that only when the value has actually changed.This signal is typically used to obtain change notification for a single property, by specifying the property name as a detail in the
g_signal_connect()call, like this: (C Language Example):g_signal_connect (text_view->buffer, "notify::paste-target-list", G_CALLBACK (gtk_text_view_target_list_notify), text_view)It is important to note that you must use canonical parameter names as detail strings for the notify signal.
Note
This represents the underlyingnotify::scroll-lock-statesignalDeclaration
Swift
@discardableResult @inlinable func onNotifyScrollLockState(flags: ConnectFlags = ConnectFlags(0), handler: @escaping (_ unownedSelf: DeviceRef, _ pspec: ParamSpecRef) -> Void) -> IntParameters
flagsFlags
unownedSelfReference to instance of self
pspecthe
GParamSpecof the property which changed.handlerThe signal handler to call Run the given callback whenever the
notifyScrollLockStatesignal is emitted -
notifyScrollLockStateSignalExtension methodTyped
notify::scroll-lock-statesignal for using theconnect(signal:)methodsDeclaration
Swift
static var notifyScrollLockStateSignal: DeviceSignalName { get } -
onNotifySeat(flags:Extension methodhandler: ) The notify signal is emitted on an object when one of its properties has its value set through
g_object_set_property(),g_object_set(), et al.Note that getting this signal doesn’t itself guarantee that the value of the property has actually changed. When it is emitted is determined by the derived GObject class. If the implementor did not create the property with
G_PARAM_EXPLICIT_NOTIFY, then any call tog_object_set_property()results innotifybeing emitted, even if the new value is the same as the old. If they did passG_PARAM_EXPLICIT_NOTIFY, then this signal is emitted only when they explicitly callg_object_notify()org_object_notify_by_pspec(), and common practice is to do that only when the value has actually changed.This signal is typically used to obtain change notification for a single property, by specifying the property name as a detail in the
g_signal_connect()call, like this: (C Language Example):g_signal_connect (text_view->buffer, "notify::paste-target-list", G_CALLBACK (gtk_text_view_target_list_notify), text_view)It is important to note that you must use canonical parameter names as detail strings for the notify signal.
Note
This represents the underlyingnotify::seatsignalDeclaration
Swift
@discardableResult @inlinable func onNotifySeat(flags: ConnectFlags = ConnectFlags(0), handler: @escaping (_ unownedSelf: DeviceRef, _ pspec: ParamSpecRef) -> Void) -> IntParameters
flagsFlags
unownedSelfReference to instance of self
pspecthe
GParamSpecof the property which changed.handlerThe signal handler to call Run the given callback whenever the
notifySeatsignal is emitted -
notifySeatSignalExtension methodTyped
notify::seatsignal for using theconnect(signal:)methodsDeclaration
Swift
static var notifySeatSignal: DeviceSignalName { get } -
onNotifySource(flags:Extension methodhandler: ) The notify signal is emitted on an object when one of its properties has its value set through
g_object_set_property(),g_object_set(), et al.Note that getting this signal doesn’t itself guarantee that the value of the property has actually changed. When it is emitted is determined by the derived GObject class. If the implementor did not create the property with
G_PARAM_EXPLICIT_NOTIFY, then any call tog_object_set_property()results innotifybeing emitted, even if the new value is the same as the old. If they did passG_PARAM_EXPLICIT_NOTIFY, then this signal is emitted only when they explicitly callg_object_notify()org_object_notify_by_pspec(), and common practice is to do that only when the value has actually changed.This signal is typically used to obtain change notification for a single property, by specifying the property name as a detail in the
g_signal_connect()call, like this: (C Language Example):g_signal_connect (text_view->buffer, "notify::paste-target-list", G_CALLBACK (gtk_text_view_target_list_notify), text_view)It is important to note that you must use canonical parameter names as detail strings for the notify signal.
Note
This represents the underlyingnotify::sourcesignalDeclaration
Swift
@discardableResult @inlinable func onNotifySource(flags: ConnectFlags = ConnectFlags(0), handler: @escaping (_ unownedSelf: DeviceRef, _ pspec: ParamSpecRef) -> Void) -> IntParameters
flagsFlags
unownedSelfReference to instance of self
pspecthe
GParamSpecof the property which changed.handlerThe signal handler to call Run the given callback whenever the
notifySourcesignal is emitted -
notifySourceSignalExtension methodTyped
notify::sourcesignal for using theconnect(signal:)methodsDeclaration
Swift
static var notifySourceSignal: DeviceSignalName { get } -
onNotifyTool(flags:Extension methodhandler: ) The notify signal is emitted on an object when one of its properties has its value set through
g_object_set_property(),g_object_set(), et al.Note that getting this signal doesn’t itself guarantee that the value of the property has actually changed. When it is emitted is determined by the derived GObject class. If the implementor did not create the property with
G_PARAM_EXPLICIT_NOTIFY, then any call tog_object_set_property()results innotifybeing emitted, even if the new value is the same as the old. If they did passG_PARAM_EXPLICIT_NOTIFY, then this signal is emitted only when they explicitly callg_object_notify()org_object_notify_by_pspec(), and common practice is to do that only when the value has actually changed.This signal is typically used to obtain change notification for a single property, by specifying the property name as a detail in the
g_signal_connect()call, like this: (C Language Example):g_signal_connect (text_view->buffer, "notify::paste-target-list", G_CALLBACK (gtk_text_view_target_list_notify), text_view)It is important to note that you must use canonical parameter names as detail strings for the notify signal.
Note
This represents the underlyingnotify::toolsignalDeclaration
Swift
@discardableResult @inlinable func onNotifyTool(flags: ConnectFlags = ConnectFlags(0), handler: @escaping (_ unownedSelf: DeviceRef, _ pspec: ParamSpecRef) -> Void) -> IntParameters
flagsFlags
unownedSelfReference to instance of self
pspecthe
GParamSpecof the property which changed.handlerThe signal handler to call Run the given callback whenever the
notifyToolsignal is emitted -
notifyToolSignalExtension methodTyped
notify::toolsignal for using theconnect(signal:)methodsDeclaration
Swift
static var notifyToolSignal: DeviceSignalName { get } -
onNotifyVendorId(flags:Extension methodhandler: ) The notify signal is emitted on an object when one of its properties has its value set through
g_object_set_property(),g_object_set(), et al.Note that getting this signal doesn’t itself guarantee that the value of the property has actually changed. When it is emitted is determined by the derived GObject class. If the implementor did not create the property with
G_PARAM_EXPLICIT_NOTIFY, then any call tog_object_set_property()results innotifybeing emitted, even if the new value is the same as the old. If they did passG_PARAM_EXPLICIT_NOTIFY, then this signal is emitted only when they explicitly callg_object_notify()org_object_notify_by_pspec(), and common practice is to do that only when the value has actually changed.This signal is typically used to obtain change notification for a single property, by specifying the property name as a detail in the
g_signal_connect()call, like this: (C Language Example):g_signal_connect (text_view->buffer, "notify::paste-target-list", G_CALLBACK (gtk_text_view_target_list_notify), text_view)It is important to note that you must use canonical parameter names as detail strings for the notify signal.
Note
This represents the underlyingnotify::vendor-idsignalDeclaration
Swift
@discardableResult @inlinable func onNotifyVendorId(flags: ConnectFlags = ConnectFlags(0), handler: @escaping (_ unownedSelf: DeviceRef, _ pspec: ParamSpecRef) -> Void) -> IntParameters
flagsFlags
unownedSelfReference to instance of self
pspecthe
GParamSpecof the property which changed.handlerThe signal handler to call Run the given callback whenever the
notifyVendorIdsignal is emitted -
notifyVendorIdSignalExtension methodTyped
notify::vendor-idsignal for using theconnect(signal:)methodsDeclaration
Swift
static var notifyVendorIdSignal: DeviceSignalName { get }
-
getCapsLockState()Extension methodRetrieves whether the Caps Lock modifier of the keyboard is locked.
This is only relevant for keyboard devices.
Declaration
Swift
@inlinable func getCapsLockState() -> Bool -
getDeviceTool()Extension methodRetrieves the current tool for
device.Declaration
Swift
@inlinable func getDeviceTool() -> DeviceToolRef! -
getDirection()Extension methodReturns 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].Declaration
Swift
@inlinable func getDirection() -> PangoDirection -
getDisplay()Extension methodReturns the
GdkDisplayto whichdevicepertains.Declaration
Swift
@inlinable func getDisplay() -> DisplayRef! -
getHasCursor()Extension methodDetermines whether the pointer follows device motion.
This is not meaningful for keyboard devices, which don’t have a pointer.
Declaration
Swift
@inlinable func getHasCursor() -> Bool -
getModifierState()Extension methodRetrieves the current modifier state of the keyboard.
This is only relevant for keyboard devices.
Declaration
Swift
@inlinable func getModifierState() -> ModifierType -
getName()Extension methodThe name of the device, suitable for showing in a user interface.
Declaration
Swift
@inlinable func getName() -> String! -
getNumLockState()Extension methodRetrieves whether the Num Lock modifier of the keyboard is locked.
This is only relevant for keyboard devices.
Declaration
Swift
@inlinable func getNumLockState() -> Bool -
getNumTouches()Extension methodRetrieves the number of touch points associated to
device.Declaration
Swift
@inlinable func getNumTouches() -> Int -
getProductId()Extension methodReturns 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.Declaration
Swift
@inlinable func getProductId() -> String! -
getScrollLockState()Extension methodRetrieves whether the Scroll Lock modifier of the keyboard is locked.
This is only relevant for keyboard devices.
Declaration
Swift
@inlinable func getScrollLockState() -> Bool -
getSeat()Extension methodReturns the
GdkSeatthe device belongs to.Declaration
Swift
@inlinable func getSeat() -> SeatRef! -
getSource()Extension methodDetermines the type of the device.
Declaration
Swift
@inlinable func getSource() -> GdkInputSource -
getSurfaceAtPosition(winX:Extension methodwinY: ) Obtains the surface underneath
device, returning the location of the device inwin_xandwin_yReturns
nilif the surface tree underdeviceis not known to GDK (for example, belongs to another application).Declaration
Swift
@inlinable func getSurfaceAtPosition(winX: UnsafeMutablePointer<CDouble>! = nil, winY: UnsafeMutablePointer<CDouble>! = nil) -> SurfaceRef! -
getTimestamp()Extension methodReturns 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).
Declaration
Swift
@inlinable func getTimestamp() -> guint32 -
getVendorId()Extension methodReturns 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. composeGSettingspaths to store settings for this device.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; }Declaration
Swift
@inlinable func getVendorId() -> String! -
hasBidiLayouts()Extension methodDetermines 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.
Declaration
Swift
@inlinable func hasBidiLayouts() -> Bool -
capsLockStateExtension methodRetrieves whether the Caps Lock modifier of the keyboard is locked.
This is only relevant for keyboard devices.
Declaration
Swift
@inlinable var capsLockState: Bool { get } -
deviceToolExtension methodRetrieves the current tool for
device.Declaration
Swift
@inlinable var deviceTool: DeviceToolRef! { get } -
directionExtension methodThe direction of the current layout.
This is only relevant for keyboard devices.
Declaration
Swift
@inlinable var direction: PangoDirection { get } -
displayExtension methodThe
GdkDisplaytheGdkDevicepertains to.Declaration
Swift
@inlinable var display: DisplayRef! { get } -
hasCursorExtension methodDetermines whether the pointer follows device motion.
This is not meaningful for keyboard devices, which don’t have a pointer.
Declaration
Swift
@inlinable var hasCursor: Bool { get } -
modifierStateExtension methodRetrieves the current modifier state of the keyboard.
This is only relevant for keyboard devices.
Declaration
Swift
@inlinable var modifierState: ModifierType { get } -
nameExtension methodThe device name.
Declaration
Swift
@inlinable var name: String! { get } -
numLockStateExtension methodRetrieves whether the Num Lock modifier of the keyboard is locked.
This is only relevant for keyboard devices.
Declaration
Swift
@inlinable var numLockState: Bool { get } -
numTouchesExtension methodRetrieves the number of touch points associated to
device.Declaration
Swift
@inlinable var numTouches: Int { get } -
productIdExtension methodReturns 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.Declaration
Swift
@inlinable var productId: String! { get } -
scrollLockStateExtension methodRetrieves whether the Scroll Lock modifier of the keyboard is locked.
This is only relevant for keyboard devices.
Declaration
Swift
@inlinable var scrollLockState: Bool { get } -
seatExtension methodGdkSeatof this device.Declaration
Swift
@inlinable var seat: SeatRef! { get } -
sourceExtension methodSource type for the device.
Declaration
Swift
@inlinable var source: GdkInputSource { get } -
timestampExtension methodReturns 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).
Declaration
Swift
@inlinable var timestamp: guint32 { get } -
vendorIdExtension methodReturns 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. composeGSettingspaths to store settings for this device.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; }Declaration
Swift
@inlinable var vendorId: String! { get }
View on GitHub
Install in Dash
DeviceProtocol Protocol Reference