gtkmm  3.97.1
Public Types | Public Member Functions | Static Public Member Functions | Protected Member Functions | Related Functions | List of all members
Gdk::Device Class Reference

A Gdk::Device instance contains a detailed description of an extended input device. More...

#include <gdkmm/device.h>

Inheritance diagram for Gdk::Device:
Inheritance graph
[legend]

Public Types

enum  Type {
  Type::MASTER,
  Type::SLAVE,
  Type::FLOATING
}
 
- Public Types inherited from Glib::Object
typedef void(*)(gpointer data DestroyNotify)
 

Public Member Functions

 Device (Device&& src) noexcept
 
Deviceoperator= (Device&& src) noexcept
 
 ~Device () noexcept override
 
GdkDevice* gobj ()
 Provides access to the underlying C GObject. More...
 
const GdkDevice* gobj () const
 Provides access to the underlying C GObject. More...
 
GdkDevice* gobj_copy ()
 Provides access to the underlying C instance. The caller is responsible for unrefing it. Use when directly setting fields in structs. More...
 
Glib::ustring get_name () const
 Determines the name of the device. More...
 
bool get_has_cursor () const
 Determines whether the pointer follows device motion. More...
 
InputSource get_source () const
 Determines the type of the device. More...
 
InputMode get_mode () const
 Determines the mode of the device. More...
 
bool set_mode (InputMode mode)
 Sets a the mode of an input device. More...
 
int get_n_keys () const
 Returns the number of keys the device currently has. More...
 
bool get_key (guint index_, guint& keyval, ModifierType& modifiers) const
 If index has a valid keyval, this function will return true and fill in keyval and modifiers with the keyval settings. More...
 
void set_key (guint index_, guint keyval, ModifierType modifiers)
 Specifies the X key event to generate when a macro button of a device is pressed. More...
 
AxisUse get_axis_use (guint index_) const
 Returns the axis use for index. More...
 
void set_axis_use (guint index_, AxisUse use)
 Specifies how an axis of a device is used. More...
 
void get_state (const Glib::RefPtr< Surface >& surface, double& axes, ModifierType& mask)
 Gets the current state of a pointer device relative to surface. More...
 
std::vector< TimeCoordget_history (const Glib::RefPtr< Surface >& surface, guint32 start, guint32 stop) const
 Obtains the motion history for a device. More...
 
std::vector< Glib::RefPtr< Gdk::Device > > list_slave_devices ()
 If the device if of type Gdk::Device::Type::MASTER, it will return the list of slave devices attached to it, otherwise it will return nullptr More...
 
int get_n_axes () const
 Returns the number of axes the device currently has. More...
 
std::vector< std::stringlist_axes () const
 Returns the labels for the axes that the device currently has. More...
 
bool get_axis_value (double& axes, GdkAtom axis_label, double& value) const
 Interprets an array of double as axis values for a given device, and locates the value in the array for a given axis label, as returned by list_axes() More...
 
bool get_axis (double& axes, AxisUse use, double& value) const
 Interprets an array of double as axis values for a given device, and locates the value in the array for a given axis use. More...
 
Glib::RefPtr< Displayget_display ()
 Returns the Gdk::Display to which device pertains. More...
 
Glib::RefPtr< const Displayget_display () const
 Returns the Gdk::Display to which device pertains. More...
 
Glib::RefPtr< Deviceget_associated_device ()
 Returns the associated device to device, if device is of type Gdk::Device::Type::MASTER, it will return the paired pointer or keyboard. More...
 
Glib::RefPtr< const Deviceget_associated_device () const
 Returns the associated device to device, if device is of type Gdk::Device::Type::MASTER, it will return the paired pointer or keyboard. More...
 
Type get_device_type () const
 Returns the device type for device. More...
 
Glib::RefPtr< Surfaceget_surface_at_position (double& win_x, double& win_y)
 Obtains the surface underneath device, returning the location of the device in win_x and win_y in double precision. More...
 
Glib::RefPtr< const Surfaceget_surface_at_position (double& win_x, double& win_y) const
 Obtains the surface underneath device, returning the location of the device in win_x and win_y in double precision. More...
 
Glib::RefPtr< Surfaceget_surface_at_position ()
 Obtains the surface underneath the device. More...
 
Glib::RefPtr< const Surfaceget_surface_at_position () const
 Obtains the surface underneath the device. More...
 
