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() static nothrowGet builder for [gdk.device.Device] Returns: New builder objectgdk.device.Device associatedDevice() @property nothrowGet `associatedDevice` property. Returns: Associated pointer or keyboard with this device, if any. Devices of type #GDK_DEVICE_TYPE_MASTER always come in keyboard/pointer pairs. Other device types ...gdk.types.AxisFlags axes() @property nothrowGet `axes` property. Returns: The axes currently available for this device.gdk.device_manager.DeviceManager deviceManager() @property nothrowGet `deviceManager` property. Returns: The #GdkDeviceManager the #GdkDevice pertains to.gdk.display.Display display() @property nothrowGet `display` property. Returns: The #GdkDisplay the #GdkDevice pertains to.bool hasCursor() @property nothrowGet `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.InputSource inputSource() @property nothrowGet `inputSource` property. Returns: Source type for the device.uint numTouches() @property nothrowGet `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() @property nothrowGet `productId` property. Returns: Product ID of this device, see [gdk.device.Device.getProductId].void seat(gdk.seat.Seat propval) @property nothrowSet `seat` property. Params: propval = #GdkSeat of this device.gdk.types.DeviceType type() @property nothrowGet `type` property. Returns: Device role in the device manager.string vendorId() @property nothrowGet `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) static nothrowDetermines information about the current keyboard grab. This is not public API and must not be used by applications.gdk.device.Device getAssociatedDevice() nothrowReturns the associated device to device, if device is of type [gdk.types.DeviceType.Master], it will return the paired pointer or keyboard.gdk.types.DeviceType getDeviceType() nothrowReturns the device type for device. Returns: the #GdkDeviceType for device.gdk.display.Display getDisplay() nothrowReturns the #GdkDisplay to which device pertains. Returns: a #GdkDisplay. This memory is owned by GTK+, and must not be freed or unreffed.bool getHasCursor() nothrowDetermines 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) nothrowIf index_ has a valid keyval, this function will return true and fill in keyval and modifiers with the keyval settings.gdk.window.Window getLastEventWindow() nothrowGets 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...int getNAxes() nothrowReturns the number of axes the device currently has. Returns: the number of axes.int getNKeys() nothrowReturns the number of keys the device currently has. Returns: the number of keys.void getPosition(out gdk.screen.Screen screen, out int x, out int y) nothrowGets 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) nothrowGets 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() nothrowReturns 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() nothrowReturns the #GdkSeat the device belongs to. Returns: A #GdkSeat. This memory is owned by GTK+ and must not be freed.gdk.types.InputSource getSource() nothrowDetermines the type of the device. Returns: a #GdkInputSourcestring getVendorId() nothrowReturns 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) nothrowObtains the window underneath device, returning the location of the device in win_x and win_y. Returns null if the window tree under device is not known to GDK (for example, belongs to another appl...gdk.window.Window getWindowAtPositionDouble(out double winX, out double winY) nothrowObtains the window underneath device, returning the location of the device in win_x and win_y in double precision. Returns null if the window tree under device is not known to GDK (for example, bel...gdk.types.GrabStatus grab(gdk.window.Window window, gdk.types.GrabOwnership grabOwnership, bool ownerEvents, gdk.types.EventMask eventMask, gdk.cursor.Cursor cursor, uint time) nothrowGrabs 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() nothrowIf 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) nothrowSpecifies how an axis of a device is used.void setKey(uint index, uint keyval, gdk.types.ModifierType modifiers) nothrowSpecifies the X key event to generate when a macro button of a device is pressed.bool setMode(gdk.types.InputMode mode) nothrowSets 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 warp(gdk.screen.Screen screen, int x, int y) nothrowWarps 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) nothrowConnect 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) nothrowConnect to `ToolChanged` signal.Fluent builder implementation template for gdk.device.Device
Methods
T deviceManager(gdk.device_manager.DeviceManager propval) nothrowSet `deviceManager` property. Params: propval = The #GdkDeviceManager the #GdkDevice pertains to. Returns: Builder instance for fluent chainingT display(gdk.display.Display propval) nothrowSet `display` property. Params: propval = The #GdkDisplay the #GdkDevice pertains to. Returns: Builder instance for fluent chainingT hasCursor(bool propval) nothrowSet `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) nothrowT inputSource(gdk.types.InputSource propval) nothrowSet `inputSource` property. Params: propval = Source type for the device. Returns: Builder instance for fluent chainingT name(string propval) nothrowSet `name` property. Params: propval = The device name. Returns: Builder instance for fluent chainingT numTouches(uint propval) nothrowSet `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) nothrowSet `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) nothrowSet `seat` property. Params: propval = #GdkSeat of this device. Returns: Builder instance for fluent chainingT type(gdk.types.DeviceType propval) nothrowSet `type` property. Params: propval = Device role in the device manager. Returns: Builder instance for fluent chainingT vendorId(string propval) nothrowSet `vendorId` property. Params: propval = Vendor ID of this device, see [gdk.device.Device.getVendorId]. Returns: Builder instance for fluent chainingFluent builder for gdk.device.Device