<refentry id="gdk-Input-Devices">
<refmeta>
<refentrytitle>Input Devices</refentrytitle>
<manvolnum>3</manvolnum>
<refmiscinfo>GDK Library</refmiscinfo>
</refmeta>

<refnamediv>
<refname>Input Devices</refname><refpurpose>Functions for handling extended input devices.</refpurpose>
</refnamediv>

<refsynopsisdiv><title>Synopsis</title>
<synopsis>

#include &lt;gdk/gdk.h&gt;


struct      <link linkend="GdkDevice">GdkDevice</link>;
enum        <link linkend="GdkInputSource">GdkInputSource</link>;
enum        <link linkend="GdkInputMode">GdkInputMode</link>;
struct      <link linkend="GdkDeviceKey">GdkDeviceKey</link>;
struct      <link linkend="GdkDeviceAxis">GdkDeviceAxis</link>;
enum        <link linkend="GdkAxisUse">GdkAxisUse</link>;
<link linkend="GList">GList</link>*      <link linkend="gdk-devices-list">gdk_devices_list</link>                (void);
void        <link linkend="gdk-device-set-source">gdk_device_set_source</link>           (<link linkend="GdkDevice">GdkDevice</link> *device,
                                             <link linkend="GdkInputSource">GdkInputSource</link> source);
<link linkend="gboolean">gboolean</link>    <link linkend="gdk-device-set-mode">gdk_device_set_mode</link>             (<link linkend="GdkDevice">GdkDevice</link> *device,
                                             <link linkend="GdkInputMode">GdkInputMode</link> mode);
void        <link linkend="gdk-device-set-key">gdk_device_set_key</link>              (<link linkend="GdkDevice">GdkDevice</link> *device,
                                             <link linkend="guint">guint</link> index,
                                             <link linkend="guint">guint</link> keyval,
                                             <link linkend="GdkModifierType">GdkModifierType</link> modifiers);
void        <link linkend="gdk-device-set-axis-use">gdk_device_set_axis_use</link>         (<link linkend="GdkDevice">GdkDevice</link> *device,
                                             <link linkend="guint">guint</link> index,
                                             <link linkend="GdkAxisUse">GdkAxisUse</link> use);
<link linkend="GdkDevice">GdkDevice</link>*  <link linkend="gdk-device-get-core-pointer">gdk_device_get_core_pointer</link>     (void);

void        <link linkend="gdk-device-get-state">gdk_device_get_state</link>            (<link linkend="GdkDevice">GdkDevice</link> *device,
                                             <link linkend="GdkWindow">GdkWindow</link> *window,
                                             <link linkend="gdouble">gdouble</link> *axes,
                                             <link linkend="GdkModifierType">GdkModifierType</link> *mask);
<link linkend="gboolean">gboolean</link>    <link linkend="gdk-device-get-history">gdk_device_get_history</link>          (<link linkend="GdkDevice">GdkDevice</link> *device,
                                             <link linkend="GdkWindow">GdkWindow</link> *window,
                                             <link linkend="guint32">guint32</link> start,
                                             <link linkend="guint32">guint32</link> stop,
                                             <link linkend="GdkTimeCoord">GdkTimeCoord</link> ***events,
                                             <link linkend="gint">gint</link> *n_events);
void        <link linkend="gdk-device-free-history">gdk_device_free_history</link>         (<link linkend="GdkTimeCoord">GdkTimeCoord</link> **events,
                                             <link linkend="gint">gint</link> n_events);
struct      <link linkend="GdkTimeCoord">GdkTimeCoord</link>;
<link linkend="gboolean">gboolean</link>    <link linkend="gdk-device-get-axis">gdk_device_get_axis</link>             (<link linkend="GdkDevice">GdkDevice</link> *device,
                                             <link linkend="gdouble">gdouble</link> *axes,
                                             <link linkend="GdkAxisUse">GdkAxisUse</link> use,
                                             <link linkend="gdouble">gdouble</link> *value);