Glib::RefPtr< Surfaceget_last_event_surface ()
 Gets information about which surface the given pointer device is in, based on events that have been received so far from the display server. More...
 
Glib::RefPtr< const Surfaceget_last_event_surface () const
 Gets information about which surface the given pointer device is in, based on events that have been received so far from the display server. More...
 
Glib::ustring get_vendor_id () const
 Returns the vendor ID of this device, or nullptr if this information couldn't be obtained. More...
 
Glib::ustring get_product_id ()
 Returns the product ID of this device, or nullptr if this information couldn't be obtained. More...
 
Glib::RefPtr< Seatget_seat ()
 Returns the Gdk::Seat the device belongs to. More...
 
Glib::RefPtr< const Seatget_seat () const
 Returns the Gdk::Seat the device belongs to. More...
 
AxisFlags get_axes () const
 Returns the axes currently available on the device. More...
 
bool has_device_pad () const
 Checks if this Device instance is a DeviceWithPad. More...
 
Glib::RefPtr< DeviceWithPaddevice_with_pad_cast ()
 Casts this Device instance to a DeviceWithPad, if possible. More...
 
Glib::RefPtr< const DeviceWithPaddevice_with_pad_cast () const
 Casts this Device instance to a DeviceWithPad, if possible. More...
 
Glib::SignalProxy< void()> signal_changed ()
 
Glib::SignalProxy< void(const Glib::RefPtr< DeviceTool >&)> signal_tool_changed ()
 
Glib::PropertyProxy_ReadOnly< Glib::RefPtr< Display > > property_display () const
 The Gdk::Display the Gdk::Device pertains to. More...
 
Glib::PropertyProxy_ReadOnly< Glib::ustringproperty_name () const
 The device name. More...
 
Glib::PropertyProxy_ReadOnly< Typeproperty_type () const
 Device role in the device manager. More...
 
Glib::PropertyProxy_ReadOnly< Glib::RefPtr< Device > > property_associated_device () const
 Associated pointer or keyboard with this device, if any. More...
 
Glib::PropertyProxy_ReadOnly< InputSourceproperty_input_source () const
 Source type for the device. More...
 
Glib::PropertyProxy< InputModeproperty_input_mode ()
 Input mode for the device. More...
 
Glib::PropertyProxy_ReadOnly< InputModeproperty_input_mode () const
 Input mode for the device. More...
 
Glib::PropertyProxy_ReadOnly< bool > property_has_cursor () const
 Whether the device is represented by a cursor on the screen. More...
 
Glib::PropertyProxy_ReadOnly< guint > property_n_axes () const
 Number of axes in the device. More...
 
Glib::PropertyProxy_ReadOnly< Glib::ustringproperty_vendor_id () const
 Vendor ID of this device, see Gdk::Device::get_vendor_id(). More...
 
Glib::PropertyProxy_ReadOnly< Glib::ustringproperty_product_id () const
 Product ID of this device, see Gdk::Device::get_product_id(). More...
 
Glib::PropertyProxy< Glib::RefPtr< Seat > > property_seat ()
 Gdk::Seat of this device. More...
 
Glib::PropertyProxy_ReadOnly< Glib::RefPtr< Seat > > property_seat () const
 Gdk::Seat of this device. More...
 
Glib::PropertyProxy_ReadOnly< guint > property_num_touches () const
 The maximal number of concurrent touches on a touch device. More...
 
Glib::PropertyProxy_ReadOnly< AxisFlagsproperty_axes () const
 The axes currently available for this device. More...
 
Glib::PropertyProxy_ReadOnly< Glib::RefPtr< DeviceTool > > property_tool () const
 The tool that is currently used with this device. More...
 
- Public Member Functions inherited from Glib::Object
 Object (const Object &)=delete
 
Objectoperator= (const Object &)=delete
 
 Object (Object &&src) noexcept
 
Objectoperator= (Object &&src) noexcept
 
void * get_data (const QueryQuark &key)
 
void set_data (const Quark &key, void *data)
 
void set_data (const Quark &key, void *data, DestroyNotify notify)
 
void remove_data (const QueryQuark &quark)
 
void * steal_data (const QueryQuark &quark)
 
Glib::RefPtr< Glib::Objectwrap (GObject *object, bool take_copy=false)
 
- Public Member Functions inherited from Glib::ObjectBase
 ObjectBase (const ObjectBase &)=delete
 
