Last chance! 50% off unlimited learning
Sale ends in
gdkDevicesList()
gdkDeviceSetSource(object, source)
gdkDeviceSetMode(object, mode)
gdkDeviceSetKey(object, index, keyval, modifiers)
gdkDeviceSetAxisUse(object, index, use)
gdkDeviceGetCorePointer()
gdkDeviceGetState(object, window)
gdkDeviceGetHistory(object, window, start, stop)
gdkDeviceGetAxis(object, axes, use)
gdkInputSetExtensionEvents(object, mask, mode)
GdkWindow
individually using gdkInputSetExtensionEvents
.
(Or, more typically, for GtkWidgets, using gtkWidgetSetExtensionEvents
).
As an additional complication, depending on the support from
the windowing system, its possible that a normal mouse
cursor will not be displayed for a particular extension
device. If an application does not want to deal with displaying
a cursor itself, it can ask only to get extension events
from devices that will display a cursor, by passing the
GDK_EXTENSION_EVENTS_CURSOR
value to
gdkInputSetExtensionEvents
. Otherwise, the application
must retrieve the device information using gdkDevicesList
,
check the has_cursor
field, and,
if it is FALSE
, draw a cursor itself when it receives
motion events. Each pointing device is assigned a unique integer ID; events from a
particular device can be identified by the
deviceid
field in the event structure. The
events generated by pointer devices have also been extended to contain
pressure
, xtilt
and ytilt
fields which contain the extended
information reported as additional valuators
from the device. The pressure
field is a
a double value ranging from 0.0 to 1.0, while the tilt fields are
double values ranging from -1.0 to 1.0. (With -1.0 representing the
maximum tilt to the left or up, and 1.0 representing the maximum
tilt to the right or down.) One additional field in each event is the
source
field, which contains an
enumeration value describing the type of device; this currently
can be one of GDK_SOURCE_MOUSE
, GDK_SOURCE_PEN
, GDK_SOURCE_ERASER
,
or GDK_SOURCE_CURSOR
. This field is present to allow simple
applications to (for instance) delete when they detect eraser
devices without having to keep track of complicated per-device
settings. Various aspects of each device may be configured.
The configuration of devices is queried using gdkDevicesList
.
Each device must be activated using gdkDeviceSetMode
, which
also controls whether the device's range is mapped to the
entire screen or to a single window. The mapping of the valuators of
the device onto the predefined valuator types is set using
gdkDeviceSetAxisUse
. And the source type for each device
can be set with gdkDeviceSetSource
. Devices may also have associated keys
or function buttons. Such keys can be globally set to map
into normal X keyboard events. The mapping is set using
gdkDeviceSetKey
. The interfaces in this section will most likely be considerably
modified in the future to accomodate devices that may have different
sets of additional valuators than the pressure xtilt
and ytilt
.GdkDevice
GdkDevice
structure contains
a detailed description of an extended input device. All
fields are read-only; but you can use gdkDeviceSetSource
,
gdkDeviceSetMode
, gdkDeviceSetKey
and gdkDeviceSetAxisUse
to configure various aspects of the device. name
source
GdkInputSource
] the name of this device.mode
GdkInputMode
] the type of this device.hasCursor
numAxes
TRUE
if the pointer follows device motion.axes
GdkDeviceAxis
] the length of the axes
list.numKeys
GdkDeviceAxis
, describing the axes of this device.keys
GdkDeviceKey
] the length of the keys
list.GdkDeviceKey
GdkDeviceKey
structure contains information
about the mapping of one device function button onto a normal X key event.
It has the following fields: keyval
modifiers
GdkModifierType
] the modifiers set for the generated key event.GdkDeviceAxis
GdkDeviceAxis
structure contains information
about the range and mapping of a device axis. use
GdkAxisUse
] specifies how the axis is used.min
max
GdkTimeCoord
GdkTimeCoord
structure stores a single event in a
motion history. It contains the following fields:
GdkTimeCoord
is a transparent-type. time
axes
GdkInputSource
mouse
pen
eraser
cursor
GdkInputMode
disabled
screen
window
GdkAxisUse
ignore
x
y
pressure
xtilt
ytilt
wheel
last
GdkExtensionMode
none
all
cursor