| 1 | <html><head><meta http-equiv="Content-Type" content="text/html; charset=utf-8"><title>gtk.gdk.Device</title><link rel="stylesheet" href="style.css" type="text/css"><meta name="generator" content="DocBook XSL Stylesheets V1.68.1"><link rel="start" href="index.html" title="PyGTK 2.0 Reference Manual"><link rel="up" href="gdk-class-reference.html" title="The gtk.gdk Class Reference"><link rel="prev" href="class-gdkcursor.html" title="gtk.gdk.Cursor"><link rel="next" href="class-gdkdisplay.html" title="gtk.gdk.Display"></head><body bgcolor="white" text="black" link="#0000FF" vlink="#840084" alink="#0000FF"><div class="navheader"><table width="100%" summary="Navigation header"><tr><th colspan="3" align="center">gtk.gdk.Device</th></tr><tr><td width="20%" align="left"><a accesskey="p" href="class-gdkcursor.html">Prev</a>Â </td><th width="60%" align="center">The gtk.gdk Class Reference</th><td width="20%" align="right">Â <a accesskey="n" href="class-gdkdisplay.html">Next</a></td></tr></table><hr></div><div class="refentry" lang="en"><a name="class-gdkdevice"></a><div class="titlepage"></div><div class="refnamediv"><h2>gtk.gdk.Device</h2><p>gtk.gdk.Device â an object for supporting input devices</p></div><div class="refsect1" lang="en"><a name="id3048274"></a><h2>Synopsis</h2><table bgcolor="#D0E0F0" width="100%"><tr><td><pre class="classsynopsis">class <span class="ooclass"><span class="classname">gtk.gdk.Device</span></span>(<span class="ooclass"><span class="classname"><PYGTKDOCLINK HREF="class-gobject">gobject.GObject</PYGTKDOCLINK></span></span>): |
|---|
| 2 | <code class="methodsynopsis"> def <span class="methodname"><a href="class-gdkdevice.html#method-gdkdevice--set-source" title="gtk.gdk.Device.set_source">set_source</a></span>(<span class="methodparam"><span class="parameter"><strong class="parameter"><code>source</code></strong></span></span>)</code><br><code class="methodsynopsis"> def <span class="methodname"><a href="class-gdkdevice.html#method-gdkdevice--set-mode" title="gtk.gdk.Device.set_mode">set_mode</a></span>(<span class="methodparam"><span class="parameter"><strong class="parameter"><code>mode</code></strong></span></span>)</code><br><code class="methodsynopsis"> def <span class="methodname"><a href="class-gdkdevice.html#method-gdkdevice--set-key" title="gtk.gdk.Device.set_key">set_key</a></span>(<span class="methodparam"><span class="parameter"><strong class="parameter"><code>index</code></strong></span></span>, <span class="methodparam"><span class="parameter"><strong class="parameter"><code>keyval</code></strong></span></span>, <span class="methodparam"><span class="parameter"><strong class="parameter"><code>modifiers</code></strong></span></span>)</code><br><code class="methodsynopsis"> def <span class="methodname"><a href="class-gdkdevice.html#method-gdkdevice--set-axis-use" title="gtk.gdk.Device.set_axis_use">set_axis_use</a></span>(<span class="methodparam"><span class="parameter"><strong class="parameter"><code>index</code></strong></span></span>, <span class="methodparam"><span class="parameter"><strong class="parameter"><code>use</code></strong></span></span>)</code><br><code class="methodsynopsis"> def <span class="methodname"><a href="class-gdkdevice.html#method-gdkdevice--get-state" title="gtk.gdk.Device.get_state">get_state</a></span>(<span class="methodparam"><span class="parameter"><strong class="parameter"><code>window</code></strong></span></span>)</code><br><code class="methodsynopsis"> def <span class="methodname"><a href="class-gdkdevice.html#method-gdkdevice--get-history" title="gtk.gdk.Device.get_history">get_history</a></span>(<span class="methodparam"><span class="parameter"><strong class="parameter"><code>window</code></strong></span></span>, <span class="methodparam"><span class="parameter"><strong class="parameter"><code>start</code></strong></span></span>, <span class="methodparam"><span class="parameter"><strong class="parameter"><code>stop</code></strong></span></span>)</code><br><code class="methodsynopsis"> def <span class="methodname"><a href="class-gdkdevice.html#method-gdkdevice--get-axis" title="gtk.gdk.Device.get_axis">get_axis</a></span>(<span class="methodparam"><span class="parameter"><strong class="parameter"><code>axes</code></strong></span></span>, <span class="methodparam"><span class="parameter"><strong class="parameter"><code>use</code></strong></span></span>)</code><br></pre></td></tr></table><pre class="programlisting"> |
|---|
| 3 | <span class="bold"><strong>Functions</strong></span> |
|---|
| 4 | |
|---|
| 5 | <code class="methodsynopsis"> def <span class="methodname"><a href="class-gdkdevice.html#function-gdk--devices-list" title="gtk.gdk.devices_list">gtk.gdk.devices_list</a></span>(<span class="methodparam"></span>)</code><br><code class="methodsynopsis"> def <span class="methodname"><a href="class-gdkdevice.html#function-gdk--device-get-core-pointer" title="gtk.gdk.device_get_core_pointer">gtk.gdk.device_get_core_pointer</a></span>(<span class="methodparam"></span>)</code></pre></div><div class="refsect1" lang="en"><a name="id2719721"></a><h2>Ancestry</h2><pre class="synopsis">+-- <PYGTKDOCLINK HREF="class-gobject">gobject.GObject</PYGTKDOCLINK> |
|---|
| 6 | +-- <a href="class-gdkdevice.html" title="gtk.gdk.Device">gtk.gdk.Device</a> |
|---|
| 7 | </pre></div><div class="refsect1" lang="en"><a name="id2719694"></a><h2>Attributes</h2><div class="blockquote"><table width="100%" border="0" bgcolor="#E0E0E0"><tr><td valign="top"><div class="informaltable"><table cellpadding="5" width="100%" border="0"><colgroup><col><col><col></colgroup><tbody><tr valign="top"><td valign="top">"axes"</td><td valign="top">Read</td><td valign="top">a tuple containing axes information. Each axes is |
|---|
| 8 | described by a tuple containing: use information (one of: |
|---|
| 9 | <code class="literal">gtk.gdk.AXIS_IGNORE</code>, <code class="literal">gtk.gdk.AXIS_X</code>, |
|---|
| 10 | <code class="literal">gtk.gdk.AXIS_Y</code>, <code class="literal">gtk.gdk.AXIS_PRESSURE</code>, |
|---|
| 11 | <code class="literal">gtk.gdk.AXIS_XTILT</code>, |
|---|
| 12 | <code class="literal">gtk.gdk.AXIS_YTILT</code>, |
|---|
| 13 | <code class="literal">gtk.gdk.AXIS_WHEEL</code>, |
|---|
| 14 | <code class="literal">gtk.gdk.AXIS_LAST</code>), the minimum and maximum axes |
|---|
| 15 | values.</td></tr><tr valign="top"><td valign="top">"has_cursor"</td><td valign="top">Read</td><td valign="top">if <code class="literal">True</code> the pointer follows device |
|---|
| 16 | motion.</td></tr><tr valign="top"><td valign="top">"keys"</td><td valign="top">Read</td><td valign="top">a tuple describing the mapped macro buttons. Each macro |
|---|
| 17 | button is described by a tuple containing: a key value output when the macro |
|---|
| 18 | button is pressed and a set of modifiers output with the key value.</td></tr><tr valign="top"><td valign="top">"mode"</td><td valign="top">Read</td><td valign="top">the mode of this device - one of: |
|---|
| 19 | <code class="literal">gtk.gdk.MODE_DISABLED</code>, |
|---|
| 20 | <code class="literal">gtk.gdk.MODE_SCREEN</code>, |
|---|
| 21 | <code class="literal">gtk.gdk.MODE_WINDOW</code></td></tr><tr valign="top"><td valign="top">"name"</td><td valign="top">Read</td><td valign="top">the name of this device.</td></tr><tr valign="top"><td valign="top">"num_axes"</td><td valign="top">Read</td><td valign="top">the length of the <code class="literal">axes</code> |
|---|
| 22 | tuple.</td></tr><tr valign="top"><td valign="top">"num_keys"</td><td valign="top">Read</td><td valign="top">the length of the <code class="literal">keys</code> tuple</td></tr><tr valign="top"><td valign="top">"source"</td><td valign="top">Read</td><td valign="top">the type of this device - one of: |
|---|
| 23 | <code class="literal">gtk.gdk.SOURCE_MOUSE</code>, |
|---|
| 24 | <code class="literal">gtk.gdk.SOURCE_PEN</code>, |
|---|
| 25 | <code class="literal">gtk.gdk.SOURCE_ERASER</code>, |
|---|
| 26 | <code class="literal">gtk.gdk.SOURCE_CURSOR</code></td></tr></tbody></table></div></td></tr></table></div></div><div class="refsect1" lang="en"><a name="id2744454"></a><h2>Description</h2><p>In addition to the normal keyboard and mouse input devices, |
|---|
| 27 | <code class="literal">PyGTK</code> also contains support for extended input devices. |
|---|
| 28 | In particular, this support is targeted at graphics tablets. Graphics |
|---|
| 29 | tablets typically return sub-pixel positioning information and possibly |
|---|
| 30 | information about the pressure and tilt of the stylus. Under X, the support |
|---|
| 31 | for extended devices is done through the XInput extension. Because handling |
|---|
| 32 | extended input devices may involve considerable overhead, they need to be |
|---|
| 33 | turned on for each <a href="class-gdkwindow.html" title="gtk.gdk.Window"><code class="classname">gtk.gdk.Window</code></a> |
|---|
| 34 | individually using <a href="class-gdkwindow.html#method-gdkwindow--input-set-extension-events" title="gtk.gdk.Window.input_set_extension_events"><code class="methodname">gtk.gdk.Window.input_set_extension_events</code>()</a>. |
|---|
| 35 | (Or, more typically, for <a href="class-gtkwidget.html" title="gtk.Widget"><code class="classname">gtk.Widget</code></a> objects, |
|---|
| 36 | using the <a href="class-gtkwidget.html#method-gtkwidget--set-extension-events" title="gtk.Widget.set_extension_events"><code class="methodname">gtk.Widget.set_extension_events</code>()</a> |
|---|
| 37 | method). As an additional complication, depending on the support from the |
|---|
| 38 | windowing system, its possible that a normal mouse cursor will not be |
|---|
| 39 | displayed for a particular extension device. If an application does not want |
|---|
| 40 | to deal with displaying a cursor itself, it can ask only to get extension |
|---|
| 41 | events from devices that will display a cursor, by passing the |
|---|
| 42 | <code class="literal">gtk.gdk.EXTENSION_EVENTS_CURSOR</code> value to the <a href="class-gdkwindow.html#method-gdkwindow--input-set-extension-events" title="gtk.gdk.Window.input_set_extension_events"><code class="methodname">gtk.gdk.Window.input_set_extension_events</code>()</a> |
|---|
| 43 | method. Otherwise, the application must retrieve the device information |
|---|
| 44 | using the <a href="class-gdkdevice.html#function-gdk--devices-list" title="gtk.gdk.devices_list"><code class="methodname">gtk.gdk.devices_list</code>()</a> |
|---|
| 45 | function, check the has_cursor field, and, if it is |
|---|
| 46 | <code class="literal">False</code>, draw a cursor itself when it receives motion |
|---|
| 47 | events. </p><p>Each pointing device is assigned a unique integer ID; events from |
|---|
| 48 | a particular device can be identified by the <em class="parameter"><code>deviceid</code></em> |
|---|
| 49 | attribute in the event structure. The events generated by pointer devices |
|---|
| 50 | have also been extended to contain <em class="parameter"><code>pressure</code></em>, |
|---|
| 51 | <em class="parameter"><code>xtilt</code></em> and <em class="parameter"><code>ytilt</code></em> attributes |
|---|
| 52 | which contain the extended information reported as additional valuators from |
|---|
| 53 | the device. The <em class="parameter"><code>pressure</code></em> attribute ranges from 0.0 to |
|---|
| 54 | 1.0, while the tilt attributes range from -1.0 to 1.0. (With -1.0 |
|---|
| 55 | representing the maximum tilt to the left or up, and 1.0 representing the |
|---|
| 56 | maximum tilt to the right or down.) One additional attribute in each event |
|---|
| 57 | is the <em class="parameter"><code>source</code></em> attribute, which contains an |
|---|
| 58 | enumeration value describing the type of device; this currently can be one |
|---|
| 59 | of <code class="literal">gtk.gdk.SOURCE_MOUSE</code>, |
|---|
| 60 | <code class="literal">gtk.gdk.SOURCE_PEN</code>, |
|---|
| 61 | <code class="literal">gtk.gdk.SOURCE_ERASER</code>, or |
|---|
| 62 | <code class="literal">gtk.gdk.SOURCE_CURSOR</code>. This attribute is present to allow |
|---|
| 63 | simple applications to (for instance) delete when they detect eraser devices |
|---|
| 64 | without having to keep track of complicated per-device settings.</p><p>Various aspects of each device may be configured. The easiest way |
|---|
| 65 | of creating a GUI to allow the user to configure such a device is to use the |
|---|
| 66 | <a href="class-gtkinputdialog.html" title="gtk.InputDialog"><code class="classname">gtk.InputDialog</code></a> |
|---|
| 67 | widget in <code class="literal">PyGTK</code>. However, even when using this widget, |
|---|
| 68 | application writers will need to directly query and set the configuration |
|---|
| 69 | parameters in order to save the state between invocations of the |
|---|
| 70 | application. The configuration of devices is queried using the <a href="class-gdkdevice.html#function-gdk--devices-list" title="gtk.gdk.devices_list"><code class="methodname">gtk.gdk.devices_list</code>()</a> |
|---|
| 71 | function. Each device must be activated using the <a href="class-gdkdevice.html#method-gdkdevice--set-mode" title="gtk.gdk.Device.set_mode"><code class="methodname">set_mode</code>()</a> |
|---|
| 72 | method, which also controls whether the device's range is mapped to the |
|---|
| 73 | entire screen or to a single window. The mapping of the valuators of the |
|---|
| 74 | device onto the predefined valuator types is set using the <a href="class-gdkdevice.html#method-gdkdevice--set-axis-use" title="gtk.gdk.Device.set_axis_use"><code class="methodname">set_axis_use</code>()</a> |
|---|
| 75 | method. And the source type for each device can be set with the <a href="class-gdkdevice.html#method-gdkdevice--set-source" title="gtk.gdk.Device.set_source"><code class="methodname">set_source</code>()</a> |
|---|
| 76 | method.</p><p>Devices may also have associated keys or macro buttons. Such keys |
|---|
| 77 | can be globally set to map into normal X keyboard events. The mapping is set |
|---|
| 78 | using the <a href="class-gdkdevice.html#method-gdkdevice--set-key" title="gtk.gdk.Device.set_key"><code class="methodname">set_key</code>()</a> |
|---|
| 79 | method. The interfaces in this section will most likely be considerably |
|---|
| 80 | modified in the future to accommodate devices that may have different sets of |
|---|
| 81 | additional valuators than the pressure xtilt and ytilt.</p></div><div class="refsect1" lang="en"><a name="id2744416"></a><h2>Methods</h2><div class="refsect2" lang="en"><a name="method-gdkdevice--set-source"></a><h3>gtk.gdk.Device.set_source</h3><pre class="programlisting"><code class="methodsynopsis"> def <span class="methodname">set_source</span>(<span class="methodparam"><span class="parameter"><strong class="parameter"><code>source</code></strong></span></span>)</code></pre><table border="0" width="100%" bgcolor="#FFECCE"><col align="left" valign="top" width="0*"><tbody><tr><td><span class="term"><strong class="parameter"><code>source</code></strong>Â :</span></td><td>the source type of the |
|---|
| 82 | device</td></tr></tbody></table><p>The <code class="methodname">set_source</code>() method sets the source |
|---|
| 83 | type for the input device to the value specified by |
|---|
| 84 | <em class="parameter"><code>source</code></em>. The value of <em class="parameter"><code>source</code></em> |
|---|
| 85 | must be one of:</p><table border="0" width="100%" bgcolor="#FFECCE"><col align="left" valign="top" width="0*"><tbody><tr><td><span class="term"><code class="literal">gtk.gdk.SOURCE_MOUSE</code></span></td><td>the device is a mouse. (This will be reported for the |
|---|
| 86 | core pointer, even if it is something else, such as a trackball.)</td></tr><tr><td><span class="term"><code class="literal">gtk.gdk.SOURCE_PEN</code></span></td><td>the device is a stylus of a graphics tablet or similar |
|---|
| 87 | device.</td></tr><tr><td><span class="term"><code class="literal">gtk.gdk.SOURCE_ERASER</code></span></td><td>the device is an eraser. Typically, this would be the |
|---|
| 88 | other end of a stylus on a graphics tablet.</td></tr><tr><td><span class="term"><code class="literal">gtk.gdk.SOURCE_CURSOR</code></span></td><td>the device is a graphics tablet "puck" or similar |
|---|
| 89 | device.</td></tr></tbody></table><p></p></div><div class="refsect2" lang="en"><a name="method-gdkdevice--set-mode"></a><h3>gtk.gdk.Device.set_mode</h3><pre class="programlisting"><code class="methodsynopsis"> def <span class="methodname">set_mode</span>(<span class="methodparam"><span class="parameter"><strong class="parameter"><code>mode</code></strong></span></span>)</code></pre><table border="0" width="100%" bgcolor="#FFECCE"><col align="left" valign="top" width="0*"><tbody><tr><td><span class="term"><strong class="parameter"><code>mode</code></strong>Â :</span></td><td>the input mode</td></tr><tr><td><span class="term"><span class="emphasis"><em>Returns</em></span>Â :</span></td><td><code class="literal">True</code> if the mode was |
|---|
| 90 | successfully changed.</td></tr></tbody></table><p>The <code class="methodname">set_mode</code>() method sets the input |
|---|
| 91 | device mode to the value specified by <em class="parameter"><code>mode</code></em>. The value |
|---|
| 92 | of <em class="parameter"><code>mode</code></em> must be one of:</p><table border="0" width="100%" bgcolor="#FFECCE"><col align="left" valign="top" width="0*"><tbody><tr><td><span class="term"><code class="literal">gtk.gdk.MODE_DISABLED</code></span></td><td>the device is disabled and will not report any |
|---|
| 93 | events.</td></tr><tr><td><span class="term"><code class="literal">gtk.gdk.MODE_SCREEN</code></span></td><td>the device is enabled. The device's coordinate space |
|---|
| 94 | maps to the entire screen.</td></tr><tr><td><span class="term"><code class="literal">gtk.gdk.MODE_WINDOW</code></span></td><td>the device is enabled. The device's coordinate space is |
|---|
| 95 | mapped to a single window. The manner in which this window is chosen is |
|---|
| 96 | undefined, but it will typically be the same way in which the focus window |
|---|
| 97 | for key events is determined.</td></tr></tbody></table><p></p></div><div class="refsect2" lang="en"><a name="method-gdkdevice--set-key"></a><h3>gtk.gdk.Device.set_key</h3><pre class="programlisting"><code class="methodsynopsis"> def <span class="methodname">set_key</span>(<span class="methodparam"><span class="parameter"><strong class="parameter"><code>index</code></strong></span></span>, <span class="methodparam"><span class="parameter"><strong class="parameter"><code>keyval</code></strong></span></span>, <span class="methodparam"><span class="parameter"><strong class="parameter"><code>modifiers</code></strong></span></span>)</code></pre><table border="0" width="100%" bgcolor="#FFECCE"><col align="left" valign="top" width="0*"><tbody><tr><td><span class="term"><strong class="parameter"><code>index</code></strong>Â :</span></td><td>the index of the macro button to |
|---|
| 98 | set.</td></tr><tr><td><span class="term"><strong class="parameter"><code>keyval</code></strong>Â :</span></td><td>the key value to generate.</td></tr><tr><td><span class="term"><strong class="parameter"><code>modifiers</code></strong>Â :</span></td><td>the modifiers to set.</td></tr></tbody></table><p>The <code class="methodname">set_key</code>() method sets the key event |
|---|
| 99 | to generate when a macro button of a device is pressed. The macro button is |
|---|
| 100 | specified by <em class="parameter"><code>index</code></em>. The key value and modifiers |
|---|
| 101 | generated are specified by <em class="parameter"><code>keyval</code></em> and |
|---|
| 102 | <em class="parameter"><code>modifiers</code></em> respectively.</p></div><div class="refsect2" lang="en"><a name="method-gdkdevice--set-axis-use"></a><h3>gtk.gdk.Device.set_axis_use</h3><pre class="programlisting"><code class="methodsynopsis"> def <span class="methodname">set_axis_use</span>(<span class="methodparam"><span class="parameter"><strong class="parameter"><code>index</code></strong></span></span>, <span class="methodparam"><span class="parameter"><strong class="parameter"><code>use</code></strong></span></span>)</code></pre><table border="0" width="100%" bgcolor="#FFECCE"><col align="left" valign="top" width="0*"><tbody><tr><td><span class="term"><strong class="parameter"><code>index</code></strong>Â :</span></td><td>the index of the axis.</td></tr><tr><td><span class="term"><strong class="parameter"><code>use</code></strong>Â :</span></td><td>how the axis is used.</td></tr></tbody></table><p>The <code class="methodname">set_axis_use</code>() method sets the axis |
|---|
| 103 | (specified by <em class="parameter"><code>index</code></em>) of the input device to be used |
|---|
| 104 | in the fashion specified by <em class="parameter"><code>use</code></em>. The value of |
|---|
| 105 | <em class="parameter"><code>use</code></em> must be one of:</p><table border="0" width="100%" bgcolor="#FFECCE"><col align="left" valign="top" width="0*"><tbody><tr><td><span class="term"><code class="literal">gtk.gdk.AXIS_IGNORE</code></span></td><td>the axis is ignored.</td></tr><tr><td><span class="term"><code class="literal">gtk.gdk.AXIS_X</code></span></td><td>the axis is used as the x axis.</td></tr><tr><td><span class="term"><code class="literal">gtk.gdk.AXIS_Y</code></span></td><td>the axis is used as the y axis.</td></tr><tr><td><span class="term"><code class="literal">gtk.gdk.AXIS_PRESSURE</code></span></td><td>the axis is used for pressure information.</td></tr><tr><td><span class="term"><code class="literal">gtk.gdk.AXIS_XTILT</code></span></td><td>the axis is used for x tilt information.</td></tr><tr><td><span class="term"><code class="literal">gtk.gdk.AXIS_YTILT</code></span></td><td>the axis is used for y tilt information.</td></tr><tr><td><span class="term"><code class="literal">gtk.gdk.AXIS_WHEEL</code></span></td><td>the axis is used for wheel information.</td></tr><tr><td><span class="term"><code class="literal">gtk.gdk.AXIS_LAST</code></span></td><td>a constant equal to the numerically highest axis |
|---|
| 106 | value.</td></tr></tbody></table><p></p></div><div class="refsect2" lang="en"><a name="method-gdkdevice--get-state"></a><h3>gtk.gdk.Device.get_state</h3><pre class="programlisting"><code class="methodsynopsis"> def <span class="methodname">get_state</span>(<span class="methodparam"><span class="parameter"><strong class="parameter"><code>window</code></strong></span></span>)</code></pre><table border="0" width="100%" bgcolor="#FFECCE"><col align="left" valign="top" width="0*"><tbody><tr><td><span class="term"><strong class="parameter"><code>window</code></strong>Â :</span></td><td>a <a href="class-gdkwindow.html" title="gtk.gdk.Window"><code class="classname">gtk.gdk.Window</code></a></td></tr><tr><td><span class="term"><span class="emphasis"><em>Returns</em></span>Â :</span></td><td>a tuple containing: a tuple containing the axes |
|---|
| 107 | data; and, the modifiers in effect.</td></tr></tbody></table><p>The <code class="methodname">get_state</code>() method returns a tuple |
|---|
| 108 | containing:</p><div class="itemizedlist"><ul type="disc"><li>a tuple containing the axes data</li><li>the bitmask containing the set of key modifiers in |
|---|
| 109 | effect</li></ul></div><p>The state information is relative to the <a href="class-gdkwindow.html" title="gtk.gdk.Window"><code class="classname">gtk.gdk.Window</code></a> |
|---|
| 110 | specified by <em class="parameter"><code>window</code></em>.</p></div><div class="refsect2" lang="en"><a name="method-gdkdevice--get-history"></a><h3>gtk.gdk.Device.get_history</h3><pre class="programlisting"><code class="methodsynopsis"> def <span class="methodname">get_history</span>(<span class="methodparam"><span class="parameter"><strong class="parameter"><code>window</code></strong></span></span>, <span class="methodparam"><span class="parameter"><strong class="parameter"><code>start</code></strong></span></span>, <span class="methodparam"><span class="parameter"><strong class="parameter"><code>stop</code></strong></span></span>)</code></pre><table border="0" width="100%" bgcolor="#FFECCE"><col align="left" valign="top" width="0*"><tbody><tr><td><span class="term"><strong class="parameter"><code>window</code></strong>Â :</span></td><td>a <a href="class-gdkwindow.html" title="gtk.gdk.Window"><code class="classname">gtk.gdk.Window</code></a></td></tr><tr><td><span class="term"><strong class="parameter"><code>start</code></strong>Â :</span></td><td>the earliest event time |
|---|
| 111 | limit</td></tr><tr><td><span class="term"><strong class="parameter"><code>stop</code></strong>Â :</span></td><td>the latest event time |
|---|
| 112 | limit</td></tr><tr><td><span class="term"><span class="emphasis"><em>Returns</em></span>Â :</span></td><td>a tuple containing event tuples each with axes |
|---|
| 113 | data and a timestamp</td></tr></tbody></table><p>The <code class="methodname">get_history</code>() method returns a |
|---|
| 114 | tuple containing the motion history for the device with respect to the <a href="class-gdkwindow.html" title="gtk.gdk.Window"><code class="classname">gtk.gdk.Window</code></a> |
|---|
| 115 | specified by window between the time limits specified by |
|---|
| 116 | <em class="parameter"><code>start</code></em> and <em class="parameter"><code>stop</code></em>. The motion |
|---|
| 117 | history is a tuple containing event motion tuples that each contain a |
|---|
| 118 | timestamp for the event and a tuple with the axes data for the event.</p></div><div class="refsect2" lang="en"><a name="method-gdkdevice--get-axis"></a><h3>gtk.gdk.Device.get_axis</h3><pre class="programlisting"><code class="methodsynopsis"> def <span class="methodname">get_axis</span>(<span class="methodparam"><span class="parameter"><strong class="parameter"><code>axes</code></strong></span></span>, <span class="methodparam"><span class="parameter"><strong class="parameter"><code>use</code></strong></span></span>)</code></pre><table border="0" width="100%" bgcolor="#FFECCE"><col align="left" valign="top" width="0*"><tbody><tr><td><span class="term"><strong class="parameter"><code>axes</code></strong>Â :</span></td><td>a sequence of axes values</td></tr><tr><td><span class="term"><strong class="parameter"><code>use</code></strong>Â :</span></td><td>the axis use to match</td></tr><tr><td><span class="term"><span class="emphasis"><em>Returns</em></span>Â :</span></td><td>the axis value from <em class="parameter"><code>axes</code></em> |
|---|
| 119 | that matches the use type or <code class="literal">None</code> if there is no |
|---|
| 120 | match.</td></tr></tbody></table><p>The <code class="methodname">get_axis</code>() method returns the value |
|---|
| 121 | in <em class="parameter"><code>axes</code></em> whose axis matches the specified |
|---|
| 122 | <em class="parameter"><code>use</code></em>.</p></div></div><div class="refsect1" lang="en"><a name="id2940581"></a><h2>Functions</h2><div class="refsect2" lang="en"><a name="function-gdk--devices-list"></a><h3>gtk.gdk.devices_list</h3><pre class="programlisting"><code class="methodsynopsis"> def <span class="methodname">gtk.gdk.devices_list</span>(<span class="methodparam"></span>)</code></pre><table border="0" width="100%" bgcolor="#FFECCE"><col align="left" valign="top" width="0*"><tbody><tr><td><span class="term"><span class="emphasis"><em>Returns</em></span>Â :</span></td><td>a list containing the <a href="class-gdkdevice.html" title="gtk.gdk.Device"><code class="classname">gtk.gdk.Device</code></a> |
|---|
| 123 | objects for the default display</td></tr></tbody></table><p>The <code class="function">gtk.gdk.devices_list</code>() function returns |
|---|
| 124 | a list containing the <a href="class-gdkdevice.html" title="gtk.gdk.Device"><code class="classname">gtk.gdk.Device</code></a> |
|---|
| 125 | objects fro the default display.</p></div><div class="refsect2" lang="en"><a name="function-gdk--device-get-core-pointer"></a><h3>gtk.gdk.device_get_core_pointer</h3><pre class="programlisting"><code class="methodsynopsis"> def <span class="methodname">gtk.gdk.device_get_core_pointer</span>(<span class="methodparam"></span>)</code></pre><table border="0" width="100%" bgcolor="#FFECCE"><col align="left" valign="top" width="0*"><tbody><tr><td><span class="term"><span class="emphasis"><em>Returns</em></span>Â :</span></td><td>the </td></tr></tbody></table><p>The <code class="function">gtk.gdk.device_get_core_pointer</code>() |
|---|
| 126 | function returns the device that is used as the core pointer.</p></div></div></div><div class="navfooter"><hr><table width="100%" summary="Navigation footer"><tr><td width="40%" align="left"><a accesskey="p" href="class-gdkcursor.html">Prev</a> </td><td width="20%" align="center"><a accesskey="u" href="gdk-class-reference.html">Up</a></td><td width="40%" align="right"> <a accesskey="n" href="class-gdkdisplay.html">Next</a></td></tr><tr><td width="40%" align="left" valign="top">gtk.gdk.Cursor </td><td width="20%" align="center"><a accesskey="h" href="index.html">Home</a></td><td width="40%" align="right" valign="top"> gtk.gdk.Display</td></tr></table></div></body></html> |
|---|