ObjectBaseoperator= (const ObjectBase &)=delete
 
void set_property_value (const Glib::ustring &property_name, const Glib::ValueBase &value)
 
void get_property_value (const Glib::ustring &property_name, Glib::ValueBase &value) const
 
void set_property (const Glib::ustring &property_name, const PropertyType &value)
 
void get_property (const Glib::ustring &property_name, PropertyType &value) const
 
PropertyType get_property (const Glib::ustring &property_name) const
 
sigc::connection connect_property_changed (const Glib::ustring &property_name, const sigc::slot< void()> &slot)
 
sigc::connection connect_property_changed (const Glib::ustring &property_name, sigc::slot< void()> &&slot)
 
void freeze_notify ()
 
void thaw_notify ()
 
virtual void reference () const
 
virtual void unreference () const
 
GObject * gobj ()
 
const GObject * gobj () const
 
GObject * gobj_copy () const
 

Static Public Member Functions

static GType get_type ()
 Get the GType for this class, for use with the underlying GObject type system. More...
 

Protected Member Functions

 Device ()
 
- Protected Member Functions inherited from Glib::Object
 Object ()
 
 Object (const Glib::ConstructParams &construct_params)
 
 Object (GObject *castitem)
 
 ~Object () noexcept override
 
- Protected Member Functions inherited from Glib::ObjectBase
 ObjectBase ()
 
 ObjectBase (const char *custom_type_name)
 
 ObjectBase (const std::type_info &custom_type_info)
 
 ObjectBase (ObjectBase &&src) noexcept
 
ObjectBaseoperator= (ObjectBase &&src) noexcept
 
virtual ~ObjectBase () noexcept=0
 
void initialize (GObject *castitem)
 
void initialize_move (GObject *castitem, Glib::ObjectBase *previous_wrapper)
 

Related Functions

(Note that these are not member functions.)

Glib::RefPtr< Gdk::Devicewrap (GdkDevice* object, bool take_copy=false)
 A Glib::wrap() method for this object. More...
 

Detailed Description

A Gdk::Device instance contains a detailed description of an extended input device.

Constructor & Destructor Documentation

◆ Device() [1/2]

Gdk::Device::Device ( Device&&  src)
noexcept

◆ ~Device()

Gdk::Device::~Device ( )
overridenoexcept

◆ Device() [2/2]

Gdk::Device::Device ( )
protected

Member Function Documentation

◆ device_with_pad_cast() [1/2]

Glib::RefPtr<DeviceWithPad> Gdk::Device::device_with_pad_cast ( )

Casts this Device instance to a DeviceWithPad, if possible.

Returns
A DeviceWithPad pointer, or an empty Glib::RefPtr if this Device can't be dynamic_cast to a DeviceWithPad.
Since gtkmm 3.96:

◆ device_with_pad_cast() [2/2]

Glib::RefPtr<const DeviceWithPad> Gdk::Device::device_with_pad_cast ( ) const

Casts this Device instance to a DeviceWithPad, if possible.

Returns
A DeviceWithPad pointer, or an empty Glib::RefPtr if this Device can't be dynamic_cast to a DeviceWithPad.
Since gtkmm 3.96:

◆ get_associated_device() [1/2]

Glib::RefPtr<Device> Gdk::Device::get_associated_device ( )

Returns the associated device to device, if device is of type Gdk::Device::Type::MASTER, it will return the paired pointer or keyboard.

If device is of type Gdk::Device::Type::SLAVE, it will return the master device to which device is attached to.

If device is of type Gdk::Device::Type::FLOATING, nullptr will be returned, as there is no associated device.

Returns
The associated device, or nullptr.

◆ get_associated_device() [2/2]

Glib::RefPtr<const Device> Gdk::Device::get_associated_device ( ) const

Returns the associated device to device, if device is of type Gdk::Device::Type::MASTER, it will return the paired pointer or keyboard.

If device is of type Gdk::Device::Type::SLAVE, it will return the master device to which device is attached to.

If device is of type Gdk::Device::Type::FLOATING, nullptr will be returned, as there is no associated device.

Returns
The associated device, or nullptr.

◆ get_axes()

AxisFlags Gdk::Device::get_axes ( ) const

Returns the axes currently available on the device.

◆ get_axis()

bool Gdk::Device::get_axis ( double &  axes,
AxisUse  use,
double &  value 
) const

Interprets an array of double as axis values for a given device, and locates the value in the array for a given axis use.