void        <link linkend="gdk-input-set-extension-events">gdk_input_set_extension_events</link>  (<link linkend="GdkWindow">GdkWindow</link> *window,
                                             <link linkend="gint">gint</link> mask,
                                             <link linkend="GdkExtensionMode">GdkExtensionMode</link> mode);
enum        <link linkend="GdkExtensionMode">GdkExtensionMode</link>;


</synopsis>
</refsynopsisdiv>





<refsect1>
<title>Description</title>
<para>
In addition to the normal keyboard and mouse input devices, GTK+ also
contains support for <firstterm>extended input devices</firstterm>. 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 
<firstterm>XInput</firstterm> extension.
</para>
<para>
Because handling extended input devices may involve considerable
overhead, they need to be turned on for each <link linkend="GdkWindow">GdkWindow</link>
individually using <link linkend="gdk-input-set-extension-events">gdk_input_set_extension_events</link>().
(Or, more typically, for GtkWidgets, using <link linkend="gtk-widget-set-extension-events">gtk_widget_set_extension_events</link>()).
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
<literal>GDK_EXTENSION_EVENTS_CURSOR</literal> value to
<link linkend="gdk-input-set-extension-events">gdk_input_set_extension_events</link>(). Otherwise, the application
must retrieve the device information using <link linkend="gdk-devices-list">gdk_devices_list</link>(),
check the <structfield>has_cursor</structfield> field, and, 
if it is <literal>FALSE</literal>, draw a cursor itself when it receives 
motion events.
</para>
<para>
Each pointing device is assigned a unique integer ID; events from a
particular device can be identified by the
<structfield>deviceid</structfield> field in the event structure. The
events generated by pointer devices have also been extended to contain
<structfield>pressure</structfield>, <structfield>xtilt</structfield>
and <structfield>ytilt</structfield> fields which contain the extended
information reported as additional <firstterm>valuators</firstterm>
from the device. The <structfield>pressure</structfield> 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.)
</para>
<para>
One additional field in each event is the
<structfield>source</structfield> field, which contains an
enumeration value describing the type of device; this currently
can be one of <literal>GDK_SOURCE_MOUSE</literal>, <literal>GDK_SOURCE_PEN</literal>, <literal>GDK_SOURCE_ERASER</literal>,
or <literal>GDK_SOURCE_CURSOR</literal>. 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.
</para>
<para>
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 <link linkend="GtkInputDialog">GtkInputDialog</link> 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 <link linkend="gdk-devices-list">gdk_devices_list</link>().
Each device must be activated using <link linkend="gdk-device-set-mode">gdk_device_set_mode</link>(), 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
<link linkend="gdk-device-set-axis-use">gdk_device_set_axis_use</link>(). And the source type for each device
can be set with <link linkend="gdk-device-set-source">gdk_device_set_source</link>().
</para>
<para>
Devices may also have associated <firstterm>keys</firstterm>
or macro buttons. Such keys can be globally set to map
into normal X keyboard events. The mapping is set using
<link linkend="gdk-device-set-key">gdk_device_set_key</link>().
</para>
<para>
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 <structfield>xtilt</structfield>
and <structfield>ytilt</structfield>.
</para>
</refsect1>

<refsect1>
<title>Details</title>
<refsect2>
<title><anchor id="GdkDevice">struct GdkDevice</title>
<programlisting>struct GdkDevice
{
  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;
};
</programlisting>
<para>
A <structname>GdkDevice</structname> structure contains
a detailed description of an extended input device. All
fields are read-only; but you can use <link linkend="gdk-device-set-source">gdk_device_set_source</link>(),
<link linkend="gdk-device-set-mode">gdk_device_set_mode</link>(), <link linkend="gdk-device-set-key">gdk_device_set_key</link>() and <link linkend="gdk-device-set-axis-use">gdk_device_set_axis_use</link>()
to configure various aspects of the device.
</para><informaltable pgwide="1" frame="none" role="struct">
<tgroup cols="2">
<colspec colwidth="2*">
<colspec colwidth="8*">
<tbody>
<row>
<entry><link linkend="GObject">GObject</link> <structfield>parent_instance</structfield></entry>
<entry>
</entry>
</row>
<row>
<entry><link linkend="gchar">gchar</link> *<structfield>name</structfield></entry>
<entry>the name of this device.
</entry>
</row>
<row>
<entry><link linkend="GdkInputSource">GdkInputSource</link> <structfield>source</structfield></entry>
<entry>the type of this device.
</entry>
</row>
<row>
<entry><link linkend="GdkInputMode">GdkInputMode</link> <structfield>mode</structfield></entry>
<entry>the mode of this device
</entry>
</row>
<row>
<entry><link linkend="gboolean">gboolean</link> <structfield>has_cursor</structfield></entry>
<entry><literal>TRUE</literal> if the pointer follows device motion.
</entry>
</row>
<row>
<entry><link linkend="gint">gint</link> <structfield>num_axes</structfield></entry>
<entry>the length of the <parameter>axes</parameter> array.
</entry>
</row>
<row>
<entry><link linkend="GdkDeviceAxis">GdkDeviceAxis</link> *<structfield>axes</structfield></entry>
<entry>an array of <link linkend="GdkDeviceAxis">GdkDeviceAxis</link>, describing the axes of this device.
</entry>
</row>
<row>
<entry><link linkend="gint">gint</link> <structfield>num_keys</structfield></entry>
<entry>the length of the <parameter>keys</parameter> array.
</entry>
</row>
<row>
<entry><link linkend="GdkDeviceKey">GdkDeviceKey</link> *<structfield>keys</structfield></entry>
<entry>an array of <link linkend="GdkDeviceKey">GdkDeviceKey</link>, describing the mapped macro buttons 
  of this device.

</entry>
</row>
</tbody></tgroup></informaltable></refsect2>
<refsect2>
<title><anchor id="GdkInputSource">enum GdkInputSource</title>
<programlisting>typedef enum
{
  GDK_SOURCE_MOUSE,
  GDK_SOURCE_PEN,
  GDK_SOURCE_ERASER,
  GDK_SOURCE_CURSOR
} GdkInputSource;
</programlisting>
<para>
An enumeration describing the type of an input device
in general terms.
</para><informaltable pgwide="1" frame="none" role="enum">
<tgroup cols="2">
<colspec colwidth="2*">
<colspec colwidth="8*">
<tbody>
<row>
<entry><literal>GDK_SOURCE_MOUSE</literal></entry>
<entry>the device is a mouse. (This will be reported for the core
                    pointer, even if it is something else, such as a trackball.)
</entry>
</row>
<row>
<entry><literal>GDK_SOURCE_PEN</literal></entry>
<entry>the device is a stylus of a graphics tablet or similar device.
</entry>
</row>
<row>
<entry><literal>GDK_SOURCE_ERASER</literal></entry>
<entry>the device is an eraser. Typically, this would be the other end
                    of a stylus on a graphics tablet.
</entry>
</row>
<row>
<entry><literal>GDK_SOURCE_CURSOR</literal></entry>
<entry>the device is a graphics tablet "puck" or similar device.

</entry>
</row>
</tbody></tgroup></informaltable></refsect2>
<refsect2>
<title><anchor id="GdkInputMode">enum GdkInputMode</title>
<programlisting>typedef enum
{
  GDK_MODE_DISABLED,
  GDK_MODE_SCREEN,
  GDK_MODE_WINDOW
} GdkInputMode;
</programlisting>
<para>
An enumeration that describes the mode of an input device.
</para><informaltable pgwide="1" frame="none" role="enum">
<tgroup cols="2">
<colspec colwidth="2*">
<colspec colwidth="8*">
<tbody>
<row>
<entry><literal>GDK_MODE_DISABLED</literal></entry>
<entry>the device is disabled and will not report any events.
</entry>
</row>
<row>
<entry><literal>GDK_MODE_SCREEN</literal></entry>
<entry>the device is enabled. The device's coordinate space
                    maps to the entire screen.
</entry>
</row>
<row>
<entry><literal>GDK_MODE_WINDOW</literal></entry>
<entry>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.

</entry>
</row>
</tbody></tgroup></informaltable></refsect2>
<refsect2>
<title><anchor id="GdkDeviceKey">struct GdkDeviceKey</title>
<programlisting>struct GdkDeviceKey
{
  guint keyval;
  GdkModifierType modifiers;
};
</programlisting>
<para>
The <structname>GdkDeviceKey</structname> structure contains information
about the mapping of one device macro button onto a normal X key event. 
It has the following fields:
</para><informaltable pgwide="1" frame="none" role="struct">
<tgroup cols="2">
<colspec colwidth="2*">
<colspec colwidth="8*">
<tbody>
<row>
<entry><link linkend="guint">guint</link> <structfield>keyval</structfield></entry>
<entry>the keyval to generate when the macro button is pressed.
         If this is 0, no keypress will be generated.
</entry>
</row>
<row>
<entry><link linkend="GdkModifierType">GdkModifierType</link> <structfield>modifiers</structfield></entry>
<entry>the modifiers set for the generated key event.

</entry>
</row>
</tbody></tgroup></informaltable></refsect2>
<refsect2>
<title><anchor id="GdkDeviceAxis">struct GdkDeviceAxis</title>
<programlisting>struct GdkDeviceAxis
{
  GdkAxisUse use;
  gdouble    min;
  gdouble    max;
};
</programlisting>
<para>
The <structname>GdkDeviceAxis</structname> structure contains information
about the range and mapping of a device axis.
</para><informaltable pgwide="1" frame="none" role="struct">
<tgroup cols="2">
<colspec colwidth="2*">
<colspec colwidth="8*">
<tbody>
<row>
<entry><link linkend="GdkAxisUse">GdkAxisUse</link> <structfield>use</structfield></entry>
<entry>specifies how the axis is used.
</entry>
</row>
<row>
<entry><link linkend="gdouble">gdouble</link> <structfield>min</structfield></entry>
<entry>the minimal value that will be reported by this axis.
</entry>
</row>
<row>
<entry><link linkend="gdouble">gdouble</link> <structfield>max</structfield></entry>
<entry>the maximal value that will be reported by this axis.

</entry>
</row>
</tbody></tgroup></informaltable></refsect2>
<refsect2>
<title><anchor id="GdkAxisUse">enum GdkAxisUse</title>
<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;
</programlisting>
<para>
An enumeration describing the way in which a device
axis (valuator) maps onto the predefined valuator
types that GTK+ understands.
</para><informaltable pgwide="1" frame="none" role="enum">
<tgroup cols="2">
<colspec colwidth="2*">
<colspec colwidth="8*">
<tbody>
<row>
<entry><literal>GDK_AXIS_IGNORE</literal></entry>
<entry>the axis is ignored.
</entry>
</row>
<row>
<entry><literal>GDK_AXIS_X</literal></entry>
<entry>the axis is used as the x axis.
</entry>
</row>
<row>
<entry><literal>GDK_AXIS_Y</literal></entry>
<entry>the axis is used as the y axis.
</entry>
</row>
<row>
<entry><literal>GDK_AXIS_PRESSURE</literal></entry>
<entry>the axis is used for pressure information.
</entry>
</row>
<row>
<entry><literal>GDK_AXIS_XTILT</literal></entry>
<entry>the axis is used for x tilt information.
</entry>
</row>
<row>
<entry><literal>GDK_AXIS_YTILT</literal></entry>
<entry>the axis is used for x tilt information.
</entry>
</row>
<row>
<entry><literal>GDK_AXIS_WHEEL</literal></entry>
<entry>the axis is used for wheel information.
</entry>
</row>
<row>
<entry><literal>GDK_AXIS_LAST</literal></entry>
<entry>a constant equal to the numerically highest axis value.

</entry>
</row>
</tbody></tgroup></informaltable></refsect2>
<refsect2>
<title><anchor id="gdk-devices-list">gdk_devices_list ()</title>
<programlisting><link linkend="GList">GList</link>*      gdk_devices_list                (void);</programlisting>
<para>
Returns the list of available input devices. The list is statically
allocated and should not be freed.
</para><informaltable pgwide="1" frame="none" role="params">
<tgroup cols="2">
<colspec colwidth="2*">
<colspec colwidth="8*">
<tbody>
<row><entry align="right"><emphasis>Returns</emphasis> :</entry><entry>a list of <link linkend="GdkDevice">GdkDevice</link>*.


</entry></row>
</tbody></tgroup></informaltable></refsect2>
<refsect2>
<title><anchor id="gdk-device-set-source">gdk_device_set_source ()</title>
<programlisting>void        gdk_device_set_source           (<link linkend="GdkDevice">GdkDevice</link> *device,
                                             <link linkend="GdkInputSource">GdkInputSource</link> source);</programlisting>
<para>
Sets the source type for an input device.
</para><informaltable pgwide="1" frame="none" role="params">
<tgroup cols="2">
<colspec colwidth="2*">
<colspec colwidth="8*">
<tbody>
<row><entry align="right"><parameter>device</parameter>&nbsp;:</entry>
<entry>a <link linkend="GdkDevice">GdkDevice</link>.
</entry></row>
<row><entry align="right"><parameter>source</parameter>&nbsp;:</entry>
<entry>the source type.


</entry></row>
</tbody></tgroup></informaltable></refsect2>
<refsect2>
<title><anchor id="gdk-device-set-mode">gdk_device_set_mode ()</title>
<programlisting><link linkend="gboolean">gboolean</link>    gdk_device_set_mode             (<link linkend="GdkDevice">GdkDevice</link> *device,
                                             <link linkend="GdkInputMode">GdkInputMode</link> mode);</programlisting>
<para>
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.
</para><informaltable pgwide="1" frame="none" role="params">
<tgroup cols="2">
<colspec colwidth="2*">
<colspec colwidth="8*">
<tbody>
<row><entry align="right"><parameter>device</parameter>&nbsp;:</entry>
<entry>a <link linkend="GdkDevice">GdkDevice</link>.
</entry></row>
<row><entry align="right"><parameter>mode</parameter>&nbsp;:</entry>
<entry>the input mode.
</entry></row>
<row><entry align="right"><emphasis>Returns</emphasis> :</entry><entry><literal>TRUE</literal> if the mode was successfully changed.


</entry></row>
</tbody></tgroup></informaltable></refsect2>
<refsect2>
<title><anchor id="gdk-device-set-key">gdk_device_set_key ()</title>
<programlisting>void        gdk_device_set_key              (<link linkend="GdkDevice">GdkDevice</link> *device,
                                             <link linkend="guint">guint</link> index,
                                             <link linkend="guint">guint</link> keyval,
                                             <link linkend="GdkModifierType">GdkModifierType</link> modifiers);</programlisting>
<para>
Specifies the X key event to generate when a macro button of a device
is pressed.
</para><informaltable pgwide="1" frame="none" role="params">
<tgroup cols="2">
<colspec colwidth="2*">
<colspec colwidth="8*">
<tbody>
<row><entry align="right"><parameter>device</parameter>&nbsp;:</entry>
<entry>a <link linkend="GdkDevice">GdkDevice</link>.
</entry></row>
<row><entry align="right"><parameter>index</parameter>&nbsp;:</entry>
<entry>the index of the macro button to set.
</entry></row>
<row><entry align="right"><parameter>keyval</parameter>&nbsp;:</entry>
<entry>the keyval to generate.
</entry></row>
<row><entry align="right"><parameter>modifiers</parameter>&nbsp;:</entry>
<entry>the modifiers to set.


