<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN"> <html> <head> <meta http-equiv="Content-Type" content="text/html;charset=iso-8859-1"> <title>libcaca documentation</title> <link href="doxygen.css" rel="stylesheet" type="text/css"> </head> <body> <!-- Generated by Doxygen 1.8.13 --> </div><!-- top --> <div class="header"> <div class="summary"> <a href="#func-members">Functions</a> </div> <div class="headertitle"> <div class="title">libcaca event handling</div> </div> </div><!--header--> <div class="contents"> <table class="memberdecls"> <tr class="heading"><td colspan="2"><h2 class="groupheader"><a name="func-members"></a> Functions</h2></td></tr> <tr class="memitem:ga98e74dedbe1629c0fc9460761696e050"><td class="memItemLeft" align="right" valign="top">__extern int </td><td class="memItemRight" valign="bottom"><a class="el" href="group__caca__event.html#ga98e74dedbe1629c0fc9460761696e050">caca_get_event</a> (<a class="el" href="caca_8h.html#ada5af7a20f3e2f6c103078181b07393e">caca_display_t</a> *, int, <a class="el" href="caca_8h.html#ab47da7d18aef50248c90de93efd6ba9b">caca_event_t</a> *, int)</td></tr> <tr class="memdesc:ga98e74dedbe1629c0fc9460761696e050"><td class="mdescLeft"> </td><td class="mdescRight">Get the next mouse or keyboard input event. <a href="#ga98e74dedbe1629c0fc9460761696e050">More...</a><br /></td></tr> <tr class="separator:ga98e74dedbe1629c0fc9460761696e050"><td class="memSeparator" colspan="2"> </td></tr> <tr class="memitem:gaf01ff2ff5f63e38eed2052b53181da2d"><td class="memItemLeft" align="right" valign="top">__extern int </td><td class="memItemRight" valign="bottom"><a class="el" href="group__caca__event.html#gaf01ff2ff5f63e38eed2052b53181da2d">caca_get_mouse_x</a> (<a class="el" href="caca_8h.html#ada5af7a20f3e2f6c103078181b07393e">caca_display_t</a> const *)</td></tr> <tr class="memdesc:gaf01ff2ff5f63e38eed2052b53181da2d"><td class="mdescLeft"> </td><td class="mdescRight">Return the X mouse coordinate. <a href="#gaf01ff2ff5f63e38eed2052b53181da2d">More...</a><br /></td></tr> <tr class="separator:gaf01ff2ff5f63e38eed2052b53181da2d"><td class="memSeparator" colspan="2"> </td></tr> <tr class="memitem:gac3310eaf44cc95e46be5c3e9a8a6818e"><td class="memItemLeft" align="right" valign="top">__extern int </td><td class="memItemRight" valign="bottom"><a class="el" href="group__caca__event.html#gac3310eaf44cc95e46be5c3e9a8a6818e">caca_get_mouse_y</a> (<a class="el" href="caca_8h.html#ada5af7a20f3e2f6c103078181b07393e">caca_display_t</a> const *)</td></tr> <tr class="memdesc:gac3310eaf44cc95e46be5c3e9a8a6818e"><td class="mdescLeft"> </td><td class="mdescRight">Return the Y mouse coordinate. <a href="#gac3310eaf44cc95e46be5c3e9a8a6818e">More...</a><br /></td></tr> <tr class="separator:gac3310eaf44cc95e46be5c3e9a8a6818e"><td class="memSeparator" colspan="2"> </td></tr> <tr class="memitem:gad25829294affb5693a11aa237d3fe799"><td class="memItemLeft" align="right" valign="top">__extern enum <a class="el" href="caca_8h.html#a40754185ca237fc44a95357afba34aea">caca_event_type</a> </td><td class="memItemRight" valign="bottom"><a class="el" href="group__caca__event.html#gad25829294affb5693a11aa237d3fe799">caca_get_event_type</a> (<a class="el" href="caca_8h.html#ab47da7d18aef50248c90de93efd6ba9b">caca_event_t</a> const *)</td></tr> <tr class="memdesc:gad25829294affb5693a11aa237d3fe799"><td class="mdescLeft"> </td><td class="mdescRight">Return an event's type. <a href="#gad25829294affb5693a11aa237d3fe799">More...</a><br /></td></tr> <tr class="separator:gad25829294affb5693a11aa237d3fe799"><td class="memSeparator" colspan="2"> </td></tr> <tr class="memitem:ga946d19f0da7be7a53b848f8dd4251de7"><td class="memItemLeft" align="right" valign="top">__extern int </td><td class="memItemRight" valign="bottom"><a class="el" href="group__caca__event.html#ga946d19f0da7be7a53b848f8dd4251de7">caca_get_event_key_ch</a> (<a class="el" href="caca_8h.html#ab47da7d18aef50248c90de93efd6ba9b">caca_event_t</a> const *)</td></tr> <tr class="memdesc:ga946d19f0da7be7a53b848f8dd4251de7"><td class="mdescLeft"> </td><td class="mdescRight">Return a key press or key release event's value. <a href="#ga946d19f0da7be7a53b848f8dd4251de7">More...</a><br /></td></tr> <tr class="separator:ga946d19f0da7be7a53b848f8dd4251de7"><td class="memSeparator" colspan="2"> </td></tr> <tr class="memitem:gafe4050ef5bbaa8c2bce622beadc7df8d"><td class="memItemLeft" align="right" valign="top">__extern uint32_t </td><td class="memItemRight" valign="bottom"><a class="el" href="group__caca__event.html#gafe4050ef5bbaa8c2bce622beadc7df8d">caca_get_event_key_utf32</a> (<a class="el" href="caca_8h.html#ab47da7d18aef50248c90de93efd6ba9b">caca_event_t</a> const *)</td></tr> <tr class="memdesc:gafe4050ef5bbaa8c2bce622beadc7df8d"><td class="mdescLeft"> </td><td class="mdescRight">Return a key press or key release event's Unicode value. <a href="#gafe4050ef5bbaa8c2bce622beadc7df8d">More...</a><br /></td></tr> <tr class="separator:gafe4050ef5bbaa8c2bce622beadc7df8d"><td class="memSeparator" colspan="2"> </td></tr> <tr class="memitem:gad1e178b837e26e04893e4fd00b16300d"><td class="memItemLeft" align="right" valign="top">__extern int </td><td class="memItemRight" valign="bottom"><a class="el" href="group__caca__event.html#gad1e178b837e26e04893e4fd00b16300d">caca_get_event_key_utf8</a> (<a class="el" href="caca_8h.html#ab47da7d18aef50248c90de93efd6ba9b">caca_event_t</a> const *, char *)</td></tr> <tr class="memdesc:gad1e178b837e26e04893e4fd00b16300d"><td class="mdescLeft"> </td><td class="mdescRight">Return a key press or key release event's UTF-8 value. <a href="#gad1e178b837e26e04893e4fd00b16300d">More...</a><br /></td></tr> <tr class="separator:gad1e178b837e26e04893e4fd00b16300d"><td class="memSeparator" colspan="2"> </td></tr> <tr class="memitem:ga717e5140c28618ff1e7b9f5b8088bd30"><td class="memItemLeft" align="right" valign="top">__extern int </td><td class="memItemRight" valign="bottom"><a class="el" href="group__caca__event.html#ga717e5140c28618ff1e7b9f5b8088bd30">caca_get_event_mouse_button</a> (<a class="el" href="caca_8h.html#ab47da7d18aef50248c90de93efd6ba9b">caca_event_t</a> const *)</td></tr> <tr class="memdesc:ga717e5140c28618ff1e7b9f5b8088bd30"><td class="mdescLeft"> </td><td class="mdescRight">Return a mouse press or mouse release event's button. <a href="#ga717e5140c28618ff1e7b9f5b8088bd30">More...</a><br /></td></tr> <tr class="separator:ga717e5140c28618ff1e7b9f5b8088bd30"><td class="memSeparator" colspan="2"> </td></tr> <tr class="memitem:ga43631e56f18159f29500b7ff9f2f86dc"><td class="memItemLeft" align="right" valign="top">__extern int </td><td class="memItemRight" valign="bottom"><a class="el" href="group__caca__event.html#ga43631e56f18159f29500b7ff9f2f86dc">caca_get_event_mouse_x</a> (<a class="el" href="caca_8h.html#ab47da7d18aef50248c90de93efd6ba9b">caca_event_t</a> const *)</td></tr> <tr class="memdesc:ga43631e56f18159f29500b7ff9f2f86dc"><td class="mdescLeft"> </td><td class="mdescRight">Return a mouse motion event's X coordinate. <a href="#ga43631e56f18159f29500b7ff9f2f86dc">More...</a><br /></td></tr> <tr class="separator:ga43631e56f18159f29500b7ff9f2f86dc"><td class="memSeparator" colspan="2"> </td></tr> <tr class="memitem:ga0a8a947bba8fe524f5b1885581585205"><td class="memItemLeft" align="right" valign="top">__extern int </td><td class="memItemRight" valign="bottom"><a class="el" href="group__caca__event.html#ga0a8a947bba8fe524f5b1885581585205">caca_get_event_mouse_y</a> (<a class="el" href="caca_8h.html#ab47da7d18aef50248c90de93efd6ba9b">caca_event_t</a> const *)</td></tr> <tr class="memdesc:ga0a8a947bba8fe524f5b1885581585205"><td class="mdescLeft"> </td><td class="mdescRight">Return a mouse motion event's Y coordinate. <a href="#ga0a8a947bba8fe524f5b1885581585205">More...</a><br /></td></tr> <tr class="separator:ga0a8a947bba8fe524f5b1885581585205"><td class="memSeparator" colspan="2"> </td></tr> <tr class="memitem:gaf37f40ebbd84e1febfb45980e33ce861"><td class="memItemLeft" align="right" valign="top">__extern int </td><td class="memItemRight" valign="bottom"><a class="el" href="group__caca__event.html#gaf37f40ebbd84e1febfb45980e33ce861">caca_get_event_resize_width</a> (<a class="el" href="caca_8h.html#ab47da7d18aef50248c90de93efd6ba9b">caca_event_t</a> const *)</td></tr> <tr class="memdesc:gaf37f40ebbd84e1febfb45980e33ce861"><td class="mdescLeft"> </td><td class="mdescRight">Return a resize event's display width value. <a href="#gaf37f40ebbd84e1febfb45980e33ce861">More...</a><br /></td></tr> <tr class="separator:gaf37f40ebbd84e1febfb45980e33ce861"><td class="memSeparator" colspan="2"> </td></tr> <tr class="memitem:ga20d8da5ded5ae58fa3050c8fadc40a46"><td class="memItemLeft" align="right" valign="top">__extern int </td><td class="memItemRight" valign="bottom"><a class="el" href="group__caca__event.html#ga20d8da5ded5ae58fa3050c8fadc40a46">caca_get_event_resize_height</a> (<a class="el" href="caca_8h.html#ab47da7d18aef50248c90de93efd6ba9b">caca_event_t</a> const *)</td></tr> <tr class="memdesc:ga20d8da5ded5ae58fa3050c8fadc40a46"><td class="mdescLeft"> </td><td class="mdescRight">Return a resize event's display height value. <a href="#ga20d8da5ded5ae58fa3050c8fadc40a46">More...</a><br /></td></tr> <tr class="separator:ga20d8da5ded5ae58fa3050c8fadc40a46"><td class="memSeparator" colspan="2"> </td></tr> </table> <a name="details" id="details"></a><h2 class="groupheader">Detailed Description</h2> <p>These functions handle user events such as keyboard input and mouse clicks. </p> <h2 class="groupheader">Function Documentation</h2> <a id="ga98e74dedbe1629c0fc9460761696e050"></a> <h2 class="memtitle"><span class="permalink"><a href="#ga98e74dedbe1629c0fc9460761696e050">◆ </a></span>caca_get_event()</h2> <div class="memitem"> <div class="memproto"> <table class="memname"> <tr> <td class="memname">__extern int caca_get_event </td> <td>(</td> <td class="paramtype"><a class="el" href="caca_8h.html#ada5af7a20f3e2f6c103078181b07393e">caca_display_t</a> * </td> <td class="paramname"><em>dp</em>, </td> </tr> <tr> <td class="paramkey"></td> <td></td> <td class="paramtype">int </td> <td class="paramname"><em>event_mask</em>, </td> </tr> <tr> <td class="paramkey"></td> <td></td> <td class="paramtype"><a class="el" href="caca_8h.html#ab47da7d18aef50248c90de93efd6ba9b">caca_event_t</a> * </td> <td class="paramname"><em>ev</em>, </td> </tr> <tr> <td class="paramkey"></td> <td></td> <td class="paramtype">int </td> <td class="paramname"><em>timeout</em> </td> </tr> <tr> <td></td> <td>)</td> <td></td><td></td> </tr> </table> </div><div class="memdoc"> <p>Poll the event queue for mouse or keyboard events matching the event mask and return the first matching event. Non-matching events are discarded. If <code>event_mask</code> is zero, the function returns immediately.</p> <p>The timeout value tells how long this function needs to wait for an event. A value of zero returns immediately and the function returns zero if no more events are pending in the queue. A negative value causes the function to wait indefinitely until a matching event is received.</p> <p>If not null, <code>ev</code> will be filled with information about the event received. If null, the function will return but no information about the event will be sent.</p> <p>This function never fails.</p> <dl class="params"><dt>Parameters</dt><dd> <table class="params"> <tr><td class="paramname">dp</td><td>The libcaca graphical context. </td></tr> <tr><td class="paramname">event_mask</td><td>Bitmask of requested events. </td></tr> <tr><td class="paramname">timeout</td><td>A timeout value in microseconds, -1 for blocking behaviour </td></tr> <tr><td class="paramname">ev</td><td>A pointer to a <a class="el" href="structcaca__event.html" title="Handling of user events. ">caca_event</a> structure, or NULL. </td></tr> </table> </dd> </dl> <dl class="section return"><dt>Returns</dt><dd>1 if a matching event was received, or 0 if the wait timeouted. </dd></dl> <p class="reference">References <a class="el" href="caca_8h.html#a40754185ca237fc44a95357afba34aeaaaa0b1e20607444a2233e28758897f512">CACA_EVENT_NONE</a>.</p> <p class="reference">Referenced by <a class="el" href="group__conio.html#ga228f0a90f6539f0dbd2a5aabb41db726">caca_conio_getch()</a>, and <a class="el" href="group__conio.html#ga3f489bbd46a56e058f022ffc0cf57e03">caca_conio_kbhit()</a>.</p> </div> </div> <a id="gaf01ff2ff5f63e38eed2052b53181da2d"></a> <h2 class="memtitle"><span class="permalink"><a href="#gaf01ff2ff5f63e38eed2052b53181da2d">◆ </a></span>caca_get_mouse_x()</h2> <div class="memitem"> <div class="memproto"> <table class="memname"> <tr> <td class="memname">__extern int caca_get_mouse_x </td> <td>(</td> <td class="paramtype"><a class="el" href="caca_8h.html#ada5af7a20f3e2f6c103078181b07393e">caca_display_t</a> const * </td> <td class="paramname"><em>dp</em></td><td>)</td> <td></td> </tr> </table> </div><div class="memdoc"> <p>Return the X coordinate of the mouse position last time it was detected. This function is not reliable if the ncurses or S-Lang drivers are being used, because mouse position is only detected when the mouse is clicked. Other drivers such as X11 work well.</p> <p>This function never fails.</p> <dl class="params"><dt>Parameters</dt><dd> <table class="params"> <tr><td class="paramname">dp</td><td>The libcaca graphical context. </td></tr> </table> </dd> </dl> <dl class="section return"><dt>Returns</dt><dd>The X mouse coordinate. </dd></dl> <p class="reference">References <a class="el" href="group__libcaca.html#gad85b2ff4c7f952b3cc32f117343a6375">caca_get_canvas_width()</a>.</p> </div> </div> <a id="gac3310eaf44cc95e46be5c3e9a8a6818e"></a> <h2 class="memtitle"><span class="permalink"><a href="#gac3310eaf44cc95e46be5c3e9a8a6818e">◆ </a></span>caca_get_mouse_y()</h2> <div class="memitem"> <div class="memproto"> <table class="memname"> <tr> <td class="memname">__extern int caca_get_mouse_y </td> <td>(</td> <td class="paramtype"><a class="el" href="caca_8h.html#ada5af7a20f3e2f6c103078181b07393e">caca_display_t</a> const * </td> <td class="paramname"><em>dp</em></td><td>)</td> <td></td> </tr> </table> </div><div class="memdoc"> <p>Return the Y coordinate of the mouse position last time it was detected. This function is not reliable if the ncurses or S-Lang drivers are being used, because mouse position is only detected when the mouse is clicked. Other drivers such as X11 work well.</p> <p>This function never fails.</p> <dl class="params"><dt>Parameters</dt><dd> <table class="params"> <tr><td class="paramname">dp</td><td>The libcaca graphical context. </td></tr> </table> </dd> </dl> <dl class="section return"><dt>Returns</dt><dd>The Y mouse coordinate. </dd></dl> <p class="reference">References <a class="el" href="group__libcaca.html#gaa529140e8cf31379a6b57af7c37c9d2f">caca_get_canvas_height()</a>.</p> </div> </div> <a id="gad25829294affb5693a11aa237d3fe799"></a> <h2 class="memtitle"><span class="permalink"><a href="#gad25829294affb5693a11aa237d3fe799">◆ </a></span>caca_get_event_type()</h2> <div class="memitem"> <div class="memproto"> <table class="memname"> <tr> <td class="memname">__extern enum <a class="el" href="caca_8h.html#a40754185ca237fc44a95357afba34aea">caca_event_type</a> caca_get_event_type </td> <td>(</td> <td class="paramtype"><a class="el" href="caca_8h.html#ab47da7d18aef50248c90de93efd6ba9b">caca_event_t</a> const * </td> <td class="paramname"><em>ev</em></td><td>)</td> <td></td> </tr> </table> </div><div class="memdoc"> <p>Return the type of an event. This function may always be called on an event after <a class="el" href="group__caca__event.html#ga98e74dedbe1629c0fc9460761696e050" title="Get the next mouse or keyboard input event. ">caca_get_event()</a> was called, and its return value indicates which other functions may be called:</p><ul> <li><code>CACA_EVENT_NONE:</code> no other function may be called.</li> <li><code>CACA_EVENT_KEY_PRESS</code>, <code>CACA_EVENT_KEY_RELEASE:</code> <a class="el" href="group__caca__event.html#ga946d19f0da7be7a53b848f8dd4251de7" title="Return a key press or key release event's value. ">caca_get_event_key_ch()</a>, <a class="el" href="group__caca__event.html#gafe4050ef5bbaa8c2bce622beadc7df8d" title="Return a key press or key release event's Unicode value. ">caca_get_event_key_utf32()</a> and <a class="el" href="group__caca__event.html#gad1e178b837e26e04893e4fd00b16300d" title="Return a key press or key release event's UTF-8 value. ">caca_get_event_key_utf8()</a> may be called.</li> <li><code>CACA_EVENT_MOUSE_PRESS</code>, <code>CACA_EVENT_MOUSE_RELEASE:</code> <a class="el" href="group__caca__event.html#ga717e5140c28618ff1e7b9f5b8088bd30" title="Return a mouse press or mouse release event's button. ">caca_get_event_mouse_button()</a> may be called.</li> <li><code>CACA_EVENT_MOUSE_MOTION:</code> <a class="el" href="group__caca__event.html#ga43631e56f18159f29500b7ff9f2f86dc" title="Return a mouse motion event's X coordinate. ">caca_get_event_mouse_x()</a> and <a class="el" href="group__caca__event.html#ga0a8a947bba8fe524f5b1885581585205" title="Return a mouse motion event's Y coordinate. ">caca_get_event_mouse_y()</a> may be called.</li> <li><code>CACA_EVENT_RESIZE:</code> <a class="el" href="group__caca__event.html#gaf37f40ebbd84e1febfb45980e33ce861" title="Return a resize event's display width value. ">caca_get_event_resize_width()</a> and <a class="el" href="group__caca__event.html#ga20d8da5ded5ae58fa3050c8fadc40a46" title="Return a resize event's display height value. ">caca_get_event_resize_height()</a> may be called.</li> <li><code>CACA_EVENT_QUIT:</code> no other function may be called.</li> </ul> <p>This function never fails.</p> <dl class="params"><dt>Parameters</dt><dd> <table class="params"> <tr><td class="paramname">ev</td><td>The libcaca event. </td></tr> </table> </dd> </dl> <dl class="section return"><dt>Returns</dt><dd>The event's type. </dd></dl> </div> </div> <a id="ga946d19f0da7be7a53b848f8dd4251de7"></a> <h2 class="memtitle"><span class="permalink"><a href="#ga946d19f0da7be7a53b848f8dd4251de7">◆ </a></span>caca_get_event_key_ch()</h2> <div class="memitem"> <div class="memproto"> <table class="memname"> <tr> <td class="memname">__extern int caca_get_event_key_ch </td> <td>(</td> <td class="paramtype"><a class="el" href="caca_8h.html#ab47da7d18aef50248c90de93efd6ba9b">caca_event_t</a> const * </td> <td class="paramname"><em>ev</em></td><td>)</td> <td></td> </tr> </table> </div><div class="memdoc"> <p>Return either the ASCII value for an event's key, or if the key is not an ASCII character, an appropriate <em>enum</em> <em>caca_key</em> value.</p> <p>This function never fails, but must only be called with a valid event of type <code>CACA_EVENT_KEY_PRESS</code> or <code>CACA_EVENT_KEY_RELEASE</code>, or the results will be undefined. See <a class="el" href="group__caca__event.html#gad25829294affb5693a11aa237d3fe799" title="Return an event's type. ">caca_get_event_type()</a> for more information.</p> <dl class="params"><dt>Parameters</dt><dd> <table class="params"> <tr><td class="paramname">ev</td><td>The libcaca event. </td></tr> </table> </dd> </dl> <dl class="section return"><dt>Returns</dt><dd>The key value. </dd></dl> <p class="reference">Referenced by <a class="el" href="group__conio.html#ga228f0a90f6539f0dbd2a5aabb41db726">caca_conio_getch()</a>, and <a class="el" href="group__conio.html#ga3f489bbd46a56e058f022ffc0cf57e03">caca_conio_kbhit()</a>.</p> </div> </div> <a id="gafe4050ef5bbaa8c2bce622beadc7df8d"></a> <h2 class="memtitle"><span class="permalink"><a href="#gafe4050ef5bbaa8c2bce622beadc7df8d">◆ </a></span>caca_get_event_key_utf32()</h2> <div class="memitem"> <div class="memproto"> <table class="memname"> <tr> <td class="memname">__extern uint32_t caca_get_event_key_utf32 </td> <td>(</td> <td class="paramtype"><a class="el" href="caca_8h.html#ab47da7d18aef50248c90de93efd6ba9b">caca_event_t</a> const * </td> <td class="paramname"><em>ev</em></td><td>)</td> <td></td> </tr> </table> </div><div class="memdoc"> <p>Return the UTF-32/UCS-4 value for an event's key if it resolves to a printable character.</p> <p>This function never fails, but must only be called with a valid event of type <code>CACA_EVENT_KEY_PRESS</code> or <code>CACA_EVENT_KEY_RELEASE</code>, or the results will be undefined. See <a class="el" href="group__caca__event.html#gad25829294affb5693a11aa237d3fe799" title="Return an event's type. ">caca_get_event_type()</a> for more information.</p> <dl class="params"><dt>Parameters</dt><dd> <table class="params"> <tr><td class="paramname">ev</td><td>The libcaca event. </td></tr> </table> </dd> </dl> <dl class="section return"><dt>Returns</dt><dd>The key's Unicode value. </dd></dl> </div> </div> <a id="gad1e178b837e26e04893e4fd00b16300d"></a> <h2 class="memtitle"><span class="permalink"><a href="#gad1e178b837e26e04893e4fd00b16300d">◆ </a></span>caca_get_event_key_utf8()</h2> <div class="memitem"> <div class="memproto"> <table class="memname"> <tr> <td class="memname">__extern int caca_get_event_key_utf8 </td> <td>(</td> <td class="paramtype"><a class="el" href="caca_8h.html#ab47da7d18aef50248c90de93efd6ba9b">caca_event_t</a> const * </td> <td class="paramname"><em>ev</em>, </td> </tr> <tr> <td class="paramkey"></td> <td></td> <td class="paramtype">char * </td> <td class="paramname"><em>utf8</em> </td> </tr> <tr> <td></td> <td>)</td> <td></td><td></td> </tr> </table> </div><div class="memdoc"> <p>Write the UTF-8 value for an event's key if it resolves to a printable character. Up to 6 UTF-8 bytes and a null termination are written.</p> <p>This function never fails, but must only be called with a valid event of type <code>CACA_EVENT_KEY_PRESS</code> or <code>CACA_EVENT_KEY_RELEASE</code>, or the results will be undefined. See <a class="el" href="group__caca__event.html#gad25829294affb5693a11aa237d3fe799" title="Return an event's type. ">caca_get_event_type()</a> for more information.</p> <dl class="params"><dt>Parameters</dt><dd> <table class="params"> <tr><td class="paramname">ev</td><td>The libcaca event. </td></tr> <tr><td class="paramname">utf8</td><td>A string buffer with enough bytes to hold the pressed key value in UTF-8. Though fewer bytes may be written to it, 7 bytes is the minimum safe size. </td></tr> </table> </dd> </dl> <dl class="section return"><dt>Returns</dt><dd>This function always returns 0. </dd></dl> </div> </div> <a id="ga717e5140c28618ff1e7b9f5b8088bd30"></a> <h2 class="memtitle"><span class="permalink"><a href="#ga717e5140c28618ff1e7b9f5b8088bd30">◆ </a></span>caca_get_event_mouse_button()</h2> <div class="memitem"> <div class="memproto"> <table class="memname"> <tr> <td class="memname">__extern int caca_get_event_mouse_button </td> <td>(</td> <td class="paramtype"><a class="el" href="caca_8h.html#ab47da7d18aef50248c90de93efd6ba9b">caca_event_t</a> const * </td> <td class="paramname"><em>ev</em></td><td>)</td> <td></td> </tr> </table> </div><div class="memdoc"> <p>Return the mouse button index for an event.</p> <p>This function never fails, but must only be called with a valid event of type <code>CACA_EVENT_MOUSE_PRESS</code> or <code>CACA_EVENT_MOUSE_RELEASE</code>, or the results will be undefined. See <a class="el" href="group__caca__event.html#gad25829294affb5693a11aa237d3fe799" title="Return an event's type. ">caca_get_event_type()</a> for more information.</p> <p>This function returns 1 for the left mouse button, 2 for the right mouse button, and 3 for the middle mouse button.</p> <dl class="params"><dt>Parameters</dt><dd> <table class="params"> <tr><td class="paramname">ev</td><td>The libcaca event. </td></tr> </table> </dd> </dl> <dl class="section return"><dt>Returns</dt><dd>The event's mouse button. </dd></dl> </div> </div> <a id="ga43631e56f18159f29500b7ff9f2f86dc"></a> <h2 class="memtitle"><span class="permalink"><a href="#ga43631e56f18159f29500b7ff9f2f86dc">◆ </a></span>caca_get_event_mouse_x()</h2> <div class="memitem"> <div class="memproto"> <table class="memname"> <tr> <td class="memname">__extern int caca_get_event_mouse_x </td> <td>(</td> <td class="paramtype"><a class="el" href="caca_8h.html#ab47da7d18aef50248c90de93efd6ba9b">caca_event_t</a> const * </td> <td class="paramname"><em>ev</em></td><td>)</td> <td></td> </tr> </table> </div><div class="memdoc"> <p>Return the X coordinate for a mouse motion event.</p> <p>This function never fails, but must only be called with a valid event of type <code>CACA_EVENT_MOUSE_MOTION</code>, or the results will be undefined. See <a class="el" href="group__caca__event.html#gad25829294affb5693a11aa237d3fe799" title="Return an event's type. ">caca_get_event_type()</a> for more information.</p> <dl class="params"><dt>Parameters</dt><dd> <table class="params"> <tr><td class="paramname">ev</td><td>The libcaca event. </td></tr> </table> </dd> </dl> <dl class="section return"><dt>Returns</dt><dd>The event's X mouse coordinate. </dd></dl> </div> </div> <a id="ga0a8a947bba8fe524f5b1885581585205"></a> <h2 class="memtitle"><span class="permalink"><a href="#ga0a8a947bba8fe524f5b1885581585205">◆ </a></span>caca_get_event_mouse_y()</h2> <div class="memitem"> <div class="memproto"> <table class="memname"> <tr> <td class="memname">__extern int caca_get_event_mouse_y </td> <td>(</td> <td class="paramtype"><a class="el" href="caca_8h.html#ab47da7d18aef50248c90de93efd6ba9b">caca_event_t</a> const * </td> <td class="paramname"><em>ev</em></td><td>)</td> <td></td> </tr> </table> </div><div class="memdoc"> <p>Return the Y coordinate for a mouse motion event.</p> <p>This function never fails, but must only be called with a valid event of type <code>CACA_EVENT_MOUSE_MOTION</code>, or the results will be undefined. See <a class="el" href="group__caca__event.html#gad25829294affb5693a11aa237d3fe799" title="Return an event's type. ">caca_get_event_type()</a> for more information.</p> <dl class="params"><dt>Parameters</dt><dd> <table class="params"> <tr><td class="paramname">ev</td><td>The libcaca event. </td></tr> </table> </dd> </dl> <dl class="section return"><dt>Returns</dt><dd>The event's Y mouse coordinate. </dd></dl> </div> </div> <a id="gaf37f40ebbd84e1febfb45980e33ce861"></a> <h2 class="memtitle"><span class="permalink"><a href="#gaf37f40ebbd84e1febfb45980e33ce861">◆ </a></span>caca_get_event_resize_width()</h2> <div class="memitem"> <div class="memproto"> <table class="memname"> <tr> <td class="memname">__extern int caca_get_event_resize_width </td> <td>(</td> <td class="paramtype"><a class="el" href="caca_8h.html#ab47da7d18aef50248c90de93efd6ba9b">caca_event_t</a> const * </td> <td class="paramname"><em>ev</em></td><td>)</td> <td></td> </tr> </table> </div><div class="memdoc"> <p>Return the width value for a display resize event.</p> <p>This function never fails, but must only be called with a valid event of type <code>CACA_EVENT_RESIZE</code>, or the results will be undefined. See <a class="el" href="group__caca__event.html#gad25829294affb5693a11aa237d3fe799" title="Return an event's type. ">caca_get_event_type()</a> for more information.</p> <dl class="params"><dt>Parameters</dt><dd> <table class="params"> <tr><td class="paramname">ev</td><td>The libcaca event. </td></tr> </table> </dd> </dl> <dl class="section return"><dt>Returns</dt><dd>The event's new display width value. </dd></dl> </div> </div> <a id="ga20d8da5ded5ae58fa3050c8fadc40a46"></a> <h2 class="memtitle"><span class="permalink"><a href="#ga20d8da5ded5ae58fa3050c8fadc40a46">◆ </a></span>caca_get_event_resize_height()</h2> <div class="memitem"> <div class="memproto"> <table class="memname"> <tr> <td class="memname">__extern int caca_get_event_resize_height </td> <td>(</td> <td class="paramtype"><a class="el" href="caca_8h.html#ab47da7d18aef50248c90de93efd6ba9b">caca_event_t</a> const * </td> <td class="paramname"><em>ev</em></td><td>)</td> <td></td> </tr> </table> </div><div class="memdoc"> <p>Return the height value for a display resize event.</p> <p>This function never fails, but must only be called with a valid event of type <code>CACA_EVENT_RESIZE</code>, or the results will be undefined. See <a class="el" href="group__caca__event.html#gad25829294affb5693a11aa237d3fe799" title="Return an event's type. ">caca_get_event_type()</a> for more information.</p> <dl class="params"><dt>Parameters</dt><dd> <table class="params"> <tr><td class="paramname">ev</td><td>The libcaca event. </td></tr> </table> </dd> </dl> <dl class="section return"><dt>Returns</dt><dd>The event's new display height value. </dd></dl> <p class="reference">References <a class="el" href="caca_8h.html#a40754185ca237fc44a95357afba34aeaab1da825755a2ac3593cca73721b77e22">CACA_EVENT_KEY_PRESS</a>, <a class="el" href="caca_8h.html#a40754185ca237fc44a95357afba34aeaaee957c6fa4d927f8ae25c25c2948d34d">CACA_EVENT_KEY_RELEASE</a>, <a class="el" href="caca_8h.html#a40754185ca237fc44a95357afba34aeaaaa0b1e20607444a2233e28758897f512">CACA_EVENT_NONE</a>, <a class="el" href="caca_8h.html#a40754185ca237fc44a95357afba34aeaa81cbd28c6c9cd0d733dc0e6d94861177">CACA_EVENT_RESIZE</a>, <a class="el" href="group__libcaca.html#gaa529140e8cf31379a6b57af7c37c9d2f">caca_get_canvas_height()</a>, and <a class="el" href="group__libcaca.html#gad85b2ff4c7f952b3cc32f117343a6375">caca_get_canvas_width()</a>.</p> </div> </div> </div><!-- contents --> </body> </html>