Parameters
axesPointer to an array of axes.
useThe use to look for.
valueLocation to store the found value.
Returns
true if the given axis use was found, otherwise false.

◆ get_axis_use()

AxisUse Gdk::Device::get_axis_use ( guint  index_) const

Returns the axis use for index.

Parameters
indexThe index of the axis.
Returns
A Gdk::AxisUse specifying how the axis is used.

◆ get_axis_value()

bool Gdk::Device::get_axis_value ( double &  axes,
GdkAtom  axis_label,
double &  value 
) const

Interprets an array of double as axis values for a given device, and locates the value in the array for a given axis label, as returned by list_axes()

Parameters
axesPointer to an array of axes.
axis_labelName of the label.
valueLocation to store the found value.
Returns
true if the given axis use was found, otherwise false.

◆ get_device_type()

Type Gdk::Device::get_device_type ( ) const

Returns the device type for device.

Returns
The Gdk::Device::Type for device.

◆ get_display() [1/2]

Glib::RefPtr<Display> Gdk::Device::get_display ( )

Returns the Gdk::Display to which device pertains.

Returns
A Gdk::Display. This memory is owned by GTK+, and must not be freed or unreffed.

◆ get_display() [2/2]

Glib::RefPtr<const Display> Gdk::Device::get_display ( ) const

Returns the Gdk::Display to which device pertains.

Returns
A Gdk::Display. This memory is owned by GTK+, and must not be freed or unreffed.

◆ get_has_cursor()

bool Gdk::Device::get_has_cursor ( ) const

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.

◆ get_history()

std::vector<TimeCoord> Gdk::Device::get_history ( const Glib::RefPtr< Surface >&  surface,
guint32  start,
guint32  stop 
) const

Obtains the motion history for a device.

Given a starting and ending timestamp, this will return all events in the motion history for the device in the given range of time. Some windowing systems do not support motion history, in which case, false will be returned. (This is not distinguishable from the case where motion history is supported and no events were found.)

Parameters
surfaceThe surface with respect to which which the event coordinates will be reported.
startStarting timestamp for range of events to return.
stopEnding timestamp for the range of events to return.
Returns
A vector of TimeCoord.

◆ get_key()

bool Gdk::Device::get_key ( guint  index_,
guint &  keyval,
ModifierType modifiers 
) const

If index has a valid keyval, this function will return true and fill in keyval and modifiers with the keyval settings.

Parameters
indexThe index of the macro button to get.
keyvalReturn value for the keyval.
modifiersReturn value for modifiers.
Returns
true if keyval is set for index.

◆ get_last_event_surface() [1/2]

Glib::RefPtr<Surface> Gdk::Device::get_last_event_surface ( )

Gets information about which surface 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 application has a grab with owner_events = false, nullptr may be returned even if the pointer is physically over one of this application's surfaces.

Returns
The last surface the device.

◆ get_last_event_surface() [2/2]

Glib::RefPtr<const Surface> Gdk::Device::get_last_event_surface ( ) const

Gets information about which surface 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 application has a grab with owner_events = false, nullptr may be returned even if the pointer is physically over one of this application's surfaces.

Returns
The last surface the device.

◆ get_mode()

InputMode Gdk::Device::get_mode ( ) const

Determines the mode of the device.

Returns
A Gdk::InputMode.

◆ get_n_axes()

int Gdk::Device::get_n_axes ( ) const

Returns the number of axes the device currently has.

Returns
The number of axes.

◆ get_n_keys()

int Gdk::Device::get_n_keys ( ) const

Returns the number of keys the device currently has.

Returns
The number of keys.

◆ get_name()

Glib::ustring Gdk::Device::get_name ( ) const

Determines the name of the device.

Returns
A name.

◆ get_product_id()

Glib::ustring Gdk::Device::get_product_id ( )

Returns the product ID of this device, or nullptr if this information couldn't be obtained.

This ID is retrieved from the device, and is thus constant for it. See get_vendor_id() for more information.

Returns
The product ID, or nullptr.

◆ get_seat() [1/2]

Glib::RefPtr<Seat> Gdk::Device::get_seat ( )

Returns the Gdk::Seat the device belongs to.

Returns
A Gdk::Seat. This memory is owned by GTK+ and must not be freed.

◆ get_seat() [2/2]

Glib::RefPtr<const Seat> Gdk::Device::get_seat ( ) const