</entry></row>
</tbody></tgroup></informaltable></refsect2>
<refsect2>
<title><anchor id="gdk-device-set-axis-use">gdk_device_set_axis_use ()</title>
<programlisting>void        gdk_device_set_axis_use         (<link linkend="GdkDevice">GdkDevice</link> *device,
                                             <link linkend="guint">guint</link> index,
                                             <link linkend="GdkAxisUse">GdkAxisUse</link> use);</programlisting>
<para>
Specifies how an axis of a device is used.
</para><informaltable pgwide="1" frame="none" role="params">
<tgroup cols="2">
<colspec colwidth="2*">
<colspec colwidth="8*">
<tbody>
<row><entry align="right"><parameter>device</parameter>&nbsp;:</entry>
<entry>a <link linkend="GdkDevice">GdkDevice</link>.
</entry></row>
<row><entry align="right"><parameter>index</parameter>&nbsp;:</entry>
<entry>the index of the axis.
</entry></row>
<row><entry align="right"><parameter>use</parameter>&nbsp;:</entry>
<entry>specifies how the axis is used.


</entry></row>
</tbody></tgroup></informaltable></refsect2>
<refsect2>
<title><anchor id="gdk-device-get-core-pointer">gdk_device_get_core_pointer ()</title>
<programlisting><link linkend="GdkDevice">GdkDevice</link>*  gdk_device_get_core_pointer     (void);</programlisting>
<para>
Returns the device for the core pointer. The device is statically
allocated and should not be freed.
</para><informaltable pgwide="1" frame="none" role="params">
<tgroup cols="2">
<colspec colwidth="2*">
<colspec colwidth="8*">
<tbody>
<row><entry align="right"><emphasis>Returns</emphasis> :</entry><entry>a <link linkend="GdkDevice">GdkDevice</link>.


</entry></row>
</tbody></tgroup></informaltable></refsect2>
<refsect2>
<title><anchor id="gdk-device-get-state">gdk_device_get_state ()</title>
<programlisting>void        gdk_device_get_state            (<link linkend="GdkDevice">GdkDevice</link> *device,
                                             <link linkend="GdkWindow">GdkWindow</link> *window,
                                             <link linkend="gdouble">gdouble</link> *axes,
                                             <link linkend="GdkModifierType">GdkModifierType</link> *mask);</programlisting>
<para>
Gets the current state of a device.
</para><informaltable pgwide="1" frame="none" role="params">
<tgroup cols="2">
<colspec colwidth="2*">
<colspec colwidth="8*">
<tbody>
<row><entry align="right"><parameter>device</parameter>&nbsp;:</entry>
<entry>a <link linkend="GdkDevice">GdkDevice</link>.
</entry></row>
<row><entry align="right"><parameter>window</parameter>&nbsp;:</entry>
<entry>a <link linkend="GdkWindow">GdkWindow</link>.
</entry></row>
<row><entry align="right"><parameter>axes</parameter>&nbsp;:</entry>
<entry>an array of doubles to store the values of the axes of <parameter>device</parameter> in, 
  or <literal>NULL</literal>.
</entry></row>
<row><entry align="right"><parameter>mask</parameter>&nbsp;:</entry>
<entry>location to store the modifiers, or <literal>NULL</literal>.


