|
Server : Apache/2.2.17 (Unix) mod_ssl/2.2.17 OpenSSL/0.9.8e-fips-rhel5 DAV/2 PHP/5.2.17 System : Linux localhost 2.6.18-419.el5 #1 SMP Fri Feb 24 22:47:42 UTC 2017 x86_64 User : nobody ( 99) PHP Version : 5.2.17 Disable Function : NONE Directory : /proc/22697/root/usr/share/gtk-doc/html/gdk/ |
Upload File : |
<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=US-ASCII">
<title>Input Devices</title>
<meta name="generator" content="DocBook XSL Stylesheets V1.69.1">
<link rel="start" href="index.html" title="GDK Reference Manual">
<link rel="up" href="reference.html" title="API Reference">
<link rel="prev" href="gdk-Input.html" title="Input">
<link rel="next" href="gdk-Pango-Interaction.html" title="Pango Interaction">
<meta name="generator" content="GTK-Doc V1.6 (XML mode)">
<link rel="stylesheet" href="style.css" type="text/css">
<link rel="reference" href="reference.html" title="API Reference">
<link rel="index" href="ix01.html" title="Index">
<link rel="index" href="ix02.html" title="Index of deprecated symbols">
<link rel="index" href="ix03.html" title="Index of new symbols in 2.2">
<link rel="index" href="ix04.html" title="Index of new symbols in 2.4">
<link rel="index" href="ix05.html" title="Index of new symbols in 2.6">
<link rel="index" href="ix06.html" title="Index of new symbols in 2.8">
<link rel="index" href="ix07.html" title="Index of new symbols in 2.10">
</head>
<body bgcolor="white" text="black" link="#0000FF" vlink="#840084" alink="#0000FF">
<table class="navigation" id="top" width="100%" summary="Navigation header" cellpadding="2" cellspacing="2">
<tr valign="middle">
<td><a accesskey="p" href="gdk-Input.html"><img src="left.png" width="24" height="24" border="0" alt="Prev"></a></td>
<td><a accesskey="u" href="reference.html"><img src="up.png" width="24" height="24" border="0" alt="Up"></a></td>
<td><a accesskey="h" href="index.html"><img src="home.png" width="24" height="24" border="0" alt="Home"></a></td>
<th width="100%" align="center">GDK Reference Manual</th>
<td><a accesskey="n" href="gdk-Pango-Interaction.html"><img src="right.png" width="24" height="24" border="0" alt="Next"></a></td>
</tr>
<tr><td colspan="5" class="shortcuts"><nobr><a href="#id3123055" class="shortcut">Top</a>
 | 
