📄 gdk-event-structures.html
字号:
it from the an empty translation.</td></tr><tr><td><p><span class="term"><ahref="/usr/share/gtk-doc/html/glib/glib-Basic-Types.html#guint16">guint16</a> <em class="structfield"><code>hardware_keycode</code></em>;</span></p></td><td>the raw code of the key that was pressed or released.</td></tr><tr><td><p><span class="term"><ahref="/usr/share/gtk-doc/html/glib/glib-Basic-Types.html#guint8">guint8</a> <em class="structfield"><code>group</code></em>;</span></p></td><td>the keyboard group.</td></tr><tr><td><p><span class="term"><ahref="/usr/share/gtk-doc/html/glib/glib-Basic-Types.html#guint">guint</a> <em class="structfield"><code>is_modifier</code></em> : 1;</span></p></td><td>a flag that indicates if <em class="parameter"><code>hardware_keycode</code></em> is mapped to a modifier. Since 2.10</td></tr></tbody></table></div></div><hr><div class="refsect2" lang="en"><a name="id3239194"></a><h3><a name="GdkEventButton"></a>GdkEventButton</h3><a class="indexterm" name="id3239207"></a><pre class="programlisting">typedef struct { GdkEventType type; GdkWindow *window; gint8 send_event; guint32 time; gdouble x; gdouble y; gdouble *axes; guint state; guint button; GdkDevice *device; gdouble x_root, y_root;} GdkEventButton;</pre><p>Used for button press and button release events. The<em class="structfield"><code>type</code></em> field will be one of <a class="link" href="gdk-Events.html#GDK-BUTTON-PRESS:CAPS"><code class="literal">GDK_BUTTON_PRESS</code></a>,<a class="link" href="gdk-Events.html#GDK-2BUTTON-PRESS:CAPS"><code class="literal">GDK_2BUTTON_PRESS</code></a>, <a class="link" href="gdk-Events.html#GDK-3BUTTON-PRESS:CAPS"><code class="literal">GDK_3BUTTON_PRESS</code></a>, and <a class="link" href="gdk-Events.html#GDK-BUTTON-RELEASE:CAPS"><code class="literal">GDK_BUTTON_RELEASE</code></a>.</p><p>Double and triple-clicks result in a sequence of events being received.For double-clicks the order of events will be:</p><div class="orderedlist"><ol type="1"><li><p><a class="link" href="gdk-Events.html#GDK-BUTTON-PRESS:CAPS"><code class="literal">GDK_BUTTON_PRESS</code></a></p></li><li><p><a class="link" href="gdk-Events.html#GDK-BUTTON-RELEASE:CAPS"><code class="literal">GDK_BUTTON_RELEASE</code></a></p></li><li><p><a class="link" href="gdk-Events.html#GDK-BUTTON-PRESS:CAPS"><code class="literal">GDK_BUTTON_PRESS</code></a></p></li><li><p><a class="link" href="gdk-Events.html#GDK-2BUTTON-PRESS:CAPS"><code class="literal">GDK_2BUTTON_PRESS</code></a></p></li><li><p><a class="link" href="gdk-Events.html#GDK-BUTTON-RELEASE:CAPS"><code class="literal">GDK_BUTTON_RELEASE</code></a></p></li></ol></div><p>Note that the first click is received just like a normalbutton press, while the second click results in a <a class="link" href="gdk-Events.html#GDK-2BUTTON-PRESS:CAPS"><code class="literal">GDK_2BUTTON_PRESS</code></a> beingreceived just after the <a class="link" href="gdk-Events.html#GDK-BUTTON-PRESS:CAPS"><code class="literal">GDK_BUTTON_PRESS</code></a>.</p><p>Triple-clicks are very similar to double-clicks, except that <a class="link" href="gdk-Events.html#GDK-3BUTTON-PRESS:CAPS"><code class="literal">GDK_3BUTTON_PRESS</code></a>is inserted after the third click. The order of the events is:</p><div class="orderedlist"><ol type="1"><li><p><a class="link" href="gdk-Events.html#GDK-BUTTON-PRESS:CAPS"><code class="literal">GDK_BUTTON_PRESS</code></a></p></li><li><p><a class="link" href="gdk-Events.html#GDK-BUTTON-RELEASE:CAPS"><code class="literal">GDK_BUTTON_RELEASE</code></a></p></li><li><p><a class="link" href="gdk-Events.html#GDK-BUTTON-PRESS:CAPS"><code class="literal">GDK_BUTTON_PRESS</code></a></p></li><li><p><a class="link" href="gdk-Events.html#GDK-2BUTTON-PRESS:CAPS"><code class="literal">GDK_2BUTTON_PRESS</code></a></p></li><li><p><a class="link" href="gdk-Events.html#GDK-BUTTON-RELEASE:CAPS"><code class="literal">GDK_BUTTON_RELEASE</code></a></p></li><li><p><a class="link" href="gdk-Events.html#GDK-BUTTON-PRESS:CAPS"><code class="literal">GDK_BUTTON_PRESS</code></a></p></li><li><p><a class="link" href="gdk-Events.html#GDK-3BUTTON-PRESS:CAPS"><code class="literal">GDK_3BUTTON_PRESS</code></a></p></li><li><p><a class="link" href="gdk-Events.html#GDK-BUTTON-RELEASE:CAPS"><code class="literal">GDK_BUTTON_RELEASE</code></a></p></li></ol></div><p></p><p>For a double click to occur, the second button press must occur within 1/4 ofa second of the first. For a triple click to occur, the third button pressmust also occur within 1/2 second of the first button press.</p><div class="variablelist"><table border="0"><col align="left" valign="top"><tbody><tr><td><p><span class="term"><a class="link" href="gdk-Events.html#GdkEventType">GdkEventType</a> <em class="structfield"><code>type</code></em>;</span></p></td><td>the type of the event (<a class="link" href="gdk-Events.html#GDK-BUTTON-PRESS:CAPS"><code class="literal">GDK_BUTTON_PRESS</code></a>, <a class="link" href="gdk-Events.html#GDK-2BUTTON-PRESS:CAPS"><code class="literal">GDK_2BUTTON_PRESS</code></a>,<a class="link" href="gdk-Events.html#GDK-3BUTTON-PRESS:CAPS"><code class="literal">GDK_3BUTTON_PRESS</code></a> or <a class="link" href="gdk-Events.html#GDK-BUTTON-RELEASE:CAPS"><code class="literal">GDK_BUTTON_RELEASE</code></a>).</td></tr><tr><td><p><span class="term"><a class="link" href="gdk-Windows.html#GdkWindow">GdkWindow</a> *<em class="structfield"><code>window</code></em>;</span></p></td><td>the window which received the event.</td></tr><tr><td><p><span class="term"><ahref="/usr/share/gtk-doc/html/glib/glib-Basic-Types.html#gint8">gint8</a> <em class="structfield"><code>send_event</code></em>;</span></p></td><td><ahref="/usr/share/gtk-doc/html/glib/glib-Standard-Macros.html#TRUE:CAPS"><code class="literal">TRUE</code></a> if the event was sent explicitly (e.g. using <code class="function">XSendEvent</code>).</td></tr><tr><td><p><span class="term"><ahref="/usr/share/gtk-doc/html/glib/glib-Basic-Types.html#guint32">guint32</a> <em class="structfield"><code>time</code></em>;</span></p></td><td>the time of the event in milliseconds.</td></tr><tr><td><p><span class="term"><ahref="/usr/share/gtk-doc/html/glib/glib-Basic-Types.html#gdouble">gdouble</a> <em class="structfield"><code>x</code></em>;</span></p></td><td>the x coordinate of the pointer relative to the window.</td></tr><tr><td><p><span class="term"><ahref="/usr/share/gtk-doc/html/glib/glib-Basic-Types.html#gdouble">gdouble</a> <em class="structfield"><code>y</code></em>;</span></p></td><td>the y coordinate of the pointer relative to the window.</td></tr><tr><td><p><span class="term"><ahref="/usr/share/gtk-doc/html/glib/glib-Basic-Types.html#gdouble">gdouble</a> *<em class="structfield"><code>axes</code></em>;</span></p></td><td><em class="parameter"><code>x</code></em>, <em class="parameter"><code>y</code></em> translated to the axes of <em class="parameter"><code>device</code></em>, or <ahref="/usr/share/gtk-doc/html/liboil/liboil-liboiljunk.html#NULL:CAPS"><code class="literal">NULL</code></a> if <em class="parameter"><code>device</code></em> is the mouse.</td></tr><tr><td><p><span class="term"><ahref="/usr/share/gtk-doc/html/glib/glib-Basic-Types.html#guint">guint</a> <em class="structfield"><code>state</code></em>;</span></p></td><td>a bit-mask representing the state of the modifier keys (e.g. Control,Shift and Alt) and the pointer buttons. See <a class="link" href="gdk-Windows.html#GdkModifierType"><span class="type">GdkModifierType</span></a>.</td></tr><tr><td><p><span class="term"><ahref="/usr/share/gtk-doc/html/glib/glib-Basic-Types.html#guint">guint</a> <em class="structfield"><code>button</code></em>;</span></p></td><td>the button which was pressed or released, numbered from 1 to 5.Normally button 1 is the left mouse button, 2 is the middle button,and 3 is the right button. On 2-button mice, the middle button can oftenbe simulated by pressing both mouse buttons together.</td></tr><tr><td><p><span class="term"><a class="link" href="gdk-Input-Devices.html#GdkDevice">GdkDevice</a> *<em class="structfield"><code>device</code></em>;</span></p></td><td>the device where the event originated.</td></tr><tr><td><p><span class="term"><ahref="/usr/share/gtk-doc/html/glib/glib-Basic-Types.html#gdouble">gdouble</a> <em class="structfield"><code>x_root</code></em>;</span></p></td><td>the x coordinate of the pointer relative to the root of the screen.</td></tr><tr><td><p><span class="term"><ahref="/usr/share/gtk-doc/html/glib/glib-Basic-Types.html#gdouble">gdouble</a> <em class="structfield"><code>y_root</code></em>;</span></p></td><td>the y coordinate of the pointer relative to the root of the screen.</td></tr></tbody></table></div></div><hr><div class="refsect2" lang="en"><a name="id3239868"></a><h3><a name="GdkEventScroll"></a>GdkEventScroll</h3><a class="indexterm" name="id3239881"></a><pre class="programlisting">typedef struct { GdkEventType type; GdkWindow *window; gint8 send_event; guint32 time; gdouble x; gdouble y; guint state; GdkScrollDirection direction; GdkDevice *device; gdouble x_root, y_root;} GdkEventScroll;</pre><p>Generated from button presses for the buttons 4 to 7. Wheel mice are usually configured to generate button press events for buttons 4 and 5when the wheel is turned.</p><div class="variablelist"><table border="0"><col align="left" valign="top"><tbody><tr><td><p><span class="term"><a class="link" href="gdk-Events.html#GdkEventType">GdkEventType</a> <em class="structfield"><code>type</code></em>;</span></p></td><td>the type of the event (<a class="link" href="gdk-Events.html#GDK-SCROLL:CAPS"><code class="literal">GDK_SCROLL</code></a>).</td></tr><tr><td><p><span class="term"><a class="link" href="gdk-Windows.html#GdkWindow">GdkWindow</a> *<em class="structfield"><code>window</code></em>;</span></p></td><td>the window which received the event.</td></tr><tr><td><p><span class="term"><ahref="/usr/share/gtk-doc/html/glib/glib-Basic-Types.html#gint8">gint8</a> <em class="structfield"><code>send_event</code></em>;</span></p></td><td><ahref="/usr/share/gtk-doc/html/glib/glib-Standard-Macros.html#TRUE:CAPS"><code class="literal">TRUE</code></a> if the event was sent explicitly (e.g. using <code class="function">XSendEvent</code>).</td></tr><tr><td><p><span class="term"><ahref="/usr/share/gtk-doc/html/glib/glib-Basic-Types.html#guint32">guint32</a> <em class="structfield"><code>time</code></em>;</span></p></td><td>the time of the event in milliseconds.</td></tr><tr><td><p><span class="term"><ahref="/usr/share/gtk-doc/html/glib/glib-Basic-Types.html#gdouble">gdouble</a> <em class="structfield"><code>x</code></em>;</span></p></td><td>the x coordinate of the pointer relative to the window.</td></tr><tr><td><p><span class="term"><ahref="/usr/share/gtk-doc/html/glib/glib-Basic-Types.html#gdouble">gdouble</a> <em class="structfield"><code>y</code></em>;</span></p></td><td>the y coordinate of the pointer relative to the window.</td></tr><tr><td><p><span class="term"><ahref="/usr/share/gtk-doc/html/glib/glib-Basic-Types.html#guint">guint</a> <em class="structfield"><code>state</code></em>;</span></p></td><td>a bit-mask representing the state of the modifier keys (e.g. Control,Shift and Alt) and the pointer buttons. See <a class="link" href="gdk-Windows.html#GdkModifierType"><span class="type">GdkModifierType</span></a>.</td></tr><tr><td><p><span class="term"><a class="link" href="gdk-Event-Structures.html#GdkScrollDirection">GdkScrollDirection</a> <em class="structfield"><code>direction</code></em>;</span></p></td><td>the direction to scroll to (one of <a class="link" href="gdk-Event-Structures.html#GDK-SCROLL-UP:CAPS"><code class="literal">GDK_SCROLL_UP</code></a>, <a class="link" href="gdk-Event-Structures.html#GDK-SCROLL-DOWN:CAPS"><code class="literal">GDK_SCROLL_DOWN</code></a>, <a class="link" href="gdk-Event-Structures.html#GDK-SCROLL-LEFT:CAPS"><code class="literal">GDK_SCROLL_LEFT</code></a> and <a class="link" href="gdk-Event-Structures.html#GDK-SCROLL-RIGHT:CAPS"><code class="literal">GDK_SCROLL_RIGHT</code></a>).</td></tr><tr><td><p><span class="term"><a class="link" href="gdk-Input-Devices.html#GdkDevice">GdkDevice</a> *<em class="structfield"><code>device</code></em>;</span></p></td><td>the device where the event originated.</td></tr><tr><td><p><span class="term"><ahref="/usr/share/gtk-doc/html/glib/glib-Basic-Types.html#gdouble">gdouble</a> <em class="structfield"><code>x_root</code></em>;</span></p></td><td>the x coordinate of the pointer relative to the root of the screen.</td></tr><tr><td><p><span class="term"><ahref="/usr/share/gtk-doc/html/glib/glib-Basic-Types.html#gdouble">gdouble</a> <em class="structfield"><code>y_root</code></em>;</span></p></td><td>the y coordinate of the pointer relative to the root of the screen.</td></tr></tbody></table></div></div><hr><div class="refsect2" lang="en"><a name="id3240222"></a><h3><a name="GdkEventMotion"></a>GdkEventMotion</h3><a class="indexterm" name="id3240234"></a><pre class="programlisting">typedef struct { GdkEventType type; GdkWindow *window; gint8 send_event; guint32 time; gdouble x; gdouble y; gdouble *axes; guint state; gint16 is_hint; GdkDevice *device; gdouble x_root, y_root;} GdkEventMotion;</pre><p>
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -