gdk.device
Module for [Device] class
Types 3
classDevice : gobject.object.ObjectWrap
The #GdkDevice object represents a single input device, such as a keyboard, a mouse, a touchpad, etc.
See the #GdkDeviceManager documentation for more information about the various kinds of master and slave devices, and their relationships.
Methods
DeviceGidBuilder builder()Get builder for [gdk.device.Device] Returns: New builder objectgdk.device.Device associatedDevice() @propertyGet `associatedDevice` property. Returns: Associated pointer or keyboard with this device, if any. Devices of type #GDKDEVICETYPE_MASTER always come in keyboard/pointer pairs. Other device types wi...gdk.types.AxisFlags axes() @propertyGet `axes` property. Returns: The axes currently available for this device.gdk.device_manager.DeviceManager deviceManager() @propertyGet `deviceManager` property. Returns: The #GdkDeviceManager the #GdkDevice pertains to.gdk.display.Display display() @propertyGet `display` property. Returns: The #GdkDisplay the #GdkDevice pertains to.bool hasCursor() @propertyGet `hasCursor` property. Returns: Whether the device is represented by a cursor on the screen. Devices of type [gdk.types.DeviceType.Master] will have true here.gdk.types.InputMode inputMode() @propertyvoid inputMode(gdk.types.InputMode propval) @propertygdk.types.InputSource inputSource() @propertyGet `inputSource` property. Returns: Source type for the device.uint numTouches() @propertyGet `numTouches` property. Returns: The maximal number of concurrent touches on a touch device. Will be 0 if the device is not a touch device or if the number of touches is unknown.string productId() @propertyGet `productId` property. Returns: Product ID of this device, see [gdk.device.Device.getProductId].void seat(gdk.seat.Seat propval) @propertySet `seat` property. Params: propval = #GdkSeat of this device.gdk.device_tool.DeviceTool tool() @propertygdk.types.DeviceType type() @propertyGet `type` property. Returns: Device role in the device manager.string vendorId() @propertyGet `vendorId` property. Returns: Vendor ID of this device, see [gdk.device.Device.getVendorId].bool grabInfoLibgtkOnly(gdk.display.Display display, gdk.device.Device device, out gdk.window.Window grabWindow, out bool ownerEvents)Determines information about the current keyboard grab. This is not public API and must not be used by applications.gdk.device.Device getAssociatedDevice()Returns the associated device to device, if device is of type [gdk.types.DeviceType.Master], it will return the paired pointer or keyboard.gdk.types.AxisFlags getAxes()Returns the axes currently available on the device. Returns:gdk.types.AxisUse getAxisUse(uint index)Returns the axis use for index_.gdk.types.DeviceType getDeviceType()Returns the device type for device. Returns: the #GdkDeviceType for device.gdk.display.Display getDisplay()Returns the #GdkDisplay to which device pertains. Returns: a #GdkDisplay. This memory is owned by GTK+, and must not be freed or unreffed.bool 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 motionbool getKey(uint index, out uint keyval, out gdk.types.ModifierType modifiers)If index_ has a valid keyval, this function will return true and fill in keyval and modifiers with the keyval settings.gdk.window.Window getLastEventWindow()Gets information about which window the given pointer device is in, based on events that have been received so far from the display server. If another application has a pointer grab, or this applic...gdk.types.InputMode getMode()Determines the mode of the device. Returns: a #GdkInputSourceint getNAxes()Returns the number of axes the device currently has. Returns: the number of axes.int getNKeys()Returns the number of keys the device currently has. Returns: the number of keys.string getName()Determines the name of the device. Returns: a namevoid getPosition(out gdk.screen.Screen screen, out int x, out int y)Gets the current location of device. As a slave device coordinates are those of its master pointer, This function may not be called on devices of type [gdk.types.DeviceType.Slave], unless there is ...void getPositionDouble(out gdk.screen.Screen screen, out double x, out double y)Gets the current location of device in double precision. As a slave device's coordinates are those of its master pointer, this function may not be called on devices of type [gdk.types.DeviceType.Sl...string getProductId()Returns the product ID of this device, or null if this information couldn't be obtained. This ID is retrieved from the device, and is thus constant for it. See [gdk.device.Device.getVendorId] for m...gdk.seat.Seat getSeat()Returns the #GdkSeat the device belongs to. Returns: A #GdkSeat. This memory is owned by GTK+ and must not be freed.gdk.types.InputSource getSource()Determines the type of the device. Returns: a #GdkInputSourcestring getVendorId()Returns the vendor ID of this device, or null if this information couldn't be obtained. This ID is retrieved from the device, and is thus constant for it.gdk.window.Window getWindowAtPosition(out int winX, out int winY)Obtains the window underneath device, returning the location of the device in winx and winy. Returns null if the window tree under device is not known to GDK (for example, belongs to another applic...gdk.window.Window getWindowAtPositionDouble(out double winX, out double winY)Obtains the window underneath device, returning the location of the device in winx and winy in double precision. Returns null if the window tree under device is not known to GDK (for example, belon...gdk.types.GrabStatus grab(gdk.window.Window window, gdk.types.GrabOwnership grabOwnership, bool ownerEvents, gdk.types.EventMask eventMask, gdk.cursor.Cursor cursor, uint time)Grabs the device so that all events coming from this device are passed to this application until the device is ungrabbed with [gdk.device.Device.ungrab], or the window becomes unviewable. This over...gdk.device.Device[] listSlaveDevices()If the device if of type [gdk.types.DeviceType.Master], it will return the list of slave devices attached to it, otherwise it will return null Returns: the list of slave devices, or null. The list ...void setAxisUse(uint index, gdk.types.AxisUse use)Specifies how an axis of a device is used.void setKey(uint index, uint keyval, gdk.types.ModifierType modifiers)Specifies the X key event to generate when a macro button of a device is pressed.bool setMode(gdk.types.InputMode mode)Sets a the mode of an input device. The mode controls if the device is active and whether the device’s range is mapped to the entire screen or to a single window.void ungrab(uint time)Release any grab on device.void warp(gdk.screen.Screen screen, int x, int y)Warps device in display to the point `x`,`y` on the screen screen, unless the device is confined to a window by a grab, in which case it will be moved as far as allowed by the grab. Warping the poi...gulong connectChanged(T)(T callback, Flag!"After" after = No.After) if (isCallable!T
&& is(ReturnType!T == void)
&& (Parameters!T.length < 1 || (ParameterStorageClassTuple!T[0] == ParameterStorageClass.none && is(Parameters!T[0] : gdk.device.Device)))
&& Parameters!T.length < 2)Connect to `Changed` signal.gulong connectToolChanged(T)(T callback, Flag!"After" after = No.After) if (isCallable!T
&& is(ReturnType!T == void)
&& (Parameters!T.length < 1 || (ParameterStorageClassTuple!T[0] == ParameterStorageClass.none && is(Parameters!T[0] : gdk.device_tool.DeviceTool)))
&& (Parameters!T.length < 2 || (ParameterStorageClassTuple!T[1] == ParameterStorageClass.none && is(Parameters!T[1] : gdk.device.Device)))
&& Parameters!T.length < 3)Connect to `ToolChanged` signal.Methods
T deviceManager(gdk.device_manager.DeviceManager propval)Set `deviceManager` property. Params: propval = The #GdkDeviceManager the #GdkDevice pertains to. Returns: Builder instance for fluent chainingT display(gdk.display.Display propval)Set `display` property. Params: propval = The #GdkDisplay the #GdkDevice pertains to. Returns: Builder instance for fluent chainingT hasCursor(bool propval)Set `hasCursor` property. Params: propval = Whether the device is represented by a cursor on the screen. Devices of type [gdk.types.DeviceType.Master] will have true here. Returns: Builder instance...T inputMode(gdk.types.InputMode propval)T inputSource(gdk.types.InputSource propval)Set `inputSource` property. Params: propval = Source type for the device. Returns: Builder instance for fluent chainingT name(string propval)Set `name` property. Params: propval = The device name. Returns: Builder instance for fluent chainingT numTouches(uint propval)Set `numTouches` property. Params: propval = The maximal number of concurrent touches on a touch device. Will be 0 if the device is not a touch device or if the number of touches is unknown. Return...T productId(string propval)Set `productId` property. Params: propval = Product ID of this device, see [gdk.device.Device.getProductId]. Returns: Builder instance for fluent chainingT seat(gdk.seat.Seat propval)Set `seat` property. Params: propval = #GdkSeat of this device. Returns: Builder instance for fluent chainingT type(gdk.types.DeviceType propval)Set `type` property. Params: propval = Device role in the device manager. Returns: Builder instance for fluent chainingT vendorId(string propval)Set `vendorId` property. Params: propval = Vendor ID of this device, see [gdk.device.Device.getVendorId]. Returns: Builder instance for fluent chaining