gtk3/docs/reference/gdk/html/gdk3-Events.html
2020-02-29 14:17:40 +00:00

1928 lines
88 KiB
HTML
Raw Blame History

This file contains invisible Unicode characters

This file contains invisible Unicode characters that are indistinguishable to humans but may be processed differently by a computer. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.

This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.

<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
<title>Events: GDK 3 Reference Manual</title>
<meta name="generator" content="DocBook XSL Stylesheets Vsnapshot">
<link rel="home" href="index.html" title="GDK 3 Reference Manual">
<link rel="up" href="reference.html" title="API Reference">
<link rel="prev" href="GdkGLContext.html" title="GdkGLContext">
<link rel="next" href="gdk3-Event-Structures.html" title="Event Structures">
<meta name="generator" content="GTK-Doc V1.32.1 (XML mode)">
<link rel="stylesheet" href="style.css" type="text/css">
</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="5"><tr valign="middle">
<td width="100%" align="left" class="shortcuts">
<a href="#" class="shortcut">Top</a><span id="nav_description">  <span class="dim">|</span> 
<a href="#gdk3-Events.description" class="shortcut">Description</a></span>
</td>
<td><a accesskey="h" href="index.html"><img src="home.png" width="16" height="16" border="0" alt="Home"></a></td>
<td><a accesskey="u" href="reference.html"><img src="up.png" width="16" height="16" border="0" alt="Up"></a></td>
<td><a accesskey="p" href="GdkGLContext.html"><img src="left.png" width="16" height="16" border="0" alt="Prev"></a></td>
<td><a accesskey="n" href="gdk3-Event-Structures.html"><img src="right.png" width="16" height="16" border="0" alt="Next"></a></td>
</tr></table>
<div class="refentry">
<a name="gdk3-Events"></a><div class="titlepage"></div>
<div class="refnamediv"><table width="100%"><tr>
<td valign="top">
<h2><span class="refentrytitle"><a name="gdk3-Events.top_of_page"></a>Events</span></h2>
<p>Events — Functions for handling events from the window system</p>
</td>
<td class="gallery_image" valign="top" align="right"></td>
</tr></table></div>
<div class="refsect1">
<a name="gdk3-Events.functions"></a><h2>Functions</h2>
<div class="informaltable"><table class="informaltable" width="100%" border="0">
<colgroup>
<col width="150px" class="functions_proto_type">
<col class="functions_proto_name">
</colgroup>
<tbody>
<tr>
<td class="function_type">
<span class="returnvalue">gboolean</span>
</td>
<td class="function_name">
<a class="link" href="gdk3-Events.html#gdk-events-pending" title="gdk_events_pending ()">gdk_events_pending</a> <span class="c_punctuation">()</span>
</td>
</tr>
<tr>
<td class="function_type">
<span class="returnvalue">GdkEvent</span> *
</td>
<td class="function_name">
<a class="link" href="gdk3-Events.html#gdk-event-peek" title="gdk_event_peek ()">gdk_event_peek</a> <span class="c_punctuation">()</span>
</td>
</tr>
<tr>
<td class="function_type">
<span class="returnvalue">GdkEvent</span> *
</td>
<td class="function_name">
<a class="link" href="gdk3-Events.html#gdk-event-get" title="gdk_event_get ()">gdk_event_get</a> <span class="c_punctuation">()</span>
</td>
</tr>
<tr>
<td class="function_type">
<span class="returnvalue">void</span>
</td>
<td class="function_name">
<a class="link" href="gdk3-Events.html#gdk-event-put" title="gdk_event_put ()">gdk_event_put</a> <span class="c_punctuation">()</span>
</td>
</tr>
<tr>
<td class="function_type">
<span class="returnvalue">GdkEvent</span> *
</td>
<td class="function_name">
<a class="link" href="gdk3-Events.html#gdk-event-new" title="gdk_event_new ()">gdk_event_new</a> <span class="c_punctuation">()</span>
</td>
</tr>
<tr>
<td class="function_type">
<span class="returnvalue">GdkEvent</span> *
</td>
<td class="function_name">
<a class="link" href="gdk3-Events.html#gdk-event-copy" title="gdk_event_copy ()">gdk_event_copy</a> <span class="c_punctuation">()</span>
</td>
</tr>
<tr>
<td class="function_type">
<span class="returnvalue">void</span>
</td>
<td class="function_name">
<a class="link" href="gdk3-Events.html#gdk-event-free" title="gdk_event_free ()">gdk_event_free</a> <span class="c_punctuation">()</span>
</td>
</tr>
<tr>
<td class="function_type">
<span class="returnvalue">gboolean</span>
</td>
<td class="function_name">
<a class="link" href="gdk3-Events.html#gdk-event-get-axis" title="gdk_event_get_axis ()">gdk_event_get_axis</a> <span class="c_punctuation">()</span>
</td>
</tr>
<tr>
<td class="function_type">
<span class="returnvalue">gboolean</span>
</td>
<td class="function_name">
<a class="link" href="gdk3-Events.html#gdk-event-get-button" title="gdk_event_get_button ()">gdk_event_get_button</a> <span class="c_punctuation">()</span>
</td>
</tr>
<tr>
<td class="function_type">
<span class="returnvalue">gboolean</span>
</td>
<td class="function_name">
<a class="link" href="gdk3-Events.html#gdk-event-get-click-count" title="gdk_event_get_click_count ()">gdk_event_get_click_count</a> <span class="c_punctuation">()</span>
</td>
</tr>
<tr>
<td class="function_type">
<span class="returnvalue">gboolean</span>
</td>
<td class="function_name">
<a class="link" href="gdk3-Events.html#gdk-event-get-coords" title="gdk_event_get_coords ()">gdk_event_get_coords</a> <span class="c_punctuation">()</span>
</td>
</tr>
<tr>
<td class="function_type">
<span class="returnvalue">gboolean</span>
</td>
<td class="function_name">
<a class="link" href="gdk3-Events.html#gdk-event-get-keycode" title="gdk_event_get_keycode ()">gdk_event_get_keycode</a> <span class="c_punctuation">()</span>
</td>
</tr>
<tr>
<td class="function_type">
<span class="returnvalue">gboolean</span>
</td>
<td class="function_name">
<a class="link" href="gdk3-Events.html#gdk-event-get-keyval" title="gdk_event_get_keyval ()">gdk_event_get_keyval</a> <span class="c_punctuation">()</span>
</td>
</tr>
<tr>
<td class="function_type">
<span class="returnvalue">gboolean</span>
</td>
<td class="function_name">
<a class="link" href="gdk3-Events.html#gdk-event-get-root-coords" title="gdk_event_get_root_coords ()">gdk_event_get_root_coords</a> <span class="c_punctuation">()</span>
</td>
</tr>
<tr>
<td class="function_type">
<span class="returnvalue">gboolean</span>
</td>
<td class="function_name">
<a class="link" href="gdk3-Events.html#gdk-event-get-scroll-direction" title="gdk_event_get_scroll_direction ()">gdk_event_get_scroll_direction</a> <span class="c_punctuation">()</span>
</td>
</tr>
<tr>
<td class="function_type">
<span class="returnvalue">gboolean</span>
</td>
<td class="function_name">
<a class="link" href="gdk3-Events.html#gdk-event-get-scroll-deltas" title="gdk_event_get_scroll_deltas ()">gdk_event_get_scroll_deltas</a> <span class="c_punctuation">()</span>
</td>
</tr>
<tr>
<td class="function_type">
<span class="returnvalue">gboolean</span>
</td>
<td class="function_name">
<a class="link" href="gdk3-Events.html#gdk-event-is-scroll-stop-event" title="gdk_event_is_scroll_stop_event ()">gdk_event_is_scroll_stop_event</a> <span class="c_punctuation">()</span>
</td>
</tr>
<tr>
<td class="function_type">
<span class="returnvalue">gboolean</span>
</td>
<td class="function_name">
<a class="link" href="gdk3-Events.html#gdk-event-get-state" title="gdk_event_get_state ()">gdk_event_get_state</a> <span class="c_punctuation">()</span>
</td>
</tr>
<tr>
<td class="function_type">
<span class="returnvalue">guint32</span>
</td>
<td class="function_name">
<a class="link" href="gdk3-Events.html#gdk-event-get-time" title="gdk_event_get_time ()">gdk_event_get_time</a> <span class="c_punctuation">()</span>
</td>
</tr>
<tr>
<td class="function_type">
<a class="link" href="gdk3-Windows.html#GdkWindow"><span class="returnvalue">GdkWindow</span></a> *
</td>
<td class="function_name">
<a class="link" href="gdk3-Events.html#gdk-event-get-window" title="gdk_event_get_window ()">gdk_event_get_window</a> <span class="c_punctuation">()</span>
</td>
</tr>
<tr>
<td class="function_type">
<span class="returnvalue">GdkEventType</span>
</td>
<td class="function_name">
<a class="link" href="gdk3-Events.html#gdk-event-get-event-type" title="gdk_event_get_event_type ()">gdk_event_get_event_type</a> <span class="c_punctuation">()</span>
</td>
</tr>
<tr>
<td class="function_type">
<span class="returnvalue">GdkEventSequence</span> *
</td>
<td class="function_name">
<a class="link" href="gdk3-Events.html#gdk-event-get-event-sequence" title="gdk_event_get_event_sequence ()">gdk_event_get_event_sequence</a> <span class="c_punctuation">()</span>
</td>
</tr>
<tr>
<td class="function_type">
<span class="returnvalue">void</span>
</td>
<td class="function_name">
<a class="link" href="gdk3-Events.html#gdk-event-request-motions" title="gdk_event_request_motions ()">gdk_event_request_motions</a> <span class="c_punctuation">()</span>
</td>
</tr>
<tr>
<td class="function_type">
<span class="returnvalue">gboolean</span>
</td>
<td class="function_name">
<a class="link" href="gdk3-Events.html#gdk-events-get-angle" title="gdk_events_get_angle ()">gdk_events_get_angle</a> <span class="c_punctuation">()</span>
</td>
</tr>
<tr>
<td class="function_type">
<span class="returnvalue">gboolean</span>
</td>
<td class="function_name">
<a class="link" href="gdk3-Events.html#gdk-events-get-center" title="gdk_events_get_center ()">gdk_events_get_center</a> <span class="c_punctuation">()</span>
</td>
</tr>
<tr>
<td class="function_type">
<span class="returnvalue">gboolean</span>
</td>
<td class="function_name">
<a class="link" href="gdk3-Events.html#gdk-events-get-distance" title="gdk_events_get_distance ()">gdk_events_get_distance</a> <span class="c_punctuation">()</span>
</td>
</tr>
<tr>
<td class="function_type">
<span class="returnvalue">gboolean</span>
</td>
<td class="function_name">
<a class="link" href="gdk3-Events.html#gdk-event-triggers-context-menu" title="gdk_event_triggers_context_menu ()">gdk_event_triggers_context_menu</a> <span class="c_punctuation">()</span>
</td>
</tr>
<tr>
<td class="function_type">
<a class="link" href="GdkSeat.html" title="GdkSeat"><span class="returnvalue">GdkSeat</span></a> *
</td>
<td class="function_name">
<a class="link" href="gdk3-Events.html#gdk-event-get-seat" title="gdk_event_get_seat ()">gdk_event_get_seat</a> <span class="c_punctuation">()</span>
</td>
</tr>
<tr>
<td class="function_type">
<span class="returnvalue">int</span>
</td>
<td class="function_name">
<a class="link" href="gdk3-Events.html#gdk-event-get-scancode" title="gdk_event_get_scancode ()">gdk_event_get_scancode</a> <span class="c_punctuation">()</span>
</td>
</tr>
<tr>
<td class="function_type">
<span class="returnvalue">gboolean</span>
</td>
<td class="function_name">
<a class="link" href="gdk3-Events.html#gdk-event-get-pointer-emulated" title="gdk_event_get_pointer_emulated ()">gdk_event_get_pointer_emulated</a> <span class="c_punctuation">()</span>
</td>
</tr>
<tr>
<td class="function_type">
<span class="returnvalue">void</span>
</td>
<td class="function_name">
<a class="link" href="gdk3-Events.html#gdk-event-handler-set" title="gdk_event_handler_set ()">gdk_event_handler_set</a> <span class="c_punctuation">()</span>
</td>
</tr>
<tr>
<td class="function_type">
<span class="returnvalue">void</span>
</td>
<td class="function_name">
<span class="c_punctuation">(</span><a class="link" href="gdk3-Events.html#GdkEventFunc" title="GdkEventFunc ()">*GdkEventFunc</a><span class="c_punctuation">)</span> <span class="c_punctuation">()</span>
</td>
</tr>
<tr>
<td class="function_type">
<span class="returnvalue">gboolean</span>
</td>
<td class="function_name">
<a class="link" href="gdk3-Events.html#gdk-get-show-events" title="gdk_get_show_events ()">gdk_get_show_events</a> <span class="c_punctuation">()</span>
</td>
</tr>
<tr>
<td class="function_type">
<span class="returnvalue">void</span>
</td>
<td class="function_name">
<a class="link" href="gdk3-Events.html#gdk-set-show-events" title="gdk_set_show_events ()">gdk_set_show_events</a> <span class="c_punctuation">()</span>
</td>
</tr>
<tr>
<td class="function_type">
<span class="returnvalue">void</span>
</td>
<td class="function_name">
<a class="link" href="gdk3-Events.html#gdk-event-set-screen" title="gdk_event_set_screen ()">gdk_event_set_screen</a> <span class="c_punctuation">()</span>
</td>
</tr>
<tr>
<td class="function_type">
<a class="link" href="GdkScreen.html" title="GdkScreen"><span class="returnvalue">GdkScreen</span></a> *
</td>
<td class="function_name">
<a class="link" href="gdk3-Events.html#gdk-event-get-screen" title="gdk_event_get_screen ()">gdk_event_get_screen</a> <span class="c_punctuation">()</span>
</td>
</tr>
<tr>
<td class="function_type">
<a class="link" href="GdkDevice.html" title="GdkDevice"><span class="returnvalue">GdkDevice</span></a> *
</td>
<td class="function_name">
<a class="link" href="gdk3-Events.html#gdk-event-get-device" title="gdk_event_get_device ()">gdk_event_get_device</a> <span class="c_punctuation">()</span>
</td>
</tr>
<tr>
<td class="function_type">
<span class="returnvalue">void</span>
</td>
<td class="function_name">
<a class="link" href="gdk3-Events.html#gdk-event-set-device" title="gdk_event_set_device ()">gdk_event_set_device</a> <span class="c_punctuation">()</span>
</td>
</tr>
<tr>
<td class="function_type">
<a class="link" href="GdkDevice.html" title="GdkDevice"><span class="returnvalue">GdkDevice</span></a> *
</td>
<td class="function_name">
<a class="link" href="gdk3-Events.html#gdk-event-get-source-device" title="gdk_event_get_source_device ()">gdk_event_get_source_device</a> <span class="c_punctuation">()</span>
</td>
</tr>
<tr>
<td class="function_type">
<span class="returnvalue">void</span>
</td>
<td class="function_name">
<a class="link" href="gdk3-Events.html#gdk-event-set-source-device" title="gdk_event_set_source_device ()">gdk_event_set_source_device</a> <span class="c_punctuation">()</span>
</td>
</tr>
<tr>
<td class="function_type">
<span class="returnvalue">GdkDeviceTool</span> *
</td>
<td class="function_name">
<a class="link" href="gdk3-Events.html#gdk-event-get-device-tool" title="gdk_event_get_device_tool ()">gdk_event_get_device_tool</a> <span class="c_punctuation">()</span>
</td>
</tr>
<tr>
<td class="function_type">
<span class="returnvalue">void</span>
</td>
<td class="function_name">
<a class="link" href="gdk3-Events.html#gdk-event-set-device-tool" title="gdk_event_set_device_tool ()">gdk_event_set_device_tool</a> <span class="c_punctuation">()</span>
</td>
</tr>
<tr>
<td class="function_type">
<span class="returnvalue">gboolean</span>
</td>
<td class="function_name">
<a class="link" href="gdk3-Events.html#gdk-setting-get" title="gdk_setting_get ()">gdk_setting_get</a> <span class="c_punctuation">()</span>
</td>
</tr>
</tbody>
</table></div>
</div>
<div class="refsect1">
<a name="gdk3-Events.other"></a><h2>Types and Values</h2>
<div class="informaltable"><table class="informaltable" width="100%" border="0">
<colgroup>
<col width="150px" class="other_proto_type">
<col class="other_proto_name">
</colgroup>
<tbody>
<tr>
<td class="datatype_keyword">enum</td>
<td class="function_name">GdkEventType</td>
</tr>
<tr>
<td class="datatype_keyword">enum</td>
<td class="function_name">GdkEventMask</td>
</tr>
<tr>
<td class="define_keyword">#define</td>
<td class="function_name">GDK_CURRENT_TIME</td>
</tr>
<tr>
<td class="define_keyword">#define</td>
<td class="function_name">GDK_PRIORITY_EVENTS</td>
</tr>
<tr>
<td class="define_keyword">#define</td>
<td class="function_name">GDK_PRIORITY_REDRAW</td>
</tr>
<tr>
<td class="define_keyword">#define</td>
<td class="function_name">GDK_EVENT_PROPAGATE</td>
</tr>
<tr>
<td class="define_keyword">#define</td>
<td class="function_name">GDK_EVENT_STOP</td>
</tr>
<tr>
<td class="define_keyword">#define</td>
<td class="function_name">GDK_BUTTON_PRIMARY</td>
</tr>
<tr>
<td class="define_keyword">#define</td>
<td class="function_name">GDK_BUTTON_MIDDLE</td>
</tr>
<tr>
<td class="define_keyword">#define</td>
<td class="function_name">GDK_BUTTON_SECONDARY</td>
</tr>
<tr>
<td class="datatype_keyword"> </td>
<td class="function_name">GdkEventSequence</td>
</tr>
</tbody>
</table></div>
</div>
<div class="refsect1">
<a name="gdk3-Events.includes"></a><h2>Includes</h2>
<pre class="synopsis">#include &lt;gdk/gdk.h&gt;
</pre>
</div>
<div class="refsect1">
<a name="gdk3-Events.description"></a><h2>Description</h2>
<p>This section describes functions dealing with events from the window
system.</p>
<p>In GTK+ applications the events are handled automatically in
<a href="https://developer.gnome.org/gtk4/gtk4-General.html#gtk-main-do-event"><code class="function">gtk_main_do_event()</code></a> and passed on to the appropriate widgets, so these
functions are rarely needed. Though some of the fields in the
<a class="link" href="gdk3-Event-Structures.html" title="Event Structures">Event Structures</a> are useful.</p>
</div>
<div class="refsect1">
<a name="gdk3-Events.functions_details"></a><h2>Functions</h2>
<div class="refsect2">
<a name="gdk-events-pending"></a><h3>gdk_events_pending ()</h3>
<pre class="programlisting"><span class="returnvalue">gboolean</span>
gdk_events_pending (<em class="parameter"><code><span class="type">void</span></code></em>);</pre>
<p>Checks if any events are ready to be processed for any display.</p>
<div class="refsect3">
<a name="gdk-events-pending.returns"></a><h4>Returns</h4>
<p> <code class="literal">TRUE</code> if any events are pending.</p>
</div>
</div>
<hr>
<div class="refsect2">
<a name="gdk-event-peek"></a><h3>gdk_event_peek ()</h3>
<pre class="programlisting"><span class="returnvalue">GdkEvent</span> *
gdk_event_peek (<em class="parameter"><code><span class="type">void</span></code></em>);</pre>
<p>If there is an event waiting in the event queue of some open
display, returns a copy of it. See <a class="link" href="GdkDisplay.html#gdk-display-peek-event" title="gdk_display_peek_event ()"><code class="function">gdk_display_peek_event()</code></a>.</p>
<div class="refsect3">
<a name="gdk-event-peek.returns"></a><h4>Returns</h4>
<p>a copy of the first <span class="type">GdkEvent</span> on some event
queue, or <code class="literal">NULL</code> if no events are in any queues. The returned
<span class="type">GdkEvent</span> should be freed with <a class="link" href="gdk3-Events.html#gdk-event-free" title="gdk_event_free ()"><code class="function">gdk_event_free()</code></a>. </p>
<p><span class="annotation">[<acronym title="NULL may be passed as the value in, out, in-out; or as a return value."><span class="acronym">nullable</span></acronym>]</span></p>
</div>
</div>
<hr>
<div class="refsect2">
<a name="gdk-event-get"></a><h3>gdk_event_get ()</h3>
<pre class="programlisting"><span class="returnvalue">GdkEvent</span> *
gdk_event_get (<em class="parameter"><code><span class="type">void</span></code></em>);</pre>
<p>Checks all open displays for a <span class="type">GdkEvent</span> to process,to be processed
on, fetching events from the windowing system if necessary.
See <a class="link" href="GdkDisplay.html#gdk-display-get-event" title="gdk_display_get_event ()"><code class="function">gdk_display_get_event()</code></a>.</p>
<div class="refsect3">
<a name="gdk-event-get.returns"></a><h4>Returns</h4>
<p>the next <span class="type">GdkEvent</span> to be processed, or <code class="literal">NULL</code>
if no events are pending. The returned <span class="type">GdkEvent</span> should be freed
with <a class="link" href="gdk3-Events.html#gdk-event-free" title="gdk_event_free ()"><code class="function">gdk_event_free()</code></a>. </p>
<p><span class="annotation">[<acronym title="NULL may be passed as the value in, out, in-out; or as a return value."><span class="acronym">nullable</span></acronym>]</span></p>
</div>
</div>
<hr>
<div class="refsect2">
<a name="gdk-event-put"></a><h3>gdk_event_put ()</h3>
<pre class="programlisting"><span class="returnvalue">void</span>
gdk_event_put (<em class="parameter"><code>const <span class="type">GdkEvent</span> *event</code></em>);</pre>
<p>Appends a copy of the given event onto the front of the event
queue for event-&gt;any.windows display, or the default event
queue if event-&gt;any.window is <code class="literal">NULL</code>. See <a class="link" href="GdkDisplay.html#gdk-display-put-event" title="gdk_display_put_event ()"><code class="function">gdk_display_put_event()</code></a>.</p>
<div class="refsect3">
<a name="gdk-event-put.parameters"></a><h4>Parameters</h4>
<div class="informaltable"><table class="informaltable" width="100%" border="0">
<colgroup>
<col width="150px" class="parameters_name">
<col class="parameters_description">
<col width="200px" class="parameters_annotations">
</colgroup>
<tbody><tr>
<td class="parameter_name"><p>event</p></td>
<td class="parameter_description"><p>a <span class="type">GdkEvent</span>.</p></td>
<td class="parameter_annotations"> </td>
</tr></tbody>
</table></div>
</div>
</div>
<hr>
<div class="refsect2">
<a name="gdk-event-new"></a><h3>gdk_event_new ()</h3>
<pre class="programlisting"><span class="returnvalue">GdkEvent</span> *
gdk_event_new (<em class="parameter"><code><span class="type">GdkEventType</span> type</code></em>);</pre>
<p>Creates a new event of the given type. All fields are set to 0.</p>
<div class="refsect3">
<a name="gdk-event-new.parameters"></a><h4>Parameters</h4>
<div class="informaltable"><table class="informaltable" width="100%" border="0">
<colgroup>
<col width="150px" class="parameters_name">
<col class="parameters_description">
<col width="200px" class="parameters_annotations">
</colgroup>
<tbody><tr>
<td class="parameter_name"><p>type</p></td>
<td class="parameter_description"><p>a <span class="type">GdkEventType</span> </p></td>
<td class="parameter_annotations"> </td>
</tr></tbody>
</table></div>
</div>
<div class="refsect3">
<a name="gdk-event-new.returns"></a><h4>Returns</h4>
<p> a newly-allocated <span class="type">GdkEvent</span>. The returned <span class="type">GdkEvent</span>
should be freed with <a class="link" href="gdk3-Events.html#gdk-event-free" title="gdk_event_free ()"><code class="function">gdk_event_free()</code></a>.</p>
</div>
<p class="since">Since: 2.2</p>
</div>
<hr>
<div class="refsect2">
<a name="gdk-event-copy"></a><h3>gdk_event_copy ()</h3>
<pre class="programlisting"><span class="returnvalue">GdkEvent</span> *
gdk_event_copy (<em class="parameter"><code>const <span class="type">GdkEvent</span> *event</code></em>);</pre>
<p>Copies a <span class="type">GdkEvent</span>, copying or incrementing the reference count of the
resources associated with it (e.g. <a class="link" href="gdk3-Windows.html#GdkWindow"><span class="type">GdkWindow</span></a>s and strings).</p>
<div class="refsect3">
<a name="gdk-event-copy.parameters"></a><h4>Parameters</h4>
<div class="informaltable"><table class="informaltable" width="100%" border="0">
<colgroup>
<col width="150px" class="parameters_name">
<col class="parameters_description">
<col width="200px" class="parameters_annotations">
</colgroup>
<tbody><tr>
<td class="parameter_name"><p>event</p></td>
<td class="parameter_description"><p>a <span class="type">GdkEvent</span></p></td>
<td class="parameter_annotations"> </td>
</tr></tbody>
</table></div>
</div>
<div class="refsect3">
<a name="gdk-event-copy.returns"></a><h4>Returns</h4>
<p> a copy of <em class="parameter"><code>event</code></em>
. The returned <span class="type">GdkEvent</span> should be freed with
<a class="link" href="gdk3-Events.html#gdk-event-free" title="gdk_event_free ()"><code class="function">gdk_event_free()</code></a>.</p>
</div>
</div>
<hr>
<div class="refsect2">
<a name="gdk-event-free"></a><h3>gdk_event_free ()</h3>
<pre class="programlisting"><span class="returnvalue">void</span>
gdk_event_free (<em class="parameter"><code><span class="type">GdkEvent</span> *event</code></em>);</pre>
<p>Frees a <span class="type">GdkEvent</span>, freeing or decrementing any resources associated with it.
Note that this function should only be called with events returned from
functions such as <a class="link" href="gdk3-Events.html#gdk-event-peek" title="gdk_event_peek ()"><code class="function">gdk_event_peek()</code></a>, <a class="link" href="gdk3-Events.html#gdk-event-get" title="gdk_event_get ()"><code class="function">gdk_event_get()</code></a>, <a class="link" href="gdk3-Events.html#gdk-event-copy" title="gdk_event_copy ()"><code class="function">gdk_event_copy()</code></a>
and <a class="link" href="gdk3-Events.html#gdk-event-new" title="gdk_event_new ()"><code class="function">gdk_event_new()</code></a>.</p>
<div class="refsect3">
<a name="gdk-event-free.parameters"></a><h4>Parameters</h4>
<div class="informaltable"><table class="informaltable" width="100%" border="0">
<colgroup>
<col width="150px" class="parameters_name">
<col class="parameters_description">
<col width="200px" class="parameters_annotations">
</colgroup>
<tbody><tr>
<td class="parameter_name"><p>event</p></td>
<td class="parameter_description"><p>a <span class="type">GdkEvent</span>.</p></td>
<td class="parameter_annotations"> </td>
</tr></tbody>
</table></div>
</div>
</div>
<hr>
<div class="refsect2">
<a name="gdk-event-get-axis"></a><h3>gdk_event_get_axis ()</h3>
<pre class="programlisting"><span class="returnvalue">gboolean</span>
gdk_event_get_axis (<em class="parameter"><code>const <span class="type">GdkEvent</span> *event</code></em>,
<em class="parameter"><code><span class="type">GdkAxisUse</span> axis_use</code></em>,
<em class="parameter"><code><span class="type">gdouble</span> *value</code></em>);</pre>
<p>Extract the axis value for a particular axis use from
an event structure.</p>
<div class="refsect3">
<a name="gdk-event-get-axis.parameters"></a><h4>Parameters</h4>
<div class="informaltable"><table class="informaltable" width="100%" border="0">
<colgroup>
<col width="150px" class="parameters_name">
<col class="parameters_description">
<col width="200px" class="parameters_annotations">
</colgroup>
<tbody>
<tr>
<td class="parameter_name"><p>event</p></td>
<td class="parameter_description"><p>a <span class="type">GdkEvent</span></p></td>
<td class="parameter_annotations"> </td>
</tr>
<tr>
<td class="parameter_name"><p>axis_use</p></td>
<td class="parameter_description"><p>the axis use to look for</p></td>
<td class="parameter_annotations"> </td>
</tr>
<tr>
<td class="parameter_name"><p>value</p></td>
<td class="parameter_description"><p>location to store the value found. </p></td>
<td class="parameter_annotations"><span class="annotation">[<acronym title="Parameter for returning results. Default is transfer full."><span class="acronym">out</span></acronym>]</span></td>
</tr>
</tbody>
</table></div>
</div>
<div class="refsect3">
<a name="gdk-event-get-axis.returns"></a><h4>Returns</h4>
<p> <code class="literal">TRUE</code> if the specified axis was found, otherwise <code class="literal">FALSE</code></p>
</div>
</div>
<hr>
<div class="refsect2">
<a name="gdk-event-get-button"></a><h3>gdk_event_get_button ()</h3>
<pre class="programlisting"><span class="returnvalue">gboolean</span>
gdk_event_get_button (<em class="parameter"><code>const <span class="type">GdkEvent</span> *event</code></em>,
<em class="parameter"><code><span class="type">guint</span> *button</code></em>);</pre>
<p>Extract the button number from an event.</p>
<div class="refsect3">
<a name="gdk-event-get-button.parameters"></a><h4>Parameters</h4>
<div class="informaltable"><table class="informaltable" width="100%" border="0">
<colgroup>
<col width="150px" class="parameters_name">
<col class="parameters_description">
<col width="200px" class="parameters_annotations">
</colgroup>
<tbody>
<tr>
<td class="parameter_name"><p>event</p></td>
<td class="parameter_description"><p>a <span class="type">GdkEvent</span></p></td>
<td class="parameter_annotations"> </td>
</tr>
<tr>
<td class="parameter_name"><p>button</p></td>
<td class="parameter_description"><p>location to store mouse button number. </p></td>
<td class="parameter_annotations"><span class="annotation">[<acronym title="Parameter for returning results. Default is transfer full."><span class="acronym">out</span></acronym>]</span></td>
</tr>
</tbody>
</table></div>
</div>
<div class="refsect3">
<a name="gdk-event-get-button.returns"></a><h4>Returns</h4>
<p> <code class="literal">TRUE</code> if the event delivered a button number</p>
</div>
<p class="since">Since: <a class="link" href="api-index-3-2.html#api-index-3.2">3.2</a></p>
</div>
<hr>
<div class="refsect2">
<a name="gdk-event-get-click-count"></a><h3>gdk_event_get_click_count ()</h3>
<pre class="programlisting"><span class="returnvalue">gboolean</span>
gdk_event_get_click_count (<em class="parameter"><code>const <span class="type">GdkEvent</span> *event</code></em>,
<em class="parameter"><code><span class="type">guint</span> *click_count</code></em>);</pre>
<p>Extracts the click count from an event.</p>
<div class="refsect3">
<a name="gdk-event-get-click-count.parameters"></a><h4>Parameters</h4>
<div class="informaltable"><table class="informaltable" width="100%" border="0">
<colgroup>
<col width="150px" class="parameters_name">
<col class="parameters_description">
<col width="200px" class="parameters_annotations">
</colgroup>
<tbody>
<tr>
<td class="parameter_name"><p>event</p></td>
<td class="parameter_description"><p>a <span class="type">GdkEvent</span></p></td>
<td class="parameter_annotations"> </td>
</tr>
<tr>
<td class="parameter_name"><p>click_count</p></td>
<td class="parameter_description"><p>location to store click count. </p></td>
<td class="parameter_annotations"><span class="annotation">[<acronym title="Parameter for returning results. Default is transfer full."><span class="acronym">out</span></acronym>]</span></td>
</tr>
</tbody>
</table></div>
</div>
<div class="refsect3">
<a name="gdk-event-get-click-count.returns"></a><h4>Returns</h4>
<p> <code class="literal">TRUE</code> if the event delivered a click count</p>
</div>
<p class="since">Since: <a class="link" href="api-index-3-2.html#api-index-3.2">3.2</a></p>
</div>
<hr>
<div class="refsect2">
<a name="gdk-event-get-coords"></a><h3>gdk_event_get_coords ()</h3>
<pre class="programlisting"><span class="returnvalue">gboolean</span>
gdk_event_get_coords (<em class="parameter"><code>const <span class="type">GdkEvent</span> *event</code></em>,
<em class="parameter"><code><span class="type">gdouble</span> *x_win</code></em>,
<em class="parameter"><code><span class="type">gdouble</span> *y_win</code></em>);</pre>
<p>Extract the event window relative x/y coordinates from an event.</p>
<div class="refsect3">
<a name="gdk-event-get-coords.parameters"></a><h4>Parameters</h4>
<div class="informaltable"><table class="informaltable" width="100%" border="0">
<colgroup>
<col width="150px" class="parameters_name">
<col class="parameters_description">
<col width="200px" class="parameters_annotations">
</colgroup>
<tbody>
<tr>
<td class="parameter_name"><p>event</p></td>
<td class="parameter_description"><p>a <span class="type">GdkEvent</span></p></td>
<td class="parameter_annotations"> </td>
</tr>
<tr>
<td class="parameter_name"><p>x_win</p></td>
<td class="parameter_description"><p>location to put event window x coordinate. </p></td>
<td class="parameter_annotations"><span class="annotation">[<acronym title="Parameter for returning results. Default is transfer full."><span class="acronym">out</span></acronym>][<acronym title="NULL may be passed instead of a pointer to a location."><span class="acronym">optional</span></acronym>]</span></td>
</tr>
<tr>
<td class="parameter_name"><p>y_win</p></td>
<td class="parameter_description"><p>location to put event window y coordinate. </p></td>
<td class="parameter_annotations"><span class="annotation">[<acronym title="Parameter for returning results. Default is transfer full."><span class="acronym">out</span></acronym>][<acronym title="NULL may be passed instead of a pointer to a location."><span class="acronym">optional</span></acronym>]</span></td>
</tr>
</tbody>
</table></div>
</div>
<div class="refsect3">
<a name="gdk-event-get-coords.returns"></a><h4>Returns</h4>
<p> <code class="literal">TRUE</code> if the event delivered event window coordinates</p>
</div>
</div>
<hr>
<div class="refsect2">
<a name="gdk-event-get-keycode"></a><h3>gdk_event_get_keycode ()</h3>
<pre class="programlisting"><span class="returnvalue">gboolean</span>
gdk_event_get_keycode (<em class="parameter"><code>const <span class="type">GdkEvent</span> *event</code></em>,
<em class="parameter"><code><span class="type">guint16</span> *keycode</code></em>);</pre>
<p>Extracts the hardware keycode from an event.</p>
<p>Also see <a class="link" href="gdk3-Events.html#gdk-event-get-scancode" title="gdk_event_get_scancode ()"><code class="function">gdk_event_get_scancode()</code></a>.</p>
<div class="refsect3">
<a name="gdk-event-get-keycode.parameters"></a><h4>Parameters</h4>
<div class="informaltable"><table class="informaltable" width="100%" border="0">
<colgroup>
<col width="150px" class="parameters_name">
<col class="parameters_description">
<col width="200px" class="parameters_annotations">
</colgroup>
<tbody>
<tr>
<td class="parameter_name"><p>event</p></td>
<td class="parameter_description"><p>a <span class="type">GdkEvent</span></p></td>
<td class="parameter_annotations"> </td>
</tr>
<tr>
<td class="parameter_name"><p>keycode</p></td>
<td class="parameter_description"><p>location to store the keycode. </p></td>
<td class="parameter_annotations"><span class="annotation">[<acronym title="Parameter for returning results. Default is transfer full."><span class="acronym">out</span></acronym>]</span></td>
</tr>
</tbody>
</table></div>
</div>
<div class="refsect3">
<a name="gdk-event-get-keycode.returns"></a><h4>Returns</h4>
<p> <code class="literal">TRUE</code> if the event delivered a hardware keycode</p>
</div>
<p class="since">Since: <a class="link" href="api-index-3-2.html#api-index-3.2">3.2</a></p>
</div>
<hr>
<div class="refsect2">
<a name="gdk-event-get-keyval"></a><h3>gdk_event_get_keyval ()</h3>
<pre class="programlisting"><span class="returnvalue">gboolean</span>
gdk_event_get_keyval (<em class="parameter"><code>const <span class="type">GdkEvent</span> *event</code></em>,
<em class="parameter"><code><span class="type">guint</span> *keyval</code></em>);</pre>
<p>Extracts the keyval from an event.</p>
<div class="refsect3">
<a name="gdk-event-get-keyval.parameters"></a><h4>Parameters</h4>
<div class="informaltable"><table class="informaltable" width="100%" border="0">
<colgroup>
<col width="150px" class="parameters_name">
<col class="parameters_description">
<col width="200px" class="parameters_annotations">
</colgroup>
<tbody>
<tr>
<td class="parameter_name"><p>event</p></td>
<td class="parameter_description"><p>a <span class="type">GdkEvent</span></p></td>
<td class="parameter_annotations"> </td>
</tr>
<tr>
<td class="parameter_name"><p>keyval</p></td>
<td class="parameter_description"><p>location to store the keyval. </p></td>
<td class="parameter_annotations"><span class="annotation">[<acronym title="Parameter for returning results. Default is transfer full."><span class="acronym">out</span></acronym>]</span></td>
</tr>
</tbody>
</table></div>
</div>
<div class="refsect3">
<a name="gdk-event-get-keyval.returns"></a><h4>Returns</h4>
<p> <code class="literal">TRUE</code> if the event delivered a key symbol</p>
</div>
<p class="since">Since: <a class="link" href="api-index-3-2.html#api-index-3.2">3.2</a></p>
</div>
<hr>
<div class="refsect2">
<a name="gdk-event-get-root-coords"></a><h3>gdk_event_get_root_coords ()</h3>
<pre class="programlisting"><span class="returnvalue">gboolean</span>
gdk_event_get_root_coords (<em class="parameter"><code>const <span class="type">GdkEvent</span> *event</code></em>,
<em class="parameter"><code><span class="type">gdouble</span> *x_root</code></em>,
<em class="parameter"><code><span class="type">gdouble</span> *y_root</code></em>);</pre>
<p>Extract the root window relative x/y coordinates from an event.</p>
<div class="refsect3">
<a name="gdk-event-get-root-coords.parameters"></a><h4>Parameters</h4>
<div class="informaltable"><table class="informaltable" width="100%" border="0">
<colgroup>
<col width="150px" class="parameters_name">
<col class="parameters_description">
<col width="200px" class="parameters_annotations">
</colgroup>
<tbody>
<tr>
<td class="parameter_name"><p>event</p></td>
<td class="parameter_description"><p>a <span class="type">GdkEvent</span></p></td>
<td class="parameter_annotations"> </td>
</tr>
<tr>
<td class="parameter_name"><p>x_root</p></td>
<td class="parameter_description"><p>location to put root window x coordinate. </p></td>
<td class="parameter_annotations"><span class="annotation">[<acronym title="Parameter for returning results. Default is transfer full."><span class="acronym">out</span></acronym>][<acronym title="NULL may be passed instead of a pointer to a location."><span class="acronym">optional</span></acronym>]</span></td>
</tr>
<tr>
<td class="parameter_name"><p>y_root</p></td>
<td class="parameter_description"><p>location to put root window y coordinate. </p></td>
<td class="parameter_annotations"><span class="annotation">[<acronym title="Parameter for returning results. Default is transfer full."><span class="acronym">out</span></acronym>][<acronym title="NULL may be passed instead of a pointer to a location."><span class="acronym">optional</span></acronym>]</span></td>
</tr>
</tbody>
</table></div>
</div>
<div class="refsect3">
<a name="gdk-event-get-root-coords.returns"></a><h4>Returns</h4>
<p> <code class="literal">TRUE</code> if the event delivered root window coordinates</p>
</div>
</div>
<hr>
<div class="refsect2">
<a name="gdk-event-get-scroll-direction"></a><h3>gdk_event_get_scroll_direction ()</h3>
<pre class="programlisting"><span class="returnvalue">gboolean</span>
gdk_event_get_scroll_direction (<em class="parameter"><code>const <span class="type">GdkEvent</span> *event</code></em>,
<em class="parameter"><code><span class="type">GdkScrollDirection</span> *direction</code></em>);</pre>
<p>Extracts the scroll direction from an event.</p>
<p>If <em class="parameter"><code>event</code></em>
is not of type <code class="literal">GDK_SCROLL</code>, the contents of <em class="parameter"><code>direction</code></em>
are undefined.</p>
<p>If you wish to handle both discrete and smooth scrolling, you
should check the return value of this function, or of
<a class="link" href="gdk3-Events.html#gdk-event-get-scroll-deltas" title="gdk_event_get_scroll_deltas ()"><code class="function">gdk_event_get_scroll_deltas()</code></a>; for instance:</p>
<div class="informalexample">
<table class="listing_frame" border="0" cellpadding="0" cellspacing="0">
<tbody>
<tr>
<td class="listing_lines" align="right"><pre>1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27</pre></td>
<td class="listing_code"><pre class="programlisting"><span class="n">GdkScrollDirection</span> <span class="n">direction</span><span class="p">;</span>
<span class="kt">double</span> <span class="n">vscroll_factor</span> <span class="o">=</span> <span class="mf">0.0</span><span class="p">;</span>
<span class="kt">double</span> <span class="n">x_scroll</span><span class="p">,</span> <span class="n">y_scroll</span><span class="p">;</span>
<span class="k">if</span> <span class="p">(</span><span class="n">gdk_event_get_scroll_direction</span> <span class="p">(</span><span class="n">event</span><span class="p">,</span> <span class="o">&amp;</span><span class="n">direction</span><span class="p">))</span>
<span class="p">{</span>
<span class="c1">// Handle discrete scrolling with a known constant delta;</span>
<span class="k">const</span> <span class="kt">double</span> <span class="n">delta</span> <span class="o">=</span> <span class="mf">12.0</span><span class="p">;</span>
<span class="k">switch</span> <span class="p">(</span><span class="n">direction</span><span class="p">)</span>
<span class="p">{</span>
<span class="k">case</span> <span class="nl">GDK_SCROLL_UP</span><span class="p">:</span>
<span class="n">vscroll_factor</span> <span class="o">=</span> <span class="o">-</span><span class="n">delta</span><span class="p">;</span>
<span class="k">break</span><span class="p">;</span>
<span class="k">case</span> <span class="nl">GDK_SCROLL_DOWN</span><span class="p">:</span>
<span class="n">vscroll_factor</span> <span class="o">=</span> <span class="n">delta</span><span class="p">;</span>
<span class="k">break</span><span class="p">;</span>
<span class="k">default</span><span class="o">:</span>
<span class="c1">// no scrolling</span>
<span class="k">break</span><span class="p">;</span>
<span class="p">}</span>
<span class="p">}</span>
<span class="k">else</span> <span class="k">if</span> <span class="p">(</span><span class="n">gdk_event_get_scroll_deltas</span> <span class="p">(</span><span class="n">event</span><span class="p">,</span> <span class="o">&amp;</span><span class="n">x_scroll</span><span class="p">,</span> <span class="o">&amp;</span><span class="n">y_scroll</span><span class="p">))</span>
<span class="p">{</span>
<span class="c1">// Handle smooth scrolling directly</span>
<span class="n">vscroll_factor</span> <span class="o">=</span> <span class="n">y_scroll</span><span class="p">;</span>
<span class="p">}</span></pre></td>
</tr>
</tbody>
</table>
</div>
<p></p>
<div class="refsect3">
<a name="gdk-event-get-scroll-direction.parameters"></a><h4>Parameters</h4>
<div class="informaltable"><table class="informaltable" width="100%" border="0">
<colgroup>
<col width="150px" class="parameters_name">
<col class="parameters_description">
<col width="200px" class="parameters_annotations">
</colgroup>
<tbody>
<tr>
<td class="parameter_name"><p>event</p></td>
<td class="parameter_description"><p>a <span class="type">GdkEvent</span></p></td>
<td class="parameter_annotations"> </td>
</tr>
<tr>
<td class="parameter_name"><p>direction</p></td>
<td class="parameter_description"><p>location to store the scroll direction. </p></td>
<td class="parameter_annotations"><span class="annotation">[<acronym title="Parameter for returning results. Default is transfer full."><span class="acronym">out</span></acronym>]</span></td>
</tr>
</tbody>
</table></div>
</div>
<div class="refsect3">
<a name="gdk-event-get-scroll-direction.returns"></a><h4>Returns</h4>
<p> <code class="literal">TRUE</code> if the event delivered a scroll direction
and <code class="literal">FALSE</code> otherwise</p>
</div>
<p class="since">Since: <a class="link" href="api-index-3-2.html#api-index-3.2">3.2</a></p>
</div>
<hr>
<div class="refsect2">
<a name="gdk-event-get-scroll-deltas"></a><h3>gdk_event_get_scroll_deltas ()</h3>
<pre class="programlisting"><span class="returnvalue">gboolean</span>
gdk_event_get_scroll_deltas (<em class="parameter"><code>const <span class="type">GdkEvent</span> *event</code></em>,
<em class="parameter"><code><span class="type">gdouble</span> *delta_x</code></em>,
<em class="parameter"><code><span class="type">gdouble</span> *delta_y</code></em>);</pre>
<p>Retrieves the scroll deltas from a <span class="type">GdkEvent</span></p>
<p>See also: <a class="link" href="gdk3-Events.html#gdk-event-get-scroll-direction" title="gdk_event_get_scroll_direction ()"><code class="function">gdk_event_get_scroll_direction()</code></a></p>
<div class="refsect3">
<a name="gdk-event-get-scroll-deltas.parameters"></a><h4>Parameters</h4>
<div class="informaltable"><table class="informaltable" width="100%" border="0">
<colgroup>
<col width="150px" class="parameters_name">
<col class="parameters_description">
<col width="200px" class="parameters_annotations">
</colgroup>
<tbody>
<tr>
<td class="parameter_name"><p>event</p></td>
<td class="parameter_description"><p>a <span class="type">GdkEvent</span></p></td>
<td class="parameter_annotations"> </td>
</tr>
<tr>
<td class="parameter_name"><p>delta_x</p></td>
<td class="parameter_description"><p>return location for X delta. </p></td>
<td class="parameter_annotations"><span class="annotation">[<acronym title="Parameter for returning results. Default is transfer full."><span class="acronym">out</span></acronym>]</span></td>
</tr>
<tr>
<td class="parameter_name"><p>delta_y</p></td>
<td class="parameter_description"><p>return location for Y delta. </p></td>
<td class="parameter_annotations"><span class="annotation">[<acronym title="Parameter for returning results. Default is transfer full."><span class="acronym">out</span></acronym>]</span></td>
</tr>
</tbody>
</table></div>
</div>
<div class="refsect3">
<a name="gdk-event-get-scroll-deltas.returns"></a><h4>Returns</h4>
<p> <code class="literal">TRUE</code> if the event contains smooth scroll information
and <code class="literal">FALSE</code> otherwise</p>
</div>
<p class="since">Since: <a class="link" href="api-index-3-4.html#api-index-3.4">3.4</a></p>
</div>
<hr>
<div class="refsect2">
<a name="gdk-event-is-scroll-stop-event"></a><h3>gdk_event_is_scroll_stop_event ()</h3>
<pre class="programlisting"><span class="returnvalue">gboolean</span>
gdk_event_is_scroll_stop_event (<em class="parameter"><code>const <span class="type">GdkEvent</span> *event</code></em>);</pre>
<p>Check whether a scroll event is a stop scroll event. Scroll sequences
with smooth scroll information may provide a stop scroll event once the
interaction with the device finishes, e.g. by lifting a finger. This
stop scroll event is the signal that a widget may trigger kinetic
scrolling based on the current velocity.</p>
<p>Stop scroll events always have a a delta of 0/0.</p>
<div class="refsect3">
<a name="gdk-event-is-scroll-stop-event.parameters"></a><h4>Parameters</h4>
<div class="informaltable"><table class="informaltable" width="100%" border="0">
<colgroup>
<col width="150px" class="parameters_name">
<col class="parameters_description">
<col width="200px" class="parameters_annotations">
</colgroup>
<tbody><tr>
<td class="parameter_name"><p>event</p></td>
<td class="parameter_description"><p>a <span class="type">GdkEvent</span></p></td>
<td class="parameter_annotations"> </td>
</tr></tbody>
</table></div>
</div>
<div class="refsect3">
<a name="gdk-event-is-scroll-stop-event.returns"></a><h4>Returns</h4>
<p> <code class="literal">TRUE</code> if the event is a scroll stop event</p>
</div>
<p class="since">Since: <a class="link" href="api-index-3-20.html#api-index-3.20">3.20</a></p>
</div>
<hr>
<div class="refsect2">
<a name="gdk-event-get-state"></a><h3>gdk_event_get_state ()</h3>
<pre class="programlisting"><span class="returnvalue">gboolean</span>
gdk_event_get_state (<em class="parameter"><code>const <span class="type">GdkEvent</span> *event</code></em>,
<em class="parameter"><code><span class="type">GdkModifierType</span> *state</code></em>);</pre>
<p>If the event contains a “state” field, puts that field in <em class="parameter"><code>state</code></em>
. Otherwise
stores an empty state (0). Returns <code class="literal">TRUE</code> if there was a state field
in the event. <em class="parameter"><code>event</code></em>
may be <code class="literal">NULL</code>, in which case its treated
as if the event had no state field.</p>
<div class="refsect3">
<a name="gdk-event-get-state.parameters"></a><h4>Parameters</h4>
<div class="informaltable"><table class="informaltable" width="100%" border="0">
<colgroup>
<col width="150px" class="parameters_name">
<col class="parameters_description">
<col width="200px" class="parameters_annotations">
</colgroup>
<tbody>
<tr>
<td class="parameter_name"><p>event</p></td>
<td class="parameter_description"><p>a <span class="type">GdkEvent</span> or <code class="literal">NULL</code>. </p></td>
<td class="parameter_annotations"><span class="annotation">[<acronym title="NULL is OK, both for passing and for returning."><span class="acronym">allow-none</span></acronym>]</span></td>
</tr>
<tr>
<td class="parameter_name"><p>state</p></td>
<td class="parameter_description"><p>return location for state. </p></td>
<td class="parameter_annotations"><span class="annotation">[<acronym title="Parameter for returning results. Default is transfer full."><span class="acronym">out</span></acronym>]</span></td>
</tr>
</tbody>
</table></div>
</div>
<div class="refsect3">
<a name="gdk-event-get-state.returns"></a><h4>Returns</h4>
<p> <code class="literal">TRUE</code> if there was a state field in the event </p>
</div>
</div>
<hr>
<div class="refsect2">
<a name="gdk-event-get-time"></a><h3>gdk_event_get_time ()</h3>
<pre class="programlisting"><span class="returnvalue">guint32</span>
gdk_event_get_time (<em class="parameter"><code>const <span class="type">GdkEvent</span> *event</code></em>);</pre>
<p>Returns the time stamp from <em class="parameter"><code>event</code></em>
, if there is one; otherwise
returns <span class="type">GDK_CURRENT_TIME</span>. If <em class="parameter"><code>event</code></em>
is <code class="literal">NULL</code>, returns <span class="type">GDK_CURRENT_TIME</span>.</p>
<div class="refsect3">
<a name="gdk-event-get-time.parameters"></a><h4>Parameters</h4>
<div class="informaltable"><table class="informaltable" width="100%" border="0">
<colgroup>
<col width="150px" class="parameters_name">
<col class="parameters_description">
<col width="200px" class="parameters_annotations">
</colgroup>
<tbody><tr>
<td class="parameter_name"><p>event</p></td>
<td class="parameter_description"><p>a <span class="type">GdkEvent</span></p></td>
<td class="parameter_annotations"> </td>
</tr></tbody>
</table></div>
</div>
<div class="refsect3">
<a name="gdk-event-get-time.returns"></a><h4>Returns</h4>
<p> time stamp field from <em class="parameter"><code>event</code></em>
</p>
</div>
</div>
<hr>
<div class="refsect2">
<a name="gdk-event-get-window"></a><h3>gdk_event_get_window ()</h3>
<pre class="programlisting"><a class="link" href="gdk3-Windows.html#GdkWindow"><span class="returnvalue">GdkWindow</span></a> *
gdk_event_get_window (<em class="parameter"><code>const <span class="type">GdkEvent</span> *event</code></em>);</pre>
<p>Extracts the <a class="link" href="gdk3-Windows.html#GdkWindow"><span class="type">GdkWindow</span></a> associated with an event.</p>
<div class="refsect3">
<a name="gdk-event-get-window.parameters"></a><h4>Parameters</h4>
<div class="informaltable"><table class="informaltable" width="100%" border="0">
<colgroup>
<col width="150px" class="parameters_name">
<col class="parameters_description">
<col width="200px" class="parameters_annotations">
</colgroup>
<tbody><tr>
<td class="parameter_name"><p>event</p></td>
<td class="parameter_description"><p>a <span class="type">GdkEvent</span></p></td>
<td class="parameter_annotations"> </td>
</tr></tbody>
</table></div>
</div>
<div class="refsect3">
<a name="gdk-event-get-window.returns"></a><h4>Returns</h4>
<p>The <a class="link" href="gdk3-Windows.html#GdkWindow"><span class="type">GdkWindow</span></a> associated with the event. </p>
<p><span class="annotation">[<acronym title="Don't free data after the code is done."><span class="acronym">transfer none</span></acronym>]</span></p>
</div>
<p class="since">Since: <a class="link" href="api-index-3-10.html#api-index-3.10">3.10</a></p>
</div>
<hr>
<div class="refsect2">
<a name="gdk-event-get-event-type"></a><h3>gdk_event_get_event_type ()</h3>
<pre class="programlisting"><span class="returnvalue">GdkEventType</span>
gdk_event_get_event_type (<em class="parameter"><code>const <span class="type">GdkEvent</span> *event</code></em>);</pre>
<p>Retrieves the type of the event.</p>
<div class="refsect3">
<a name="gdk-event-get-event-type.parameters"></a><h4>Parameters</h4>
<div class="informaltable"><table class="informaltable" width="100%" border="0">
<colgroup>
<col width="150px" class="parameters_name">
<col class="parameters_description">
<col width="200px" class="parameters_annotations">
</colgroup>
<tbody><tr>
<td class="parameter_name"><p>event</p></td>
<td class="parameter_description"><p>a <span class="type">GdkEvent</span></p></td>
<td class="parameter_annotations"> </td>
</tr></tbody>
</table></div>
</div>
<div class="refsect3">
<a name="gdk-event-get-event-type.returns"></a><h4>Returns</h4>
<p> a <span class="type">GdkEventType</span></p>
</div>
<p class="since">Since: <a class="link" href="api-index-3-10.html#api-index-3.10">3.10</a></p>
</div>
<hr>
<div class="refsect2">
<a name="gdk-event-get-event-sequence"></a><h3>gdk_event_get_event_sequence ()</h3>
<pre class="programlisting"><span class="returnvalue">GdkEventSequence</span> *
gdk_event_get_event_sequence (<em class="parameter"><code>const <span class="type">GdkEvent</span> *event</code></em>);</pre>
<p>If <em class="parameter"><code>event</code></em>
if of type <code class="literal">GDK_TOUCH_BEGIN</code>, <code class="literal">GDK_TOUCH_UPDATE</code>,
<code class="literal">GDK_TOUCH_END</code> or <code class="literal">GDK_TOUCH_CANCEL</code>, returns the <span class="type">GdkEventSequence</span>
to which the event belongs. Otherwise, return <code class="literal">NULL</code>.</p>
<div class="refsect3">
<a name="gdk-event-get-event-sequence.parameters"></a><h4>Parameters</h4>
<div class="informaltable"><table class="informaltable" width="100%" border="0">
<colgroup>
<col width="150px" class="parameters_name">
<col class="parameters_description">
<col width="200px" class="parameters_annotations">
</colgroup>
<tbody><tr>
<td class="parameter_name"><p>event</p></td>
<td class="parameter_description"><p>a <span class="type">GdkEvent</span></p></td>
<td class="parameter_annotations"> </td>
</tr></tbody>
</table></div>
</div>
<div class="refsect3">
<a name="gdk-event-get-event-sequence.returns"></a><h4>Returns</h4>
<p>the event sequence that the event belongs to. </p>
<p><span class="annotation">[<acronym title="Don't free data after the code is done."><span class="acronym">transfer none</span></acronym>]</span></p>
</div>
<p class="since">Since: <a class="link" href="api-index-3-4.html#api-index-3.4">3.4</a></p>
</div>
<hr>
<div class="refsect2">
<a name="gdk-event-request-motions"></a><h3>gdk_event_request_motions ()</h3>
<pre class="programlisting"><span class="returnvalue">void</span>
gdk_event_request_motions (<em class="parameter"><code>const <span class="type">GdkEventMotion</span> *event</code></em>);</pre>
<p>Request more motion notifies if <em class="parameter"><code>event</code></em>
is a motion notify hint event.</p>
<p>This function should be used instead of <a class="link" href="gdk3-Windows.html#gdk-window-get-pointer" title="gdk_window_get_pointer ()"><code class="function">gdk_window_get_pointer()</code></a> to
request further motion notifies, because it also works for extension
events where motion notifies are provided for devices other than the
core pointer. Coordinate extraction, processing and requesting more
motion events from a <code class="literal">GDK_MOTION_NOTIFY</code> event usually works like this:</p>
<div class="informalexample">
<table class="listing_frame" border="0" cellpadding="0" cellspacing="0">
<tbody>
<tr>
<td class="listing_lines" align="right"><pre>1
2
3
4
5
6
7</pre></td>
<td class="listing_code"><pre class="programlisting"><span class="p">{</span>
<span class="c1">// motion_event handler</span>
<span class="n">x</span> <span class="o">=</span> <span class="n">motion_event</span><span class="o">-&gt;</span><span class="n">x</span><span class="p">;</span>
<span class="n">y</span> <span class="o">=</span> <span class="n">motion_event</span><span class="o">-&gt;</span><span class="n">y</span><span class="p">;</span>
<span class="c1">// handle (x,y) motion</span>
<span class="n">gdk_event_request_motions</span> <span class="p">(</span><span class="n">motion_event</span><span class="p">);</span> <span class="c1">// handles is_hint events</span>
<span class="p">}</span></pre></td>
</tr>
</tbody>
</table>
</div>
<p></p>
<div class="refsect3">
<a name="gdk-event-request-motions.parameters"></a><h4>Parameters</h4>
<div class="informaltable"><table class="informaltable" width="100%" border="0">
<colgroup>
<col width="150px" class="parameters_name">
<col class="parameters_description">
<col width="200px" class="parameters_annotations">
</colgroup>
<tbody><tr>
<td class="parameter_name"><p>event</p></td>
<td class="parameter_description"><p>a valid <span class="type">GdkEvent</span></p></td>
<td class="parameter_annotations"> </td>
</tr></tbody>
</table></div>
</div>
<p class="since">Since: 2.12</p>
</div>
<hr>
<div class="refsect2">
<a name="gdk-events-get-angle"></a><h3>gdk_events_get_angle ()</h3>
<pre class="programlisting"><span class="returnvalue">gboolean</span>
gdk_events_get_angle (<em class="parameter"><code><span class="type">GdkEvent</span> *event1</code></em>,
<em class="parameter"><code><span class="type">GdkEvent</span> *event2</code></em>,
<em class="parameter"><code><span class="type">gdouble</span> *angle</code></em>);</pre>
<p>If both events contain X/Y information, this function will return <code class="literal">TRUE</code>
and return in <em class="parameter"><code>angle</code></em>
the relative angle from <em class="parameter"><code>event1</code></em>
to <em class="parameter"><code>event2</code></em>
. The rotation
direction for positive angles is from the positive X axis towards the positive
Y axis.</p>
<div class="refsect3">
<a name="gdk-events-get-angle.parameters"></a><h4>Parameters</h4>
<div class="informaltable"><table class="informaltable" width="100%" border="0">
<colgroup>
<col width="150px" class="parameters_name">
<col class="parameters_description">
<col width="200px" class="parameters_annotations">
</colgroup>
<tbody>
<tr>
<td class="parameter_name"><p>event1</p></td>
<td class="parameter_description"><p>first <span class="type">GdkEvent</span></p></td>
<td class="parameter_annotations"> </td>
</tr>
<tr>
<td class="parameter_name"><p>event2</p></td>
<td class="parameter_description"><p>second <span class="type">GdkEvent</span></p></td>
<td class="parameter_annotations"> </td>
</tr>
<tr>
<td class="parameter_name"><p>angle</p></td>
<td class="parameter_description"><p>return location for the relative angle between both events. </p></td>
<td class="parameter_annotations"><span class="annotation">[<acronym title="Parameter for returning results. Default is transfer full."><span class="acronym">out</span></acronym>]</span></td>
</tr>
</tbody>
</table></div>
</div>
<div class="refsect3">
<a name="gdk-events-get-angle.returns"></a><h4>Returns</h4>
<p> <code class="literal">TRUE</code> if the angle could be calculated.</p>
</div>
<p class="since">Since: <a class="link" href="api-index-3-0.html#api-index-3.0">3.0</a></p>
</div>
<hr>
<div class="refsect2">
<a name="gdk-events-get-center"></a><h3>gdk_events_get_center ()</h3>
<pre class="programlisting"><span class="returnvalue">gboolean</span>
gdk_events_get_center (<em class="parameter"><code><span class="type">GdkEvent</span> *event1</code></em>,
<em class="parameter"><code><span class="type">GdkEvent</span> *event2</code></em>,
<em class="parameter"><code><span class="type">gdouble</span> *x</code></em>,
<em class="parameter"><code><span class="type">gdouble</span> *y</code></em>);</pre>
<p>If both events contain X/Y information, the center of both coordinates
will be returned in <em class="parameter"><code>x</code></em>
and <em class="parameter"><code>y</code></em>
.</p>
<div class="refsect3">
<a name="gdk-events-get-center.parameters"></a><h4>Parameters</h4>
<div class="informaltable"><table class="informaltable" width="100%" border="0">
<colgroup>
<col width="150px" class="parameters_name">
<col class="parameters_description">
<col width="200px" class="parameters_annotations">
</colgroup>
<tbody>
<tr>
<td class="parameter_name"><p>event1</p></td>
<td class="parameter_description"><p>first <span class="type">GdkEvent</span></p></td>
<td class="parameter_annotations"> </td>
</tr>
<tr>
<td class="parameter_name"><p>event2</p></td>
<td class="parameter_description"><p>second <span class="type">GdkEvent</span></p></td>
<td class="parameter_annotations"> </td>
</tr>
<tr>
<td class="parameter_name"><p>x</p></td>
<td class="parameter_description"><p>return location for the X coordinate of the center. </p></td>
<td class="parameter_annotations"><span class="annotation">[<acronym title="Parameter for returning results. Default is transfer full."><span class="acronym">out</span></acronym>]</span></td>
</tr>
<tr>
<td class="parameter_name"><p>y</p></td>
<td class="parameter_description"><p>return location for the Y coordinate of the center. </p></td>
<td class="parameter_annotations"><span class="annotation">[<acronym title="Parameter for returning results. Default is transfer full."><span class="acronym">out</span></acronym>]</span></td>
</tr>
</tbody>
</table></div>
</div>
<div class="refsect3">
<a name="gdk-events-get-center.returns"></a><h4>Returns</h4>
<p> <code class="literal">TRUE</code> if the center could be calculated.</p>
</div>
<p class="since">Since: <a class="link" href="api-index-3-0.html#api-index-3.0">3.0</a></p>
</div>
<hr>
<div class="refsect2">
<a name="gdk-events-get-distance"></a><h3>gdk_events_get_distance ()</h3>
<pre class="programlisting"><span class="returnvalue">gboolean</span>
gdk_events_get_distance (<em class="parameter"><code><span class="type">GdkEvent</span> *event1</code></em>,
<em class="parameter"><code><span class="type">GdkEvent</span> *event2</code></em>,
<em class="parameter"><code><span class="type">gdouble</span> *distance</code></em>);</pre>
<p>If both events have X/Y information, the distance between both coordinates
(as in a straight line going from <em class="parameter"><code>event1</code></em>
to <em class="parameter"><code>event2</code></em>
) will be returned.</p>
<div class="refsect3">
<a name="gdk-events-get-distance.parameters"></a><h4>Parameters</h4>
<div class="informaltable"><table class="informaltable" width="100%" border="0">
<colgroup>
<col width="150px" class="parameters_name">
<col class="parameters_description">
<col width="200px" class="parameters_annotations">
</colgroup>
<tbody>
<tr>
<td class="parameter_name"><p>event1</p></td>
<td class="parameter_description"><p>first <span class="type">GdkEvent</span></p></td>
<td class="parameter_annotations"> </td>
</tr>
<tr>
<td class="parameter_name"><p>event2</p></td>
<td class="parameter_description"><p>second <span class="type">GdkEvent</span></p></td>
<td class="parameter_annotations"> </td>
</tr>
<tr>
<td class="parameter_name"><p>distance</p></td>
<td class="parameter_description"><p>return location for the distance. </p></td>
<td class="parameter_annotations"><span class="annotation">[<acronym title="Parameter for returning results. Default is transfer full."><span class="acronym">out</span></acronym>]</span></td>
</tr>
</tbody>
</table></div>
</div>
<div class="refsect3">
<a name="gdk-events-get-distance.returns"></a><h4>Returns</h4>
<p> <code class="literal">TRUE</code> if the distance could be calculated.</p>
</div>
<p class="since">Since: <a class="link" href="api-index-3-0.html#api-index-3.0">3.0</a></p>
</div>
<hr>
<div class="refsect2">
<a name="gdk-event-triggers-context-menu"></a><h3>gdk_event_triggers_context_menu ()</h3>
<pre class="programlisting"><span class="returnvalue">gboolean</span>
gdk_event_triggers_context_menu (<em class="parameter"><code>const <span class="type">GdkEvent</span> *event</code></em>);</pre>
<p>This function returns whether a <span class="type">GdkEventButton</span> should trigger a
context menu, according to platform conventions. The right mouse
button always triggers context menus. Additionally, if
<a class="link" href="gdk3-Keyboard-Handling.html#gdk-keymap-get-modifier-mask" title="gdk_keymap_get_modifier_mask ()"><code class="function">gdk_keymap_get_modifier_mask()</code></a> returns a non-0 mask for
<code class="literal">GDK_MODIFIER_INTENT_CONTEXT_MENU</code>, then the left mouse button will
also trigger a context menu if this modifier is pressed.</p>
<p>This function should always be used instead of simply checking for
event-&gt;button == <code class="literal">GDK_BUTTON_SECONDARY</code>.</p>
<div class="refsect3">
<a name="gdk-event-triggers-context-menu.parameters"></a><h4>Parameters</h4>
<div class="informaltable"><table class="informaltable" width="100%" border="0">
<colgroup>
<col width="150px" class="parameters_name">
<col class="parameters_description">
<col width="200px" class="parameters_annotations">
</colgroup>
<tbody><tr>
<td class="parameter_name"><p>event</p></td>
<td class="parameter_description"><p>a <span class="type">GdkEvent</span>, currently only button events are meaningful values</p></td>
<td class="parameter_annotations"> </td>
</tr></tbody>
</table></div>
</div>
<div class="refsect3">
<a name="gdk-event-triggers-context-menu.returns"></a><h4>Returns</h4>
<p> <code class="literal">TRUE</code> if the event should trigger a context menu.</p>
</div>
<p class="since">Since: <a class="link" href="api-index-3-4.html#api-index-3.4">3.4</a></p>
</div>
<hr>
<div class="refsect2">
<a name="gdk-event-get-seat"></a><h3>gdk_event_get_seat ()</h3>
<pre class="programlisting"><a class="link" href="GdkSeat.html" title="GdkSeat"><span class="returnvalue">GdkSeat</span></a> *
gdk_event_get_seat (<em class="parameter"><code>const <span class="type">GdkEvent</span> *event</code></em>);</pre>
<p>Returns the <a class="link" href="GdkSeat.html" title="GdkSeat"><span class="type">GdkSeat</span></a> this event was generated for.</p>
<div class="refsect3">
<a name="gdk-event-get-seat.parameters"></a><h4>Parameters</h4>
<div class="informaltable"><table class="informaltable" width="100%" border="0">
<colgroup>
<col width="150px" class="parameters_name">
<col class="parameters_description">
<col width="200px" class="parameters_annotations">
</colgroup>
<tbody><tr>
<td class="parameter_name"><p>event</p></td>
<td class="parameter_description"><p>a <span class="type">GdkEvent</span></p></td>
<td class="parameter_annotations"> </td>
</tr></tbody>
</table></div>
</div>
<div class="refsect3">
<a name="gdk-event-get-seat.returns"></a><h4>Returns</h4>
<p>The <a class="link" href="GdkSeat.html" title="GdkSeat"><span class="type">GdkSeat</span></a> of this event. </p>
<p><span class="annotation">[<acronym title="Don't free data after the code is done."><span class="acronym">transfer none</span></acronym>]</span></p>
</div>
<p class="since">Since: <a class="link" href="api-index-3-20.html#api-index-3.20">3.20</a></p>
</div>
<hr>
<div class="refsect2">
<a name="gdk-event-get-scancode"></a><h3>gdk_event_get_scancode ()</h3>
<pre class="programlisting"><span class="returnvalue">int</span>
gdk_event_get_scancode (<em class="parameter"><code><span class="type">GdkEvent</span> *event</code></em>);</pre>
<p>Gets the keyboard low-level scancode of a key event.</p>
<p>This is usually hardware_keycode. On Windows this is the high
word of WM_KEY{DOWN,UP} lParam which contains the scancode and
some extended flags.</p>
<div class="refsect3">
<a name="gdk-event-get-scancode.parameters"></a><h4>Parameters</h4>
<div class="informaltable"><table class="informaltable" width="100%" border="0">
<colgroup>
<col width="150px" class="parameters_name">
<col class="parameters_description">
<col width="200px" class="parameters_annotations">
</colgroup>
<tbody><tr>
<td class="parameter_name"><p>event</p></td>
<td class="parameter_description"><p>a <span class="type">GdkEvent</span></p></td>
<td class="parameter_annotations"> </td>
</tr></tbody>
</table></div>
</div>
<div class="refsect3">
<a name="gdk-event-get-scancode.returns"></a><h4>Returns</h4>
<p> The associated keyboard scancode or 0</p>
</div>
<p class="since">Since: <a class="link" href="api-index-3-22.html#api-index-3.22">3.22</a></p>
</div>
<hr>
<div class="refsect2">
<a name="gdk-event-get-pointer-emulated"></a><h3>gdk_event_get_pointer_emulated ()</h3>
<pre class="programlisting"><span class="returnvalue">gboolean</span>
gdk_event_get_pointer_emulated (<em class="parameter"><code><span class="type">GdkEvent</span> *event</code></em>);</pre>
<p>Returns whether this event is an 'emulated' pointer event (typically
from a touch event), as opposed to a real one.</p>
<div class="refsect3">
<a name="gdk-event-get-pointer-emulated.returns"></a><h4>Returns</h4>
<p> <code class="literal">TRUE</code> if this event is emulated</p>
</div>
<p class="since">Since: <a class="link" href="api-index-3-22.html#api-index-3.22">3.22</a></p>
</div>
<hr>
<div class="refsect2">
<a name="gdk-event-handler-set"></a><h3>gdk_event_handler_set ()</h3>
<pre class="programlisting"><span class="returnvalue">void</span>
gdk_event_handler_set (<em class="parameter"><code><a class="link" href="gdk3-Events.html#GdkEventFunc" title="GdkEventFunc ()"><span class="type">GdkEventFunc</span></a> func</code></em>,
<em class="parameter"><code><span class="type">gpointer</span> data</code></em>,
<em class="parameter"><code><span class="type">GDestroyNotify</span> notify</code></em>);</pre>
<p>Sets the function to call to handle all events from GDK.</p>
<p>Note that GTK+ uses this to install its own event handler, so it is
usually not useful for GTK+ applications. (Although an application
can call this function then call <a href="https://developer.gnome.org/gtk4/gtk4-General.html#gtk-main-do-event"><code class="function">gtk_main_do_event()</code></a> to pass
events to GTK+.)</p>
<div class="refsect3">
<a name="gdk-event-handler-set.parameters"></a><h4>Parameters</h4>
<div class="informaltable"><table class="informaltable" width="100%" border="0">
<colgroup>
<col width="150px" class="parameters_name">
<col class="parameters_description">
<col width="200px" class="parameters_annotations">
</colgroup>
<tbody>
<tr>
<td class="parameter_name"><p>func</p></td>
<td class="parameter_description"><p>the function to call to handle events from GDK.</p></td>
<td class="parameter_annotations"> </td>
</tr>
<tr>
<td class="parameter_name"><p>data</p></td>
<td class="parameter_description"><p>user data to pass to the function. </p></td>
<td class="parameter_annotations"> </td>
</tr>
<tr>
<td class="parameter_name"><p>notify</p></td>
<td class="parameter_description"><p>the function to call when the handler function is removed, i.e. when
<a class="link" href="gdk3-Events.html#gdk-event-handler-set" title="gdk_event_handler_set ()"><code class="function">gdk_event_handler_set()</code></a> is called with another event handler.</p></td>
<td class="parameter_annotations"> </td>
</tr>
</tbody>
</table></div>
</div>
</div>
<hr>
<div class="refsect2">
<a name="GdkEventFunc"></a><h3>GdkEventFunc ()</h3>
<pre class="programlisting"><span class="returnvalue">void</span>
<span class="c_punctuation">(</span>*GdkEventFunc<span class="c_punctuation">)</span> (<em class="parameter"><code><span class="type">GdkEvent</span> *event</code></em>,
<em class="parameter"><code><span class="type">gpointer</span> data</code></em>);</pre>
<p>Specifies the type of function passed to <a class="link" href="gdk3-Events.html#gdk-event-handler-set" title="gdk_event_handler_set ()"><code class="function">gdk_event_handler_set()</code></a> to
handle all GDK events.</p>
<div class="refsect3">
<a name="GdkEventFunc.parameters"></a><h4>Parameters</h4>
<div class="informaltable"><table class="informaltable" width="100%" border="0">
<colgroup>
<col width="150px" class="parameters_name">
<col class="parameters_description">
<col width="200px" class="parameters_annotations">
</colgroup>
<tbody>
<tr>
<td class="parameter_name"><p>event</p></td>
<td class="parameter_description"><p>the <span class="type">GdkEvent</span> to process.</p></td>
<td class="parameter_annotations"> </td>
</tr>
<tr>
<td class="parameter_name"><p>data</p></td>
<td class="parameter_description"><p>user data set when the event handler was installed with
<a class="link" href="gdk3-Events.html#gdk-event-handler-set" title="gdk_event_handler_set ()"><code class="function">gdk_event_handler_set()</code></a>. </p></td>
<td class="parameter_annotations"><span class="annotation">[<acronym title="This parameter is a 'user_data', for callbacks; many bindings can pass NULL here."><span class="acronym">closure</span></acronym>]</span></td>
</tr>
</tbody>
</table></div>
</div>
</div>
<hr>
<div class="refsect2">
<a name="gdk-get-show-events"></a><h3>gdk_get_show_events ()</h3>
<pre class="programlisting"><span class="returnvalue">gboolean</span>
gdk_get_show_events (<em class="parameter"><code><span class="type">void</span></code></em>);</pre>
<p>Gets whether event debugging output is enabled.</p>
<div class="refsect3">
<a name="gdk-get-show-events.returns"></a><h4>Returns</h4>
<p> <code class="literal">TRUE</code> if event debugging output is enabled.</p>
</div>
</div>
<hr>
<div class="refsect2">
<a name="gdk-set-show-events"></a><h3>gdk_set_show_events ()</h3>
<pre class="programlisting"><span class="returnvalue">void</span>
gdk_set_show_events (<em class="parameter"><code><span class="type">gboolean</span> show_events</code></em>);</pre>
<p>Sets whether a trace of received events is output.
Note that GTK+ must be compiled with debugging (that is,
configured using the <code class="literal">--enable-debug</code> option)
to use this option.</p>
<div class="refsect3">
<a name="gdk-set-show-events.parameters"></a><h4>Parameters</h4>
<div class="informaltable"><table class="informaltable" width="100%" border="0">
<colgroup>
<col width="150px" class="parameters_name">
<col class="parameters_description">
<col width="200px" class="parameters_annotations">
</colgroup>
<tbody><tr>
<td class="parameter_name"><p>show_events</p></td>
<td class="parameter_description"><p><code class="literal">TRUE</code> to output event debugging information.</p></td>
<td class="parameter_annotations"> </td>
</tr></tbody>
</table></div>
</div>
</div>
<hr>
<div class="refsect2">
<a name="gdk-event-set-screen"></a><h3>gdk_event_set_screen ()</h3>
<pre class="programlisting"><span class="returnvalue">void</span>
gdk_event_set_screen (<em class="parameter"><code><span class="type">GdkEvent</span> *event</code></em>,
<em class="parameter"><code><a class="link" href="GdkScreen.html" title="GdkScreen"><span class="type">GdkScreen</span></a> *screen</code></em>);</pre>
<p>Sets the screen for <em class="parameter"><code>event</code></em>
to <em class="parameter"><code>screen</code></em>
. The event must
have been allocated by GTK+, for instance, by
<a class="link" href="gdk3-Events.html#gdk-event-copy" title="gdk_event_copy ()"><code class="function">gdk_event_copy()</code></a>.</p>
<div class="refsect3">
<a name="gdk-event-set-screen.parameters"></a><h4>Parameters</h4>
<div class="informaltable"><table class="informaltable" width="100%" border="0">
<colgroup>
<col width="150px" class="parameters_name">
<col class="parameters_description">
<col width="200px" class="parameters_annotations">
</colgroup>
<tbody>
<tr>
<td class="parameter_name"><p>event</p></td>
<td class="parameter_description"><p>a <span class="type">GdkEvent</span></p></td>
<td class="parameter_annotations"> </td>
</tr>
<tr>
<td class="parameter_name"><p>screen</p></td>
<td class="parameter_description"><p>a <a class="link" href="GdkScreen.html" title="GdkScreen"><span class="type">GdkScreen</span></a></p></td>
<td class="parameter_annotations"> </td>
</tr>
</tbody>
</table></div>
</div>
<p class="since">Since: 2.2</p>
</div>
<hr>
<div class="refsect2">
<a name="gdk-event-get-screen"></a><h3>gdk_event_get_screen ()</h3>
<pre class="programlisting"><a class="link" href="GdkScreen.html" title="GdkScreen"><span class="returnvalue">GdkScreen</span></a> *
gdk_event_get_screen (<em class="parameter"><code>const <span class="type">GdkEvent</span> *event</code></em>);</pre>
<p>Returns the screen for the event. The screen is
typically the screen for <code class="literal">event-&gt;any.window</code>, but
for events such as mouse events, it is the screen
where the pointer was when the event occurs -
that is, the screen which has the root window
to which <code class="literal">event-&gt;motion.x_root</code> and
<code class="literal">event-&gt;motion.y_root</code> are relative.</p>
<div class="refsect3">
<a name="gdk-event-get-screen.parameters"></a><h4>Parameters</h4>
<div class="informaltable"><table class="informaltable" width="100%" border="0">
<colgroup>
<col width="150px" class="parameters_name">
<col class="parameters_description">
<col width="200px" class="parameters_annotations">
</colgroup>
<tbody><tr>
<td class="parameter_name"><p>event</p></td>
<td class="parameter_description"><p>a <span class="type">GdkEvent</span></p></td>
<td class="parameter_annotations"> </td>
</tr></tbody>
</table></div>
</div>
<div class="refsect3">
<a name="gdk-event-get-screen.returns"></a><h4>Returns</h4>
<p>the screen for the event. </p>
<p><span class="annotation">[<acronym title="Don't free data after the code is done."><span class="acronym">transfer none</span></acronym>]</span></p>
</div>
<p class="since">Since: 2.2</p>
</div>
<hr>
<div class="refsect2">
<a name="gdk-event-get-device"></a><h3>gdk_event_get_device ()</h3>
<pre class="programlisting"><a class="link" href="GdkDevice.html" title="GdkDevice"><span class="returnvalue">GdkDevice</span></a> *
gdk_event_get_device (<em class="parameter"><code>const <span class="type">GdkEvent</span> *event</code></em>);</pre>
<p>If the event contains a “device” field, this function will return
it, else it will return <code class="literal">NULL</code>.</p>
<div class="refsect3">
<a name="gdk-event-get-device.parameters"></a><h4>Parameters</h4>
<div class="informaltable"><table class="informaltable" width="100%" border="0">
<colgroup>
<col width="150px" class="parameters_name">
<col class="parameters_description">
<col width="200px" class="parameters_annotations">
</colgroup>
<tbody><tr>
<td class="parameter_name"><p>event</p></td>
<td class="parameter_description"><p>a <span class="type">GdkEvent</span>.</p></td>
<td class="parameter_annotations"> </td>
</tr></tbody>
</table></div>
</div>
<div class="refsect3">
<a name="gdk-event-get-device.returns"></a><h4>Returns</h4>
<p>a <a class="link" href="GdkDevice.html" title="GdkDevice"><span class="type">GdkDevice</span></a>, or <code class="literal">NULL</code>. </p>
<p><span class="annotation">[<acronym title="NULL may be passed as the value in, out, in-out; or as a return value."><span class="acronym">nullable</span></acronym>][<acronym title="Don't free data after the code is done."><span class="acronym">transfer none</span></acronym>]</span></p>
</div>
<p class="since">Since: <a class="link" href="api-index-3-0.html#api-index-3.0">3.0</a></p>
</div>
<hr>
<div class="refsect2">
<a name="gdk-event-set-device"></a><h3>gdk_event_set_device ()</h3>
<pre class="programlisting"><span class="returnvalue">void</span>
gdk_event_set_device (<em class="parameter"><code><span class="type">GdkEvent</span> *event</code></em>,
<em class="parameter"><code><a class="link" href="GdkDevice.html" title="GdkDevice"><span class="type">GdkDevice</span></a> *device</code></em>);</pre>
<p>Sets the device for <em class="parameter"><code>event</code></em>
to <em class="parameter"><code>device</code></em>
. The event must
have been allocated by GTK+, for instance, by
<a class="link" href="gdk3-Events.html#gdk-event-copy" title="gdk_event_copy ()"><code class="function">gdk_event_copy()</code></a>.</p>
<div class="refsect3">
<a name="gdk-event-set-device.parameters"></a><h4>Parameters</h4>
<div class="informaltable"><table class="informaltable" width="100%" border="0">
<colgroup>
<col width="150px" class="parameters_name">
<col class="parameters_description">
<col width="200px" class="parameters_annotations">
</colgroup>
<tbody>
<tr>
<td class="parameter_name"><p>event</p></td>
<td class="parameter_description"><p>a <span class="type">GdkEvent</span></p></td>
<td class="parameter_annotations"> </td>
</tr>
<tr>
<td class="parameter_name"><p>device</p></td>
<td class="parameter_description"><p>a <a class="link" href="GdkDevice.html" title="GdkDevice"><span class="type">GdkDevice</span></a></p></td>
<td class="parameter_annotations"> </td>
</tr>
</tbody>
</table></div>
</div>
<p class="since">Since: <a class="link" href="api-index-3-0.html#api-index-3.0">3.0</a></p>
</div>
<hr>
<div class="refsect2">
<a name="gdk-event-get-source-device"></a><h3>gdk_event_get_source_device ()</h3>
<pre class="programlisting"><a class="link" href="GdkDevice.html" title="GdkDevice"><span class="returnvalue">GdkDevice</span></a> *
gdk_event_get_source_device (<em class="parameter"><code>const <span class="type">GdkEvent</span> *event</code></em>);</pre>
<p>This function returns the hardware (slave) <a class="link" href="GdkDevice.html" title="GdkDevice"><span class="type">GdkDevice</span></a> that has
triggered the event, falling back to the virtual (master) device
(as in <a class="link" href="gdk3-Events.html#gdk-event-get-device" title="gdk_event_get_device ()"><code class="function">gdk_event_get_device()</code></a>) if the event wasnt caused by
interaction with a hardware device. This may happen for example
in synthesized crossing events after a <a class="link" href="gdk3-Windows.html#GdkWindow"><span class="type">GdkWindow</span></a> updates its
geometry or a grab is acquired/released.</p>
<p>If the event does not contain a device field, this function will
return <code class="literal">NULL</code>.</p>
<div class="refsect3">
<a name="gdk-event-get-source-device.parameters"></a><h4>Parameters</h4>
<div class="informaltable"><table class="informaltable" width="100%" border="0">
<colgroup>
<col width="150px" class="parameters_name">
<col class="parameters_description">
<col width="200px" class="parameters_annotations">
</colgroup>
<tbody><tr>
<td class="parameter_name"><p>event</p></td>
<td class="parameter_description"><p>a <span class="type">GdkEvent</span></p></td>
<td class="parameter_annotations"> </td>
</tr></tbody>
</table></div>
</div>
<div class="refsect3">
<a name="gdk-event-get-source-device.returns"></a><h4>Returns</h4>
<p>a <a class="link" href="GdkDevice.html" title="GdkDevice"><span class="type">GdkDevice</span></a>, or <code class="literal">NULL</code>. </p>
<p><span class="annotation">[<acronym title="NULL may be passed as the value in, out, in-out; or as a return value."><span class="acronym">nullable</span></acronym>][<acronym title="Don't free data after the code is done."><span class="acronym">transfer none</span></acronym>]</span></p>
</div>
<p class="since">Since: <a class="link" href="api-index-3-0.html#api-index-3.0">3.0</a></p>
</div>
<hr>
<div class="refsect2">
<a name="gdk-event-set-source-device"></a><h3>gdk_event_set_source_device ()</h3>
<pre class="programlisting"><span class="returnvalue">void</span>
gdk_event_set_source_device (<em class="parameter"><code><span class="type">GdkEvent</span> *event</code></em>,
<em class="parameter"><code><a class="link" href="GdkDevice.html" title="GdkDevice"><span class="type">GdkDevice</span></a> *device</code></em>);</pre>
<p>Sets the slave device for <em class="parameter"><code>event</code></em>
to <em class="parameter"><code>device</code></em>
.</p>
<p>The event must have been allocated by GTK+,
for instance by <a class="link" href="gdk3-Events.html#gdk-event-copy" title="gdk_event_copy ()"><code class="function">gdk_event_copy()</code></a>.</p>
<div class="refsect3">
<a name="gdk-event-set-source-device.parameters"></a><h4>Parameters</h4>
<div class="informaltable"><table class="informaltable" width="100%" border="0">
<colgroup>
<col width="150px" class="parameters_name">
<col class="parameters_description">
<col width="200px" class="parameters_annotations">
</colgroup>
<tbody>
<tr>
<td class="parameter_name"><p>event</p></td>
<td class="parameter_description"><p>a <span class="type">GdkEvent</span></p></td>
<td class="parameter_annotations"> </td>
</tr>
<tr>
<td class="parameter_name"><p>device</p></td>
<td class="parameter_description"><p>a <a class="link" href="GdkDevice.html" title="GdkDevice"><span class="type">GdkDevice</span></a></p></td>
<td class="parameter_annotations"> </td>
</tr>
</tbody>
</table></div>
</div>
<p class="since">Since: <a class="link" href="api-index-3-0.html#api-index-3.0">3.0</a></p>
</div>
<hr>
<div class="refsect2">
<a name="gdk-event-get-device-tool"></a><h3>gdk_event_get_device_tool ()</h3>
<pre class="programlisting"><span class="returnvalue">GdkDeviceTool</span> *
gdk_event_get_device_tool (<em class="parameter"><code>const <span class="type">GdkEvent</span> *event</code></em>);</pre>
<p>If the event was generated by a device that supports
different tools (eg. a tablet), this function will
return a <span class="type">GdkDeviceTool</span> representing the tool that
caused the event. Otherwise, <code class="literal">NULL</code> will be returned.</p>
<p>Note: the <span class="type">GdkDeviceTool</span>&lt;!-- --&gt;s will be constant during
the application lifetime, if settings must be stored
persistently across runs, see <a class="link" href="GdkDevice.html#gdk-device-tool-get-serial" title="gdk_device_tool_get_serial ()"><code class="function">gdk_device_tool_get_serial()</code></a></p>
<div class="refsect3">
<a name="gdk-event-get-device-tool.parameters"></a><h4>Parameters</h4>
<div class="informaltable"><table class="informaltable" width="100%" border="0">
<colgroup>
<col width="150px" class="parameters_name">
<col class="parameters_description">
<col width="200px" class="parameters_annotations">
</colgroup>
<tbody><tr>
<td class="parameter_name"><p>event</p></td>
<td class="parameter_description"><p>a <span class="type">GdkEvent</span></p></td>
<td class="parameter_annotations"> </td>
</tr></tbody>
</table></div>
</div>
<div class="refsect3">
<a name="gdk-event-get-device-tool.returns"></a><h4>Returns</h4>
<p>The current device tool, or <code class="literal">NULL</code>. </p>
<p><span class="annotation">[<acronym title="Don't free data after the code is done."><span class="acronym">transfer none</span></acronym>]</span></p>
</div>
<p class="since">Since: <a class="link" href="api-index-3-22.html#api-index-3.22">3.22</a></p>
</div>
<hr>
<div class="refsect2">
<a name="gdk-event-set-device-tool"></a><h3>gdk_event_set_device_tool ()</h3>
<pre class="programlisting"><span class="returnvalue">void</span>
gdk_event_set_device_tool (<em class="parameter"><code><span class="type">GdkEvent</span> *event</code></em>,
<em class="parameter"><code><span class="type">GdkDeviceTool</span> *tool</code></em>);</pre>
<p>Sets the device tool for this event, should be rarely used.</p>
<div class="refsect3">
<a name="gdk-event-set-device-tool.parameters"></a><h4>Parameters</h4>
<div class="informaltable"><table class="informaltable" width="100%" border="0">
<colgroup>
<col width="150px" class="parameters_name">
<col class="parameters_description">
<col width="200px" class="parameters_annotations">
</colgroup>
<tbody>
<tr>
<td class="parameter_name"><p>event</p></td>
<td class="parameter_description"><p>a <span class="type">GdkEvent</span></p></td>
<td class="parameter_annotations"> </td>
</tr>
<tr>
<td class="parameter_name"><p>tool</p></td>
<td class="parameter_description"><p>tool to set on the event, or <code class="literal">NULL</code>. </p></td>
<td class="parameter_annotations"><span class="annotation">[<acronym title="NULL may be passed as the value in, out, in-out; or as a return value."><span class="acronym">nullable</span></acronym>]</span></td>
</tr>
</tbody>
</table></div>
</div>
<p class="since">Since: <a class="link" href="api-index-3-22.html#api-index-3.22">3.22</a></p>
</div>
<hr>
<div class="refsect2">
<a name="gdk-setting-get"></a><h3>gdk_setting_get ()</h3>
<pre class="programlisting"><span class="returnvalue">gboolean</span>
gdk_setting_get (<em class="parameter"><code>const <span class="type">gchar</span> *name</code></em>,
<em class="parameter"><code><span class="type">GValue</span> *value</code></em>);</pre>
<p>Obtains a desktop-wide setting, such as the double-click time,
for the default screen. See <a class="link" href="GdkScreen.html#gdk-screen-get-setting" title="gdk_screen_get_setting ()"><code class="function">gdk_screen_get_setting()</code></a>.</p>
<div class="refsect3">
<a name="gdk-setting-get.parameters"></a><h4>Parameters</h4>
<div class="informaltable"><table class="informaltable" width="100%" border="0">
<colgroup>
<col width="150px" class="parameters_name">
<col class="parameters_description">
<col width="200px" class="parameters_annotations">
</colgroup>
<tbody>
<tr>
<td class="parameter_name"><p>name</p></td>
<td class="parameter_description"><p>the name of the setting.</p></td>
<td class="parameter_annotations"> </td>
</tr>
<tr>
<td class="parameter_name"><p>value</p></td>
<td class="parameter_description"><p>location to store the value of the setting.</p></td>
<td class="parameter_annotations"> </td>
</tr>
</tbody>
</table></div>
</div>
<div class="refsect3">
<a name="gdk-setting-get.returns"></a><h4>Returns</h4>
<p> <code class="literal">TRUE</code> if the setting existed and a value was stored
in <em class="parameter"><code>value</code></em>
, <code class="literal">FALSE</code> otherwise.</p>
</div>
</div>
</div>
<div class="refsect1">
<a name="gdk3-Events.see-also"></a><h2>See Also</h2>
<p><a class="link" href="gdk3-Event-Structures.html" title="Event Structures">Event Structures</a></p>
</div>
</div>
<div class="footer">
<hr>Generated by GTK-Doc V1.32.1</div>
</body>
</html>