</entry></row>
</tbody></tgroup></informaltable></refsect2>
<refsect2>
<title><anchor id="gdk-device-get-history">gdk_device_get_history ()</title>
<programlisting><link linkend="gboolean">gboolean</link>    gdk_device_get_history          (<link linkend="GdkDevice">GdkDevice</link> *device,
                                             <link linkend="GdkWindow">GdkWindow</link> *window,
                                             <link linkend="guint32">guint32</link> start,
                                             <link linkend="guint32">guint32</link> stop,
                                             <link linkend="GdkTimeCoord">GdkTimeCoord</link> ***events,
                                             <link linkend="gint">gint</link> *n_events);</programlisting>
<para>
Obtains the motion history for a device.
</para><informaltable pgwide="1" frame="none" role="params">
<tgroup cols="2">
<colspec colwidth="2*">
<colspec colwidth="8*">
<tbody>
<row><entry align="right"><parameter>device</parameter>&nbsp;:</entry>
<entry>a <link linkend="GdkDevice">GdkDevice</link>.
</entry></row>
<row><entry align="right"><parameter>window</parameter>&nbsp;:</entry>
<entry>the window wrt. which the event coordinates will be translated.
</entry></row>
<row><entry align="right"><parameter>start</parameter>&nbsp;:</entry>
<entry>only return events newer than this timestamp.
</entry></row>
<row><entry align="right"><parameter>stop</parameter>&nbsp;:</entry>
<entry>only return events older than this timestamp.
</entry></row>
<row><entry align="right"><parameter>events</parameter>&nbsp;:</entry>
<entry>location to return a newly-allocated array of <link linkend="GdkTimeCoord">GdkTimeCoord</link>.
</entry></row>
<row><entry align="right"><parameter>n_events</parameter>&nbsp;:</entry>
<entry>location to return the length of <parameter>events</parameter>.
</entry></row>
<row><entry align="right"><emphasis>Returns</emphasis> :</entry><entry><literal>TRUE</literal> if the <parameter>events</parameter> were successfully filled.


</entry></row>
</tbody></tgroup></informaltable></refsect2>
<refsect2>
<title><anchor id="gdk-device-free-history">gdk_device_free_history ()</title>
<programlisting>void        gdk_device_free_history         (<link linkend="GdkTimeCoord">GdkTimeCoord</link> **events,
                                             <link linkend="gint">gint</link> n_events);</programlisting>
<para>
Frees an array of <link linkend="GdkTimeCoord">GdkTimeCoord</link> that was returned by <link linkend="gdk-device-get-history">gdk_device_get_history</link>().
</para><informaltable pgwide="1" frame="none" role="params">
<tgroup cols="2">
<colspec colwidth="2*">
<colspec colwidth="8*">
<tbody>
<row><entry align="right"><parameter>events</parameter>&nbsp;:</entry>
<entry>an array of <link linkend="GdkTimeCoord">GdkTimeCoord</link>.
</entry></row>
<row><entry align="right"><parameter>n_events</parameter>&nbsp;:</entry>
<entry>the length of the array.


</entry></row>
</tbody></tgroup></informaltable></refsect2>
<refsect2>
<title><anchor id="GdkTimeCoord">struct GdkTimeCoord</title>
<programlisting>struct GdkTimeCoord
{
  guint32 time;
  gdouble axes[GDK_MAX_TIMECOORD_AXES];
};
</programlisting>
<para>
The <link linkend="GdkTimeCoord">GdkTimeCoord</link> structure stores a single event in a
motion history. It contains the following fields:
</para><informaltable pgwide="1" frame="none" role="struct">
<tgroup cols="2">
<colspec colwidth="2*">
<colspec colwidth="8*">
<tbody>
<row>
<entry><link linkend="guint32">guint32</link> <structfield>time</structfield></entry>
<entry>The timestamp for this event.
</entry>
</row>
<row>
<entry><link linkend="gdouble">gdouble</link> <structfield>axes</structfield>[GDK_MAX_TIMECOORD_AXES]</entry>
<entry>the values of the device's axes.