<a href="#id3123536" class="shortcut">Description</a></nobr></td></tr>
</table>
<div class="refentry" lang="en">
<a name="gdk-Input-Devices"></a><div class="titlepage"></div>
<div class="refnamediv"><table width="100%"><tr>
<td valign="top">
<h2>
<a name="id3123055"></a><span class="refentrytitle">Input Devices</span>
</h2>
<p>Input Devices — Functions for handling extended input devices</p>
</td>
<td valign="top" align="right"></td>
</tr></table></div>
<div class="refsynopsisdiv">
<h2>Synopsis</h2>
<pre class="synopsis">
#include <gdk/gdk.h>
<a href="gdk-Input-Devices.html#GdkDevice">GdkDevice</a>;
enum <a href="gdk-Input-Devices.html#GdkInputSource">GdkInputSource</a>;
enum <a href="gdk-Input-Devices.html#GdkInputMode">GdkInputMode</a>;
<a href="gdk-Input-Devices.html#GdkDeviceKey">GdkDeviceKey</a>;
<a href="gdk-Input-Devices.html#GdkDeviceAxis">GdkDeviceAxis</a>;
enum <a href="gdk-Input-Devices.html#GdkAxisUse">GdkAxisUse</a>;
<a
href="../glib/glib-Doubly-Linked-Lists.html#GList"
>GList</a>* <a href="gdk-Input-Devices.html#gdk-devices-list">gdk_devices_list</a> (void);
void <a href="gdk-Input-Devices.html#gdk-device-set-source">gdk_device_set_source</a> (<a href="gdk-Input-Devices.html#GdkDevice">GdkDevice</a> *device,
<a href="gdk-Input-Devices.html#GdkInputSource">GdkInputSource</a> source);
<a
href="../glib/glib-Basic-Types.html#gboolean"
>gboolean</a> <a href="gdk-Input-Devices.html#gdk-device-set-mode">gdk_device_set_mode</a> (<a href="gdk-Input-Devices.html#GdkDevice">GdkDevice</a> *device,
<a href="gdk-Input-Devices.html#GdkInputMode">GdkInputMode</a> mode);
void <a href="gdk-Input-Devices.html#gdk-device-set-key">gdk_device_set_key</a> (<a href="gdk-Input-Devices.html#GdkDevice">GdkDevice</a> *device,
<a
href="../glib/glib-Basic-Types.html#guint"
>guint</a> index_,
<a
href="../glib/glib-Basic-Types.html#guint"
>guint</a> keyval,
<a href="gdk-Windows.html#GdkModifierType">GdkModifierType</a> modifiers);
void <a href="gdk-Input-Devices.html#gdk-device-set-axis-use">gdk_device_set_axis_use</a> (<a href="gdk-Input-Devices.html#GdkDevice">GdkDevice</a> *device,
<a
href="../glib/glib-Basic-Types.html#guint"
>guint</a> index_,
<a href="gdk-Input-Devices.html#GdkAxisUse">GdkAxisUse</a> use);
<a href="gdk-Input-Devices.html#GdkDevice">GdkDevice</a>* <a href="gdk-Input-Devices.html#gdk-device-get-core-pointer">gdk_device_get_core_pointer</a> (void);
void <a href="gdk-Input-Devices.html#gdk-device-get-state">gdk_device_get_state</a> (<a href="gdk-Input-Devices.html#GdkDevice">GdkDevice</a> *device,
<a href="gdk-Windows.html#GdkWindow">GdkWindow</a> *window,
<a
href="../glib/glib-Basic-Types.html#gdouble"
>gdouble</a> *axes,
<a href="gdk-Windows.html#GdkModifierType">GdkModifierType</a> *mask);
<a
href="../glib/glib-Basic-Types.html#gboolean"
>gboolean</a> <a href="gdk-Input-Devices.html#gdk-device-get-history">gdk_device_get_history</a> (<a href="gdk-Input-Devices.html#GdkDevice">GdkDevice</a> *device,
<a href="gdk-Windows.html#GdkWindow">GdkWindow</a> *window,
<a
href="../glib/glib-Basic-Types.html#guint32"
>guint32</a> start,
<a
href="../glib/glib-Basic-Types.html#guint32"
>guint32</a> stop,
<a href="gdk-Input-Devices.html#GdkTimeCoord">GdkTimeCoord</a> ***events,
<a
href="../glib/glib-Basic-Types.html#gint"
>gint</a> *n_events);
void <a href="gdk-Input-Devices.html#gdk-device-free-history">gdk_device_free_history</a> (<a href="gdk-Input-Devices.html#GdkTimeCoord">GdkTimeCoord</a> **events,
<a
href="../glib/glib-Basic-Types.html#gint"
>gint</a> n_events);
<a href="gdk-Input-Devices.html#GdkTimeCoord">GdkTimeCoord</a>;
<a
href="../glib/glib-Basic-Types.html#gboolean"
>gboolean</a> <a href="gdk-Input-Devices.html#gdk-device-get-axis">gdk_device_get_axis</a> (<a href="gdk-Input-Devices.html#GdkDevice">GdkDevice</a> *device,
<a
href="../glib/glib-Basic-Types.html#gdouble"
>gdouble</a> *axes,
<a href="gdk-Input-Devices.html#GdkAxisUse">GdkAxisUse</a> use,
<a
href="../glib/glib-Basic-Types.html#gdouble"
>gdouble</a> *value);
void <a href="gdk-Input-Devices.html#gdk-input-set-extension-events">gdk_input_set_extension_events</a> (<a href="gdk-Windows.html#GdkWindow">GdkWindow</a> *window,
<a
href="../glib/glib-Basic-Types.html#gint"
>gint</a> mask,
<a href="gdk-Input-Devices.html#GdkExtensionMode">GdkExtensionMode</a> mode);
enum <a href="gdk-Input-Devices.html#GdkExtensionMode">GdkExtensionMode</a>;
</pre>
</div>
<div class="refsect1" lang="en">
<a name="id3123536"></a><h2>Description</h2>
<p>
In addition to the normal keyboard and mouse input devices, GTK+ also
contains support for <em class="firstterm">extended input devices</em>. In
particular, this support is targeted at graphics tablets. Graphics
tablets typically return sub-pixel positioning information and possibly
information about the pressure and tilt of the stylus. Under
X, the support for extended devices is done through the
<em class="firstterm">XInput</em> extension.
</p>
<p>
Because handling extended input devices may involve considerable
overhead, they need to be turned on for each <a href="gdk-Windows.html#GdkWindow"><span class="type">GdkWindow</span></a>
individually using <a href="gdk-Input-Devices.html#gdk-input-set-extension-events"><code class="function">gdk_input_set_extension_events()</code></a>.
(Or, more typically, for GtkWidgets, using <a
href="../gtk/GtkWidget.html#gtk-widget-set-extension-events"
><code class="function">gtk_widget_set_extension_events()</code></a>).
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
<a href="gdk-Input-Devices.html#GDK-EXTENSION-EVENTS-CURSOR:CAPS"><code class="literal">GDK_EXTENSION_EVENTS_CURSOR</code></a> value to
<a href="gdk-Input-Devices.html#gdk-input-set-extension-events"><code class="function">gdk_input_set_extension_events()</code></a>. Otherwise, the application
must retrieve the device information using <a href="gdk-Input-Devices.html#gdk-devices-list"><code class="function">gdk_devices_list()</code></a>,
check the <em class="structfield"><code>has_cursor</code></em> field, and,
if it is <a
href="../glib/glib-Standard-Macros.html#FALSE:CAPS"
><code class="literal">FALSE</code></a>, draw a cursor itself when it receives
motion events.
</p>
<p>
Each pointing device is assigned a unique integer ID; events from a
particular device can be identified by the
<em class="structfield"><code>deviceid</code></em> field in the event structure. The
events generated by pointer devices have also been extended to contain
<em class="structfield"><code>pressure</code></em>, <em class="structfield"><code>xtilt</code></em>
and <em class="structfield"><code>ytilt</code></em> fields which contain the extended
information reported as additional <em class="firstterm">valuators</em>
from the device. The <em class="structfield"><code>pressure</code></em> 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.)
</p>
<p>
One additional field in each event is the
<em class="structfield"><code>source</code></em> field, which contains an
enumeration value describing the type of device; this currently
can be one of <a href="gdk-Input-Devices.html#GDK-SOURCE-MOUSE:CAPS"><code class="literal">GDK_SOURCE_MOUSE</code></a>, <a href="gdk-Input-Devices.html#GDK-SOURCE-PEN:CAPS"><code class="literal">GDK_SOURCE_PEN</code></a>, <a href="gdk-Input-Devices.html#GDK-SOURCE-ERASER:CAPS"><code class="literal">GDK_SOURCE_ERASER</code></a>,
or <a href="gdk-Input-Devices.html#GDK-SOURCE-CURSOR:CAPS"><code class="literal">GDK_SOURCE_CURSOR</code></a>. 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.
</p>
<p>
Various aspects of each device may be configured. The easiest way of
creating a GUI to allow the user to configure such a device
is to use the <a
href="../gtk/GtkInputDialog.html"
><span class="type">GtkInputDialog</span></a> widget in GTK+.
However, even when using this widget, application writers
will need to directly query and set the configuration parameters
in order to save the state between invocations of the application.
The configuration of devices is queried using <a href="gdk-Input-Devices.html#gdk-devices-list"><code class="function">gdk_devices_list()</code></a>.
Each device must be activated using <a href="gdk-Input-Devices.html#gdk-device-set-mode"><code class="function">gdk_device_set_mode()</code></a>, 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
<a href="gdk-Input-Devices.html#gdk-device-set-axis-use"><code class="function">gdk_device_set_axis_use()</code></a>. And the source type for each device
can be set with <a href="gdk-Input-Devices.html#gdk-device-set-source"><code class="function">gdk_device_set_source()</code></a>.
</p>
<p>
Devices may also have associated <em class="firstterm">keys</em>
or macro buttons. Such keys can be globally set to map
into normal X keyboard events. The mapping is set using
<a href="gdk-Input-Devices.html#gdk-device-set-key"><code class="function">gdk_device_set_key()</code></a>.
</p>
<p>
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 <em class="structfield"><code>xtilt</code></em>
and <em class="structfield"><code>ytilt</code></em>.
</p>
</div>
<div class="refsect1" lang="en">
<a name="id3123856"></a><h2>Details</h2>
<div class="refsect2" lang="en">
<a name="id3123866"></a><h3>
<a name="GdkDevice"></a>GdkDevice</h3>
<a class="indexterm" name="id3123878"></a><pre class="programlisting">typedef struct {
GObject parent_instance;
/* All fields are read-only */
gchar *name;
GdkInputSource source;
GdkInputMode mode;
gboolean has_cursor; /* TRUE if the X pointer follows device motion */
gint num_axes;
GdkDeviceAxis *axes;
gint num_keys;
GdkDeviceKey *keys;
} GdkDevice;
</pre>
<p>
A <span class="structname">GdkDevice</span> structure contains
a detailed description of an extended input device. All
fields are read-only; but you can use <a href="gdk-Input-Devices.html#gdk-device-set-source"><code class="function">gdk_device_set_source()</code></a>,
<a href="gdk-Input-Devices.html#gdk-device-set-mode"><code class="function">gdk_device_set_mode()</code></a>, <a href="gdk-Input-Devices.html#gdk-device-set-key"><code class="function">gdk_device_set_key()</code></a> and <a href="gdk-Input-Devices.html#gdk-device-set-axis-use"><code class="function">gdk_device_set_axis_use()</code></a>
to configure various aspects of the device.
</p>
<div class="variablelist"><table border="0">
<col align="left" valign="top">
<tbody>
<tr>
<td>
<span class="term"><a
href="../gobject/gobject-The-Base-Object-Type.html#GObject"
>GObject</a> <em class="structfield"><code>parent_instance</code></em>;</span></td>
<td>the parent instance
</td>
</tr>
<tr>
<td>
<span class="term"><a
href="../glib/glib-Basic-Types.html#gchar"
>gchar</a> *<em class="structfield"><code>name</code></em>;</span></td>
<td>the name of this device.
</td>
</tr>
<tr>
<td>
<span class="term"><a href="gdk-Input-Devices.html#GdkInputSource">GdkInputSource</a> <em class="structfield"><code>source</code></em>;</span></td>
<td>the type of this device.
</td>
</tr>
<tr>
<td>
<span class="term"><a href="gdk-Input-Devices.html#GdkInputMode">GdkInputMode</a> <em class="structfield"><code>mode</code></em>;</span></td>
<td>the mode of this device
</td>
</tr>
<tr>
<td>
<span class="term"><a
href="../glib/glib-Basic-Types.html#gboolean"
>gboolean</a> <em class="structfield"><code>has_cursor</code></em>;</span></td>
<td>
<a
href="../glib/glib-Standard-Macros.html#TRUE:CAPS"
><code class="literal">TRUE</code></a> if the pointer follows device motion.
</td>
</tr>
<tr>
<td>
<span class="term"><a
href="../glib/glib-Basic-Types.html#gint"
>gint</a> <em class="structfield"><code>num_axes</code></em>;</span></td>
<td>the length of the <em class="parameter"><code>axes</code></em> array.
</td>
</tr>
<tr>
<td>
<span class="term"><a href="gdk-Input-Devices.html#GdkDeviceAxis">GdkDeviceAxis</a> *<em class="structfield"><code>axes</code></em>;</span></td>
<td>an array of <a href="gdk-Input-Devices.html#GdkDeviceAxis"><span class="type">GdkDeviceAxis</span></a>, describing the axes of this device.
</td>
</tr>
<tr>
<td>
<span class="term"><a
href="../glib/glib-Basic-Types.html#gint"
>gint</a> <em class="structfield"><code>num_keys</code></em>;</span></td>
<td>the length of the <em class="parameter"><code>keys</code></em> array.
</td>
</tr>
<tr>
<td>
<span class="term"><a href="gdk-Input-Devices.html#GdkDeviceKey">GdkDeviceKey</a> *<em class="structfield"><code>keys</code></em>;</span></td>
<td>an array of <a href="gdk-Input-Devices.html#GdkDeviceKey"><span class="type">GdkDeviceKey</span></a>, describing the mapped macro buttons
of this device.
</td>
</tr>
</tbody>
</table></div>
</div>
<hr>
<div class="refsect2" lang="en">
<a name="id3124177"></a><h3>
<a name="GdkInputSource"></a>enum GdkInputSource</h3>
<a class="indexterm" name="id3124190"></a><pre class="programlisting">typedef enum
{
GDK_SOURCE_MOUSE,
GDK_SOURCE_PEN,
GDK_SOURCE_ERASER,
GDK_SOURCE_CURSOR
} GdkInputSource;
</pre>
<p>
An enumeration describing the type of an input device
in general terms.
</p>
<div class="variablelist"><table border="0">
<col align="left" valign="top">
<tbody>
<tr>
<td>
<span class="term"><a name="GDK-SOURCE-MOUSE:CAPS"></a><code class="literal">GDK_SOURCE_MOUSE</code></span></td>
<td>the device is a mouse. (This will be reported for the core
pointer, even if it is something else, such as a trackball.)
</td>
</tr>
<tr>
<td>
<span class="term"><a name="GDK-SOURCE-PEN:CAPS"></a><code class="literal">GDK_SOURCE_PEN</code></span></td>
<td>the device is a stylus of a graphics tablet or similar device.
</td>
</tr>
<tr>
<td>
<span class="term"><a name="GDK-SOURCE-ERASER:CAPS"></a><code class="literal">GDK_SOURCE_ERASER</code></span></td>
<td>the device is an eraser. Typically, this would be the other end
of a stylus on a graphics tablet.
</td>
</tr>
<tr>
<td>
<span class="term"><a name="GDK-SOURCE-CURSOR:CAPS"></a><code class="literal">GDK_SOURCE_CURSOR</code></span></td>
<td>the device is a graphics tablet "puck" or similar device.
</td>
</tr>
</tbody>
</table></div>
</div>
<hr>
<div class="refsect2" lang="en">
<a name="id3124307"></a><h3>
<a name="GdkInputMode"></a>enum GdkInputMode</h3>
<a class="indexterm" name="id3124320"></a><pre class="programlisting">typedef enum
{
GDK_MODE_DISABLED,
GDK_MODE_SCREEN,
GDK_MODE_WINDOW
} GdkInputMode;
</pre>
<p>
An enumeration that describes the mode of an input device.
</p>
<div class="variablelist"><table border="0">
<col align="left" valign="top">
<tbody>
<tr>
<td>
<span class="term"><a name="GDK-MODE-DISABLED:CAPS"></a><code class="literal">GDK_MODE_DISABLED</code></span></td>
<td>the device is disabled and will not report any events.
</td>
</tr>
<tr>
<td>
<span class="term"><a name="GDK-MODE-SCREEN:CAPS"></a><code class="literal">GDK_MODE_SCREEN</code></span></td>
<td>the device is enabled. The device's coordinate space
maps to the entire screen.
</td>
</tr>
<tr>
<td>
<span class="term"><a name="GDK-MODE-WINDOW:CAPS"></a><code class="literal">GDK_MODE_WINDOW</code></span></td>
<td>the device is enabled. The device's coordinate space
is mapped to a single window. The manner in which this window
is chosen is undefined, but it will typically be the same
way in which the focus window for key events is determined.
</td>
</tr>
</tbody>
</table></div>
</div>
<hr>
<div class="refsect2" lang="en">
<a name="id3124417"></a><h3>
<a name="GdkDeviceKey"></a>GdkDeviceKey</h3>
<a class="indexterm" name="id3124429"></a><pre class="programlisting">typedef struct {
guint keyval;
GdkModifierType modifiers;
} GdkDeviceKey;
</pre>
<p>
The <span class="structname">GdkDeviceKey</span> structure contains information
about the mapping of one device macro button onto a normal X key event.
It has the following fields:
</p>
<div class="variablelist"><table border="0">
<col align="left" valign="top">
<tbody>
<tr>
<td>
<span class="term"><a
href="../glib/glib-Basic-Types.html#guint"
>guint</a> <em class="structfield"><code>keyval</code></em>;</span></td>
<td>the keyval to generate when the macro button is pressed.
If this is 0, no keypress will be generated.
</td>
</tr>
<tr>
<td>
<span class="term"><a href="gdk-Windows.html#GdkModifierType">GdkModifierType</a> <em class="structfield"><code>modifiers</code></em>;</span></td>
<td>the modifiers set for the generated key event.
</td>
</tr>
</tbody>
</table></div>
</div>
<hr>
<div class="refsect2" lang="en">
<a name="id3124499"></a><h3>
<a name="GdkDeviceAxis"></a>GdkDeviceAxis</h3>
<a class="indexterm" name="id3124512"></a><pre class="programlisting">typedef struct {
GdkAxisUse use;
gdouble min;
gdouble max;
} GdkDeviceAxis;
</pre>
<p>
The <span class="structname">GdkDeviceAxis</span> structure contains information
about the range and mapping of a device axis.
</p>
<div class="variablelist"><table border="0">
<col align="left" valign="top">
<tbody>
<tr>
<td>
<span class="term"><a href="gdk-Input-Devices.html#GdkAxisUse">GdkAxisUse</a> <em class="structfield"><code>use</code></em>;</span></td>
<td>specifies how the axis is used.
</td>
</tr>
<tr>
<td>
<span class="term"><a
href="../glib/glib-Basic-Types.html#gdouble"
>gdouble</a> <em class="structfield"><code>min</code></em>;</span></td>
<td>the minimal value that will be reported by this axis.
</td>
</tr>
<tr>
<td>
<span class="term"><a
href="../glib/glib-Basic-Types.html#gdouble"
>gdouble</a> <em class="structfield"><code>max</code></em>;</span></td>
<td>the maximal value that will be reported by this axis.
</td>
</tr>
</tbody>
</table></div>
</div>
<hr>
<div class="refsect2" lang="en">
<a name="id3124601"></a><h3>
<a name="GdkAxisUse"></a>enum GdkAxisUse</h3>
<a class="indexterm" name="id3124614"></a><pre class="programlisting">typedef enum
{
GDK_AXIS_IGNORE,
GDK_AXIS_X,
GDK_AXIS_Y,
GDK_AXIS_PRESSURE,
GDK_AXIS_XTILT,
GDK_AXIS_YTILT,
GDK_AXIS_WHEEL,
GDK_AXIS_LAST
} GdkAxisUse;
</pre>
<p>
An enumeration describing the way in which a device
axis (valuator) maps onto the predefined valuator
types that GTK+ understands.
</p>
<div class="variablelist"><table border="0">
<col align="left" valign="top">
<tbody>
<tr>
<td>
<span class="term"><a name="GDK-AXIS-IGNORE:CAPS"></a><code class="literal">GDK_AXIS_IGNORE</code></span></td>
<td>the axis is ignored.
</td>
</tr>
<tr>
<td>
<span class="term"><a name="GDK-AXIS-X:CAPS"></a><code class="literal">GDK_AXIS_X</code></span></td>
<td>the axis is used as the x axis.
</td>
</tr>
<tr>
<td>
<span class="term"><a name="GDK-AXIS-Y:CAPS"></a><code class="literal">GDK_AXIS_Y</code></span></td>
<td>the axis is used as the y axis.
</td>
</tr>
<tr>
<td>
<span class="term"><a name="GDK-AXIS-PRESSURE:CAPS"></a><code class="literal">GDK_AXIS_PRESSURE</code></span></td>
<td>the axis is used for pressure information.
</td>
</tr>
<tr>
<td>
<span class="term"><a name="GDK-AXIS-XTILT:CAPS"></a><code class="literal">GDK_AXIS_XTILT</code></span></td>
<td>the axis is used for x tilt information.
</td>
</tr>
<tr>
<td>
<span class="term"><a name="GDK-AXIS-YTILT:CAPS"></a><code class="literal">GDK_AXIS_YTILT</code></span></td>
<td>the axis is used for x tilt information.
</td>
</tr>
<tr>
<td>
<span class="term"><a name="GDK-AXIS-WHEEL:CAPS"></a><code class="literal">GDK_AXIS_WHEEL</code></span></td>
<td>the axis is used for wheel information.
</td>
</tr>
<tr>
<td>
<span class="term"><a name="GDK-AXIS-LAST:CAPS"></a><code class="literal">GDK_AXIS_LAST</code></span></td>
<td>a constant equal to the numerically highest axis value.
</td>
</tr>
</tbody>
</table></div>
</div>
<hr>
<div class="refsect2" lang="en">
<a name="id3124821"></a><h3>
<a name="gdk-devices-list"></a>gdk_devices_list ()</h3>
<a class="indexterm" name="id3124834"></a><pre class="programlisting"><a
href="../glib/glib-Doubly-Linked-Lists.html#GList"
>GList</a>* gdk_devices_list (void);</pre>
<p>
Returns the list of available input devices for the default display.
The list is statically allocated and should not be freed.</p>
<p>
</p>
<div class="variablelist"><table border="0">
<col align="left" valign="top">
<tbody><tr>
<td>
<span class="term"><span class="emphasis"><em>Returns</em></span> :</span></td>
<td> a list of <a href="gdk-Input-Devices.html#GdkDevice"><span class="type">GdkDevice</span></a>
</td>
</tr></tbody>
</table></div>
</div>
<hr>
<div class="refsect2" lang="en">
<a name="id3124883"></a><h3>
<a name="gdk-device-set-source"></a>gdk_device_set_source ()</h3>
<a class="indexterm" name="id3124896"></a><pre class="programlisting">void gdk_device_set_source (<a href="gdk-Input-Devices.html#GdkDevice">GdkDevice</a> *device,
<a href="gdk-Input-Devices.html#GdkInputSource">GdkInputSource</a> source);</pre>
<p>
Sets the source type for an input device.
</p>
<div class="variablelist"><table border="0">
<col align="left" valign="top">
<tbody>
<tr>
<td>
<span class="term"><em class="parameter"><code>device</code></em> :</span></td>
<td>a <a href="gdk-Input-Devices.html#GdkDevice"><span class="type">GdkDevice</span></a>.
</td>
</tr>
<tr>
<td>
<span class="term"><em class="parameter"><code>source</code></em> :</span></td>
<td>the source type.
</td>
</tr>
</tbody>
</table></div>
</div>
<hr>
<div class="refsect2" lang="en">
<a name="id3124973"></a><h3>
<a name="gdk-device-set-mode"></a>gdk_device_set_mode ()</h3>
<a class="indexterm" name="id3124986"></a><pre class="programlisting"><a
href="../glib/glib-Basic-Types.html#gboolean"
>gboolean</a> gdk_device_set_mode (<a href="gdk-Input-Devices.html#GdkDevice">GdkDevice</a> *device,
<a href="gdk-Input-Devices.html#GdkInputMode">GdkInputMode</a> mode);</pre>
<p>
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.
</p>
<div class="variablelist"><table border="0">
<col align="left" valign="top">
<tbody>
<tr>
<td>
<span class="term"><em class="parameter"><code>device</code></em> :</span></td>
<td>a <a href="gdk-Input-Devices.html#GdkDevice"><span class="type">GdkDevice</span></a>.
</td>
</tr>
<tr>
<td>
<span class="term"><em class="parameter"><code>mode</code></em> :</span></td>
<td>the input mode.
</td>
</tr>
<tr>
<td>
<span class="term"><span class="emphasis"><em>Returns</em></span> :</span></td>
<td>
<a
href="../glib/glib-Standard-Macros.html#TRUE:CAPS"
><code class="literal">TRUE</code></a> if the mode was successfully changed.
</td>
</tr>
</tbody>
</table></div>
</div>
<hr>
<div class="refsect2" lang="en">
<a name="id3125084"></a><h3>
<a name="gdk-device-set-key"></a>gdk_device_set_key ()</h3>
<a class="indexterm" name="id3125098"></a><pre class="programlisting">void gdk_device_set_key (<a href="gdk-Input-Devices.html#GdkDevice">GdkDevice</a> *device,
<a
href="../glib/glib-Basic-Types.html#guint"
>guint</a> index_,
<a
href="../glib/glib-Basic-Types.html#guint"
>guint</a> keyval,
<a href="gdk-Windows.html#GdkModifierType">GdkModifierType</a> modifiers);</pre>
<p>
Specifies the X key event to generate when a macro button of a device
is pressed.
</p>
<div class="variablelist"><table border="0">
<col align="left" valign="top">
<tbody>
<tr>
<td>
<span class="term"><em class="parameter"><code>device</code></em> :</span></td>
<td>a <a href="gdk-Input-Devices.html#GdkDevice"><span class="type">GdkDevice</span></a>.
</td>
</tr>
<tr>
<td>
<span class="term"><em class="parameter"><code>index_</code></em> :</span></td>
<td>the index of the macro button to set.
</td>
</tr>
<tr>
<td>
<span class="term"><em class="parameter"><code>keyval</code></em> :</span></td>
<td>the keyval to generate.
</td>
</tr>
<tr>
<td>
<span class="term"><em class="parameter"><code>modifiers</code></em> :</span></td>
<td>the modifiers to set.
</td>
</tr>
</tbody>
</table></div>
</div>
<hr>
<div class="refsect2" lang="en">
<a name="id3125218"></a><h3>
<a name="gdk-device-set-axis-use"></a>gdk_device_set_axis_use ()</h3>
<a class="indexterm" name="id3125231"></a><pre class="programlisting">void gdk_device_set_axis_use (<a href="gdk-Input-Devices.html#GdkDevice">GdkDevice</a> *device,
<a
href="../glib/glib-Basic-Types.html#guint"
>guint</a> index_,
<a href="gdk-Input-Devices.html#GdkAxisUse">GdkAxisUse</a> use);</pre>
<p>
Specifies how an axis of a device is used.
</p>
<div class="variablelist"><table border="0">
<col align="left" valign="top">
<tbody>
<tr>
<td>
<span class="term"><em class="parameter"><code>device</code></em> :</span></td>
<td>a <a href="gdk-Input-Devices.html#GdkDevice"><span class="type">GdkDevice</span></a>.
</td>
</tr>
<tr>
<td>
<span class="term"><em class="parameter"><code>index_</code></em> :</span></td>
<td>the index of the axis.
</td>
</tr>
<tr>
<td>
<span class="term"><em class="parameter"><code>use</code></em> :</span></td>
<td>specifies how the axis is used.
</td>
</tr>
</tbody>
</table></div>
</div>
<hr>
<div class="refsect2" lang="en">
<a name="id3125329"></a><h3>
<a name="gdk-device-get-core-pointer"></a>gdk_device_get_core_pointer ()</h3>
<a class="indexterm" name="id3125343"></a><pre class="programlisting"><a href="gdk-Input-Devices.html#GdkDevice">GdkDevice</a>* gdk_device_get_core_pointer (void);</pre>
<p>
Returns the core pointer device for the default display.</p>
<p>
</p>
<div class="variablelist"><table border="0">
<col align="left" valign="top">
<tbody><tr>
<td>
<span class="term"><span class="emphasis"><em>Returns</em></span> :</span></td>
<td> the core pointer device; this is owned by the
display and should not be freed.
</td>
</tr></tbody>
</table></div>
</div>
<hr>
<div class="refsect2" lang="en">
<a name="id3125384"></a><h3>
<a name="gdk-device-get-state"></a>gdk_device_get_state ()</h3>
<a class="indexterm" name="id3125397"></a><pre class="programlisting">void gdk_device_get_state (<a href="gdk-Input-Devices.html#GdkDevice">GdkDevice</a> *device,
<a href="gdk-Windows.html#GdkWindow">GdkWindow</a> *window,
<a
href="../glib/glib-Basic-Types.html#gdouble"
>gdouble</a> *axes,
<a href="gdk-Windows.html#GdkModifierType">GdkModifierType</a> *mask);</pre>
<p>
Gets the current state of a device.
</p>
<div class="variablelist"><table border="0">
<col align="left" valign="top">
<tbody>
<tr>
<td>
<span class="term"><em class="parameter"><code>device</code></em> :</span></td>
<td>a <a href="gdk-Input-Devices.html#GdkDevice"><span class="type">GdkDevice</span></a>.
</td>
</tr>
<tr>
<td>
<span class="term"><em class="parameter"><code>window</code></em> :</span></td>
<td>a <a href="gdk-Windows.html#GdkWindow"><span class="type">GdkWindow</span></a>.
</td>
</tr>
<tr>
<td>
<span class="term"><em class="parameter"><code>axes</code></em> :</span></td>
<td>an array of doubles to store the values of the axes of <em class="parameter"><code>device</code></em> in,
or <a
href="../glib/glib-Standard-Macros.html#NULL:CAPS"
><code class="literal">NULL</code></a>.
</td>
</tr>
<tr>
<td>
<span class="term"><em class="parameter"><code>mask</code></em> :</span></td>
<td>location to store the modifiers, or <a
href="../glib/glib-Standard-Macros.html#NULL:CAPS"
><code class="literal">NULL</code></a>.
</td>
</tr>
</tbody>
</table></div>
</div>
<hr>
<div class="refsect2" lang="en">
<a name="id3125552"></a><h3>
<a name="gdk-device-get-history"></a>gdk_device_get_history ()</h3>
<a class="indexterm" name="id3125565"></a><pre class="programlisting"><a
href="../glib/glib-Basic-Types.html#gboolean"
>gboolean</a> gdk_device_get_history (<a href="gdk-Input-Devices.html#GdkDevice">GdkDevice</a> *device,
<a href="gdk-Windows.html#GdkWindow">GdkWindow</a> *window,
<a
href="../glib/glib-Basic-Types.html#guint32"
>guint32</a> start,
<a
href="../glib/glib-Basic-Types.html#guint32"
>guint32</a> stop,
<a href="gdk-Input-Devices.html#GdkTimeCoord">GdkTimeCoord</a> ***events,
<a
href="../glib/glib-Basic-Types.html#gint"
>gint</a> *n_events);</pre>
<p>
Obtains the motion history for a device; given a starting and
ending timestamp, 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, <a
href="../glib/glib-Standard-Macros.html#FALSE:CAPS"
><code class="literal">FALSE</code></a> will
be returned. (This is not distinguishable from the case where
motion history is supported and no events were found.)</p>
<p>
</p>
<div class="variablelist"><table border="0">
<col align="left" valign="top">
<tbody>
<tr>
<td>
<span class="term"><em class="parameter"><code>device</code></em> :</span></td>
<td> a <a href="gdk-Input-Devices.html#GdkDevice"><span class="type">GdkDevice</span></a>
</td>
</tr>
<tr>
<td>
<span class="term"><em class="parameter"><code>window</code></em> :</span></td>
<td> the window with respect to which which the event coordinates will be reported
</td>
</tr>
<tr>
<td>
<span class="term"><em class="parameter"><code>start</code></em> :</span></td>
<td> starting timestamp for range of events to return
</td>
</tr>
<tr>
<td>
<span class="term"><em class="parameter"><code>stop</code></em> :</span></td>
<td> ending timestamp for the range of events to return
</td>
</tr>
<tr>
<td>
<span class="term"><em class="parameter"><code>events</code></em> :</span></td>
<td> location to store a newly-allocated array of <a href="gdk-Input-Devices.html#GdkTimeCoord"><span class="type">GdkTimeCoord</span></a>, or <a
href="../glib/glib-Standard-Macros.html#NULL:CAPS"
><code class="literal">NULL</code></a>
</td>
</tr>
<tr>
<td>
<span class="term"><em class="parameter"><code>n_events</code></em> :</span></td>
<td> location to store the length of <em class="parameter"><code>events</code></em>, or <a
href="../glib/glib-Standard-Macros.html#NULL:CAPS"
><code class="literal">NULL</code></a>
</td>
</tr>
<tr>
<td>
<span class="term"><span class="emphasis"><em>Returns</em></span> :</span></td>
<td> <a
href="../glib/glib-Standard-Macros.html#TRUE:CAPS"
><code class="literal">TRUE</code></a> if the windowing system supports motion history and
at least one event was found.
</td>
</tr>
</tbody>
</table></div>
</div>
<hr>
<div class="refsect2" lang="en">
<a name="id3125806"></a><h3>
<a name="gdk-device-free-history"></a>gdk_device_free_history ()</h3>
<a class="indexterm" name="id3125819"></a><pre class="programlisting">void gdk_device_free_history (<a href="gdk-Input-Devices.html#GdkTimeCoord">GdkTimeCoord</a> **events,
<a
href="../glib/glib-Basic-Types.html#gint"
>gint</a> n_events);</pre>
<p>
Frees an array of <a href="gdk-Input-Devices.html#GdkTimeCoord"><span class="type">GdkTimeCoord</span></a> that was returned by <a href="gdk-Input-Devices.html#gdk-device-get-history"><code class="function">gdk_device_get_history()</code></a>.
</p>
<div class="variablelist"><table border="0">
<col align="left" valign="top">
<tbody>
<tr>
<td>
<span class="term"><em class="parameter"><code>events</code></em> :</span></td>
<td>an array of <a href="gdk-Input-Devices.html#GdkTimeCoord"><span class="type">GdkTimeCoord</span></a>.
</td>
</tr>
<tr>
<td>
<span class="term"><em class="parameter"><code>n_events</code></em> :</span></td>
<td>the length of the array.
</td>
</tr>
</tbody>
</table></div>
</div>
<hr>
<div class="refsect2" lang="en">
<a name="id3125916"></a><h3>
<a name="GdkTimeCoord"></a>GdkTimeCoord</h3>
<a class="indexterm" name="id3125929"></a><pre class="programlisting">typedef struct {
guint32 time;
gdouble axes[GDK_MAX_TIMECOORD_AXES];
} GdkTimeCoord;
</pre>
<p>
The <a href="gdk-Input-Devices.html#GdkTimeCoord"><span class="type">GdkTimeCoord</span></a> structure stores a single event in a
motion history. It contains the following fields:
</p>
<div class="variablelist"><table border="0">
<col align="left" valign="top">
<tbody>
<tr>
<td>
<span class="term"><a
href="../glib/glib-Basic-Types.html#guint32"
>guint32</a> <em class="structfield"><code>time</code></em>;</span></td>
<td>The timestamp for this event.
</td>
</tr>
<tr>
<td>
<span class="term"><a
href="../glib/glib-Basic-Types.html#gdouble"
>gdouble</a> <em class="structfield"><code>axes</code></em>[GDK_MAX_TIMECOORD_AXES];</span></td>
<td>the values of the device's axes.
</td>
</tr>
</tbody>
</table></div>
</div>
<hr>
<div class="refsect2" lang="en">
<a name="id3126001"></a><h3>
<a name="gdk-device-get-axis"></a>gdk_device_get_axis ()</h3>
<a class="indexterm" name="id3126015"></a><pre class="programlisting"><a
href="../glib/glib-Basic-Types.html#gboolean"
>gboolean</a> gdk_device_get_axis (<a href="gdk-Input-Devices.html#GdkDevice">GdkDevice</a> *device,
<a
href="../glib/glib-Basic-Types.html#gdouble"
>gdouble</a> *axes,
<a href="gdk-Input-Devices.html#GdkAxisUse">GdkAxisUse</a> use,
<a
href="../glib/glib-Basic-Types.html#gdouble"
>gdouble</a> *value);</pre>
<p>
Interprets an array of double as axis values for a given device,
and locates the value in the array for a given axis use.</p>
<p>
</p>
<div class="variablelist"><table border="0">
<col align="left" valign="top">
<tbody>
<tr>
<td>
<span class="term"><em class="parameter"><code>device</code></em> :</span></td>
<td> a <a href="gdk-Input-Devices.html#GdkDevice"><span class="type">GdkDevice</span></a>
</td>
</tr>
<tr>
<td>
<span class="term"><em class="parameter"><code>axes</code></em> :</span></td>
<td> pointer to an array of axes
</td>
</tr>
<tr>
<td>
<span class="term"><em class="parameter"><code>use</code></em> :</span></td>
<td> the use to look for
</td>
</tr>
<tr>
<td>
<span class="term"><em class="parameter"><code>value</code></em> :</span></td>
<td> location to store the found value.
</td>
</tr>
<tr>
<td>
<span class="term"><span class="emphasis"><em>Returns</em></span> :</span></td>
<td> <a
href="../glib/glib-Standard-Macros.html#TRUE:CAPS"
><code class="literal">TRUE</code></a> if the given axis use was found, otherwise <a
href="../glib/glib-Standard-Macros.html#FALSE:CAPS"
><code class="literal">FALSE</code></a>
</td>
</tr>
</tbody>
</table></div>
</div>
<hr>
<div class="refsect2" lang="en">
<a name="id3126170"></a><h3>
<a name="gdk-input-set-extension-events"></a>gdk_input_set_extension_events ()</h3>
<a class="indexterm" name="id3126183"></a><pre class="programlisting">void gdk_input_set_extension_events (<a href="gdk-Windows.html#GdkWindow">GdkWindow</a> *window,
<a
href="../glib/glib-Basic-Types.html#gint"
>gint</a> mask,
<a href="gdk-Input-Devices.html#GdkExtensionMode">GdkExtensionMode</a> mode);</pre>
<p>
Turns extension events on or off for a particular window,
and specifies the event mask for extension events.
</p>
<div class="variablelist"><table border="0">
<col align="left" valign="top">
<tbody>
<tr>
<td>
<span class="term"><em class="parameter"><code>window</code></em> :</span></td>
<td>a <a href="gdk-Windows.html#GdkWindow"><span class="type">GdkWindow</span></a>.
</td>
</tr>
<tr>
<td>
<span class="term"><em class="parameter"><code>mask</code></em> :</span></td>
<td>the event mask
</td>
</tr>
<tr>
<td>
<span class="term"><em class="parameter"><code>mode</code></em> :</span></td>
<td>the type of extension events that are desired.
</td>
</tr>
</tbody>
</table></div>
</div>
<hr>
<div class="refsect2" lang="en">
<a name="id3126283"></a><h3>
<a name="GdkExtensionMode"></a>enum GdkExtensionMode</h3>
<a class="indexterm" name="id3126297"></a><pre class="programlisting">typedef enum
{
GDK_EXTENSION_EVENTS_NONE,
GDK_EXTENSION_EVENTS_ALL,
GDK_EXTENSION_EVENTS_CURSOR
} GdkExtensionMode;
</pre>
<p>
An enumeration used to specify which extension events
are desired for a particular widget.
</p>
<div class="variablelist"><table border="0">
<col align="left" valign="top">
<tbody>
<tr>
<td>
<span class="term"><a name="GDK-EXTENSION-EVENTS-NONE:CAPS"></a><code class="literal">GDK_EXTENSION_EVENTS_NONE</code></span></td>
<td>no extension events are desired.
</td>
</tr>
<tr>
<td>
<span class="term"><a name="GDK-EXTENSION-EVENTS-ALL:CAPS"></a><code class="literal">GDK_EXTENSION_EVENTS_ALL</code></span></td>
<td>all extension events are desired.
</td>
</tr>
<tr>
<td>
<span class="term"><a name="GDK-EXTENSION-EVENTS-CURSOR:CAPS"></a><code class="literal">GDK_EXTENSION_EVENTS_CURSOR</code></span></td>
<td>extension events are desired only if a cursor
will be displayed for the device.
</td>
</tr>
</tbody>
</table></div>
</div>
</div>
</div>
</body>
</html>