Returns the Gdk::Seat the device belongs to.

Returns
A Gdk::Seat. This memory is owned by GTK+ and must not be freed.

◆ get_source()

InputSource Gdk::Device::get_source ( ) const

Determines the type of the device.

Returns
A Gdk::InputSource.

◆ get_state()

void Gdk::Device::get_state ( const Glib::RefPtr< Surface >&  surface,
double &  axes,
ModifierType mask 
)

Gets the current state of a pointer device relative to surface.

As a slave device’s coordinates are those of its master pointer, this function may not be called on devices of type Gdk::Device::Type::SLAVE, unless there is an ongoing grab on them. See gdk_seat_grab().

Parameters
surfaceA Gdk::Surface.
axesAn array of doubles to store the values of the axes of device in, or nullptr.
maskLocation to store the modifiers, or nullptr.

◆ get_surface_at_position() [1/4]

Glib::RefPtr<Surface> Gdk::Device::get_surface_at_position ( )

Obtains the surface underneath the device.

Returns an empty RefPtr if the surface tree under the device is not known to GDK (for example, belongs to another application).

As a slave device coordinates are those of its master pointer, This function may not be called on devices of type Gdk::Device::Type::SLAVE, unless there is an ongoing grab on them. See grab().

Since gtkmm 3.0:
Returns
The Gdk::Surface under the device position.

◆ get_surface_at_position() [2/4]

Glib::RefPtr<const Surface> Gdk::Device::get_surface_at_position ( ) const

Obtains the surface underneath the device.

Returns an empty RefPtr if the surface tree under the device is not known to GDK (for example, belongs to another application).

As a slave device coordinates are those of its master pointer, This function may not be called on devices of type Gdk::Device::Type::SLAVE, unless there is an ongoing grab on them. See grab().

Since gtkmm 3.0:
Returns
The Gdk::Surface under the device position.

◆ get_surface_at_position() [3/4]

Glib::RefPtr<Surface> Gdk::Device::get_surface_at_position ( double &  win_x,
double &  win_y 
)

Obtains the surface underneath device, returning the location of the device in win_x and win_y in double precision.

Returns nullptr if the surface tree under device is not known to GDK (for example, belongs to another application).

As a slave device coordinates are those of its master pointer, This function may not be called on devices of type Gdk::Device::Type::SLAVE, unless there is an ongoing grab on them, see gdk_seat_grab().

Parameters
win_xReturn location for the X coordinate of the device location, relative to the surface origin, or nullptr.
win_yReturn location for the Y coordinate of the device location, relative to the surface origin, or nullptr.
Returns
The Gdk::Surface under the device position, or nullptr.

◆ get_surface_at_position() [4/4]

Glib::RefPtr<const Surface> Gdk::Device::get_surface_at_position ( double &  win_x,
double &  win_y 
) const

Obtains the surface underneath device, returning the location of the device in win_x and win_y in double precision.

Returns nullptr if the surface tree under device is not known to GDK (for example, belongs to another application).

As a slave device coordinates are those of its master pointer, This function may not be called on devices of type Gdk::Device::Type::SLAVE, unless there is an ongoing grab on them, see gdk_seat_grab().

Parameters
win_xReturn location for the X coordinate of the device location, relative to the surface origin, or nullptr.
win_yReturn location for the Y coordinate of the device location, relative to the surface origin, or nullptr.
Returns
The Gdk::Surface under the device position, or nullptr.

◆ get_type()

static GType Gdk::Device::get_type ( )
static

Get the GType for this class, for use with the underlying GObject type system.

◆ get_vendor_id()

Glib::ustring Gdk::Device::get_vendor_id ( ) const

Returns the vendor ID of this device, or nullptr if this information couldn't be obtained.

This ID is retrieved from the device, and is thus constant for it.

This function, together with get_product_id(), can be used to eg. compose Gio::Settings paths to store settings for this device.

[C example ellipted]

Returns
The vendor ID, or nullptr.

◆ gobj() [1/2]

GdkDevice* Gdk::Device::gobj ( )
inline

Provides access to the underlying C GObject.

◆ gobj() [2/2]

const GdkDevice* Gdk::Device::gobj ( ) const
inline

Provides access to the underlying C GObject.

◆ gobj_copy()

GdkDevice* Gdk::Device::gobj_copy ( )

Provides access to the underlying C instance. The caller is responsible for unrefing it. Use when directly setting fields in structs.