</entry>
</row>
</tbody></tgroup></informaltable></refsect2>
<refsect2>
<title><anchor id="gdk-device-get-axis">gdk_device_get_axis ()</title>
<programlisting><link linkend="gboolean">gboolean</link>    gdk_device_get_axis             (<link linkend="GdkDevice">GdkDevice</link> *device,
                                             <link linkend="gdouble">gdouble</link> *axes,
                                             <link linkend="GdkAxisUse">GdkAxisUse</link> use,
                                             <link linkend="gdouble">gdouble</link> *value);</programlisting>
<para>
Interprets an array of double as axis values for a given device,
and locates the value in the array for a given axis use.</para>
<para>

</para><informaltable pgwide="1" frame="none" role="params">
<tgroup cols="2">
<colspec colwidth="2*">
<colspec colwidth="8*">
<tbody>
<row><entry align="right"><parameter>device</parameter>&nbsp;:</entry>
<entry> a <link linkend="GdkDevice">GdkDevice</link>
</entry></row>
<row><entry align="right"><parameter>axes</parameter>&nbsp;:</entry>
<entry> pointer to an array of axes
</entry></row>
<row><entry align="right"><parameter>use</parameter>&nbsp;:</entry>
<entry> the use to look for
</entry></row>
<row><entry align="right"><parameter>value</parameter>&nbsp;:</entry>
<entry> location to store the found value.
</entry></row>
<row><entry align="right"><emphasis>Returns</emphasis> :</entry><entry> <literal>TRUE</literal> if the given axis use was found, otherwise <literal>FALSE</literal>
</entry></row>
</tbody></tgroup></informaltable></refsect2>
<refsect2>
<title><anchor id="gdk-input-set-extension-events">gdk_input_set_extension_events ()</title>
<programlisting>void        gdk_input_set_extension_events  (<link linkend="GdkWindow">GdkWindow</link> *window,
                                             <link linkend="gint">gint</link> mask,
                                             <link linkend="GdkExtensionMode">GdkExtensionMode</link> mode);</programlisting>
<para>
Turns extension events on or off for a particular window,
and specifies the event mask for extension events.
</para><informaltable pgwide="1" frame="none" role="params">
<tgroup cols="2">
<colspec colwidth="2*">
<colspec colwidth="8*">
<tbody>
<row><entry align="right"><parameter>window</parameter>&nbsp;:</entry>
<entry>a <link linkend="GdkWindow">GdkWindow</link>.
</entry></row>
<row><entry align="right"><parameter>mask</parameter>&nbsp;:</entry>
<entry>the event mask
</entry></row>
<row><entry align="right"><parameter>mode</parameter>&nbsp;:</entry>
<entry>the type of extension events that are desired.


</entry></row>
</tbody></tgroup></informaltable></refsect2>
<refsect2>
<title><anchor id="GdkExtensionMode">enum GdkExtensionMode</title>
<programlisting>typedef enum
{
  GDK_EXTENSION_EVENTS_NONE,
  GDK_EXTENSION_EVENTS_ALL,
  GDK_EXTENSION_EVENTS_CURSOR
} GdkExtensionMode;
</programlisting>
<para>
An enumeration used to specify which extension events
are desired for a particular widget.
</para><informaltable pgwide="1" frame="none" role="enum">
<tgroup cols="2">
<colspec colwidth="2*">
<colspec colwidth="8*">
<tbody>
<row>
<entry><literal>GDK_EXTENSION_EVENTS_NONE</literal></entry>
<entry>no extension events are desired.
</entry>
</row>
<row>
<entry><literal>GDK_EXTENSION_EVENTS_ALL</literal></entry>
<entry>all extension events are desired.
</entry>
</row>
<row>
<entry><literal>GDK_EXTENSION_EVENTS_CURSOR</literal></entry>
<entry>extension events are desired only if a cursor
                              will be displayed for the device.

</entry>
</row>
</tbody></tgroup></informaltable></refsect2>

</refsect1>




</refentry>