◆ has_device_pad()

bool Gdk::Device::has_device_pad ( ) const

Checks if this Device instance is a DeviceWithPad.

The underlying C object is usually a subclass of GdkDevice. If that subclass implements the GdkDevicePad interface, this C++ Gdk::Device instance is a Gdk::DeviceWithPad instance, and can be cast to a Gdk::DeviceWithPad by device_with_pad_cast().

Returns
true if this instance is a DeviceWithPad.
Since gtkmm 3.96:

◆ list_axes()

std::vector<std::string> Gdk::Device::list_axes ( ) const

Returns the labels for the axes that the device currently has.

Since gtkmm 3.4:

◆ list_slave_devices()

std::vector<Glib::RefPtr<Gdk::Device> > Gdk::Device::list_slave_devices ( )

If the device if of type Gdk::Device::Type::MASTER, it will return the list of slave devices attached to it, otherwise it will return nullptr

Returns
The list of slave devices, or nullptr.

◆ operator=()

Device& Gdk::Device::operator= ( Device&&  src)
noexcept

◆ property_associated_device()

Glib::PropertyProxy_ReadOnly< Glib::RefPtr<Device> > Gdk::Device::property_associated_device ( ) const

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 will have a nullptr associated device.

Since gtkmm 3.22:
Returns
A PropertyProxy_ReadOnly that allows you to get the value of the property, or receive notification when the value of the property changes.

◆ property_axes()

Glib::PropertyProxy_ReadOnly< AxisFlags > Gdk::Device::property_axes ( ) const

The axes currently available for this device.

Default value: 0

Returns
A PropertyProxy_ReadOnly that allows you to get the value of the property, or receive notification when the value of the property changes.

◆ property_display()

Glib::PropertyProxy_ReadOnly< Glib::RefPtr<Display> > Gdk::Device::property_display ( ) const

The Gdk::Display the Gdk::Device pertains to.

Since gtkmm 3.22:
Returns
A PropertyProxy_ReadOnly that allows you to get the value of the property, or receive notification when the value of the property changes.

◆ property_has_cursor()

Glib::PropertyProxy_ReadOnly< bool > Gdk::Device::property_has_cursor ( ) const

Whether the device is represented by a cursor on the screen.

Devices of type Gdk::Device::Type::MASTER will have true here.

Since gtkmm 3.22:

Default value: false

Returns
A PropertyProxy_ReadOnly that allows you to get the value of the property, or receive notification when the value of the property changes.

◆ property_input_mode() [1/2]

Glib::PropertyProxy< InputMode > Gdk::Device::property_input_mode ( )

Input mode for the device.

Since gtkmm 3.22:

Default value: Gdk::InputMode::DISABLED

Returns
A PropertyProxy that allows you to get or set the value of the property, or receive notification when the value of the property changes.

◆ property_input_mode() [2/2]

Glib::PropertyProxy_ReadOnly< InputMode > Gdk::Device::property_input_mode ( ) const

Input mode for the device.

Since gtkmm 3.22:

Default value: Gdk::InputMode::DISABLED

Returns
A PropertyProxy_ReadOnly that allows you to get the value of the property, or receive notification when the value of the property changes.

◆ property_input_source()

Glib::PropertyProxy_ReadOnly< InputSource > Gdk::Device::property_input_source ( ) const

Source type for the device.

Since gtkmm 3.22:

Default value: Gdk::InputSource::MOUSE

Returns
A PropertyProxy_ReadOnly that allows you to get the value of the property, or receive notification when the value of the property changes.

◆ property_n_axes()

Glib::PropertyProxy_ReadOnly< guint > Gdk::Device::property_n_axes ( ) const

Number of axes in the device.

Since gtkmm 3.22:

Default value: 0

Returns
A PropertyProxy_ReadOnly that allows you to get the value of the property, or receive notification when the value of the property changes.

◆ property_name()

Glib::PropertyProxy_ReadOnly< Glib::ustring > Gdk::Device::property_name ( ) const

The device name.

Since gtkmm 3.22:

Default value: ""

Returns
A PropertyProxy_ReadOnly that allows you to get the value of the property, or receive notification when the value of the property changes.

◆ property_num_touches()

Glib::PropertyProxy_ReadOnly< guint > Gdk::Device::property_num_touches ( ) const

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.

Since gtkmm 3.22:

Default value: 0

Returns
A PropertyProxy_ReadOnly that allows you to get the value of the property, or receive notification when the value of the property changes.

◆ property_product_id()

Glib::PropertyProxy_ReadOnly< Glib::ustring > Gdk::Device::property_product_id ( ) const

Product ID of this device, see Gdk::Device::get_product_id().

Since gtkmm 3.22:

Default value: ""

Returns
A PropertyProxy_ReadOnly that allows you to get the value of the property, or receive notification when the value of the property changes.

◆ property_seat() [1/2]

Glib::PropertyProxy< Glib::RefPtr<Seat> > Gdk::Device::property_seat ( )

Gdk::Seat of this device.

Since gtkmm 3.22:
Returns
A PropertyProxy that allows you to get or set the value of the property, or receive notification when the value of the property changes.

◆ property_seat() [2/2]

Glib::PropertyProxy_ReadOnly< Glib::RefPtr<Seat> > Gdk::Device::property_seat ( ) const

Gdk::Seat of this device.

Since gtkmm 3.22:
Returns
A PropertyProxy_ReadOnly that allows you to get the value of the property, or receive notification when the value of the property changes.

◆ property_tool()

Glib::PropertyProxy_ReadOnly< Glib::RefPtr<DeviceTool> > Gdk::Device::property_tool ( ) const

The tool that is currently used with this device.

Since gtkmm 3.94:
Returns
A PropertyProxy_ReadOnly that allows you to get the value of the property, or receive notification when the value of the property changes.

◆ property_type()

Glib::PropertyProxy_ReadOnly< Type > Gdk::Device::property_type ( ) const

Device role in the device manager.

Since gtkmm 3.22:

Default value: Gdk::Device::Type::MASTER

Returns
A PropertyProxy_ReadOnly that allows you to get the value of the property, or receive notification when the value of the property changes.

◆ property_vendor_id()

Glib::PropertyProxy_ReadOnly< Glib::ustring > Gdk::Device::property_vendor_id ( ) const

Vendor ID of this device, see Gdk::Device::get_vendor_id().

Since gtkmm 3.22:

Default value: ""

Returns
A PropertyProxy_ReadOnly that allows you to get the value of the property, or receive notification when the value of the property changes.

◆ set_axis_use()

void Gdk::Device::set_axis_use ( guint  index_,
AxisUse  use 
)

Specifies how an axis of a device is used.

Parameters
indexThe index of the axis.
useSpecifies how the axis is used.

◆ set_key()

void Gdk::Device::set_key ( guint  index_,
guint  keyval,
ModifierType  modifiers 
)

Specifies the X key event to generate when a macro button of a device is pressed.

Parameters
indexThe index of the macro button to set.
keyvalThe keyval to generate.
modifiersThe modifiers to set.

◆ set_mode()

bool Gdk::Device::set_mode ( 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 surface.

Note
This is only meaningful for floating devices, master devices (and slaves connected to these) drive the pointer cursor, which is not limited by the input mode.
Parameters
modeThe input mode.
Returns
true if the mode was successfully changed.

◆ signal_changed()

Glib::SignalProxy<void()> Gdk::Device::signal_changed ( )
Slot Prototype:
void on_my_changed()

Flags: Run Last

The signal_changed() signal is emitted either when the Gdk::Device has changed the number of either axes or keys. For example In X this will normally happen when the slave device routing events through the master device changes (for example, user switches from the USB mouse to a tablet), in that case the master device will change to reflect the new slave device axes and keys.

Since gtkmm 3.22:

◆ signal_tool_changed()

Glib::SignalProxy<void(const Glib::RefPtr<DeviceTool>&)> Gdk::Device::signal_tool_changed ( )
Slot Prototype:
void on_my_tool_changed(const Glib::RefPtr<DeviceTool>& tool)

Flags: Run Last

The signal_tool_changed() signal is emitted on pen/eraser Gdk::Devices whenever tools enter or leave proximity.

Since gtkmm 3.94:
Parameters
toolThe new current tool.

Friends And Related Function Documentation

◆ wrap()

Glib::RefPtr< Gdk::Device > wrap ( GdkDevice *  object,
bool  take_copy = false 
)
related

A Glib::wrap() method for this object.

Parameters
objectThe C instance.
take_copyFalse if the result should take ownership of the C instance. True if it should take a new copy or ref.
Returns
A C++ instance that wraps this C instance.