chromium/native_client_sdk/doc_generated/pepper_stable/cpp/classpp_1_1_input_event.html

{{+bindTo:partials.standard_nacl_api}}
<h1>pp::InputEvent Class Reference</h1>
<div id="doxygen-ref">
{{- dummy div to appease doxygen -}}
  <div>
<!-- Generated by Doxygen 1.7.6.1 -->



</div>
<!--header-->
<div class="contents">
<!-- doxytag: class="pp::InputEvent" --><!-- doxytag: inherits="pp::Resource" --><div class="dynheader">
Inheritance diagram for pp::InputEvent:</div>
<div class="dyncontent">
<div class="center"><img src="classpp_1_1_input_event__inherit__graph.png" border="0" usemap="#pp_1_1_input_event_inherit__map" alt="Inheritance graph" /></div>
<map name="pp_1_1_input_event_inherit__map" id="pp_1_1_input_event_inherit__map">
<area shape="rect" id="node3" href="classpp_1_1_i_m_e_input_event.html" title="pp::IMEInputEvent" alt="" coords="339,5,475,32"></area><area shape="rect" id="node4" href="classpp_1_1_keyboard_input_event.html" title="pp::KeyboardInputEvent" alt="" coords="320,56,493,83"></area><area shape="rect" id="node5" href="classpp_1_1_mouse_input_event.html" title="This class handles mouse events." alt="" coords="329,107,485,133"></area><area shape="rect" id="node6" href="classpp_1_1_touch_input_event.html" title="pp::TouchInputEvent" alt="" coords="331,157,482,184"></area><area shape="rect" id="node7" href="classpp_1_1_wheel_input_event.html" title="pp::WheelInputEvent" alt="" coords="331,208,483,235"></area><area shape="rect" id="node2" href="classpp_1_1_resource.html" title="A reference counted module resource." alt="" coords="5,107,109,133"></area></map>
<center><span class="legend">[<a href="graph_legend.html">legend</a>]</span></center></div>
<p><a href="classpp_1_1_input_event-members.html">List of all members.</a></p>
<h2>
Public Member Functions</h2><table class="memberdecls">

<tr><td class="memItemLeft" align="right" valign="top">&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="classpp_1_1_input_event.html#ac7581e4321abe8de6f3b48d70f4aa65d">InputEvent</a> ()</td></tr>
<tr><td class="memItemLeft" align="right" valign="top">&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="classpp_1_1_input_event.html#a1d4f7d3fb88de3cccc60ab26b92ccf23">InputEvent</a> (PP_Resource input_event_resource)</td></tr>
<tr><td class="memItemLeft" align="right" valign="top">&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="classpp_1_1_input_event.html#a2492183af4fecec44a423a5b7eae6faf">~InputEvent</a> ()</td></tr>
<tr><td class="memItemLeft" align="right" valign="top">PP_InputEvent_Type&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="classpp_1_1_input_event.html#a73ca79c06ff9a39304e3b390090f03dc">GetType</a> () const </td></tr>
<tr><td class="memItemLeft" align="right" valign="top">PP_TimeTicks&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="classpp_1_1_input_event.html#acc79ecdcf19f5b8a8a7268fc8ff51531">GetTimeStamp</a> () const </td></tr>
<tr><td class="memItemLeft" align="right" valign="top">uint32_t&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="classpp_1_1_input_event.html#a6f94a5cd8453f1b69e55aadde73354e7">GetModifiers</a> () const </td></tr>
</table>
<hr /><a name="details" id="details"></a><h2>Detailed Description</h2>
<div class="textblock"><p>This class represents an input event resource. </p>
<p>Normally you will get passed this object through the HandleInputEvent() function on the <code><a class="el" href="classpp_1_1_instance.html">Instance</a></code> object.</p>
<p>Typically you would check the type of the event and then create the appropriate event-specific object to query the properties.</p>
<p><b>Example:</b> </p>
<div class="fragment"><pre class="fragment"> <span class="keywordtype">bool</span> MyInstance::HandleInputEvent(<span class="keyword">const</span> <a class="code" href="classpp_1_1_input_event.html" title="This class represents an input event resource.">pp::InputEvent</a>&amp; event) {
   <span class="keywordflow">switch</span> (event.<a class="code" href="classpp_1_1_input_event.html#a73ca79c06ff9a39304e3b390090f03dc" title="GetType() returns the type of input event for this input event object.">GetType</a>()) {
     <span class="keywordflow">case</span> PP_INPUTEVENT_TYPE_MOUSEDOWN {
       <a class="code" href="classpp_1_1_mouse_input_event.html" title="This class handles mouse events.">pp::MouseInputEvent</a> mouse_event(event);
       <span class="keywordflow">return</span> HandleMouseDown(mouse_event.GetMousePosition());
     }
     <span class="keywordflow">default</span>:
       <span class="keywordflow">return</span> <span class="keyword">false</span>;
 }
</pre></div> </div><hr /><h2>Constructor &amp; Destructor Documentation</h2>
<a class="anchor" id="ac7581e4321abe8de6f3b48d70f4aa65d"></a><!-- doxytag: member="pp::InputEvent::InputEvent" ref="ac7581e4321abe8de6f3b48d70f4aa65d" args="()" -->
<div class="memitem">
<div class="memproto">
<table class="memname">
<tr>
<td class="memname"><a class="el" href="classpp_1_1_input_event.html#ac7581e4321abe8de6f3b48d70f4aa65d">pp::InputEvent::InputEvent</a> </td>
<td>(</td>
<td class="paramname"></td><td>)</td>
<td></td>
</tr>
</table>
</div>
<div class="memdoc">
<p>Default constructor that creates an <a class="el" href="classpp_1_1_resource.html#a859068e34cdc2dc0b78754c255323aa9" title="This functions determines if this resource is invalid or uninitialized.">is_null()</a> <a class="el" href="classpp_1_1_input_event.html" title="This class represents an input event resource.">InputEvent</a> object. </p>
</div>
</div>
<a class="anchor" id="a1d4f7d3fb88de3cccc60ab26b92ccf23"></a><!-- doxytag: member="pp::InputEvent::InputEvent" ref="a1d4f7d3fb88de3cccc60ab26b92ccf23" args="(PP_Resource input_event_resource)" -->
<div class="memitem">
<div class="memproto">
<table class="memname">
<tr>
<td class="memname"><a class="el" href="classpp_1_1_input_event.html#ac7581e4321abe8de6f3b48d70f4aa65d">pp::InputEvent::InputEvent</a> </td>
<td>(</td>
<td class="paramtype">PP_Resource&#160;</td>
<td class="paramname"><em>input_event_resource</em></td><td>)</td>
<td><code> [explicit]</code></td>
</tr>
</table>
</div>
<div class="memdoc">
<p>This constructor constructs an input event from the provided input event resource ID. </p>
<p>The <a class="el" href="classpp_1_1_input_event.html" title="This class represents an input event resource.">InputEvent</a> object will be <a class="el" href="classpp_1_1_resource.html#a859068e34cdc2dc0b78754c255323aa9" title="This functions determines if this resource is invalid or uninitialized.">is_null()</a> if the given resource is not a valid input event.</p>
<dl class="params"><dt><b>Parameters:</b></dt><dd>
<table class="params">
<tr><td class="paramdir">[in]</td><td class="paramname">input_event_resource</td><td>A input event resource ID. </td></tr>
</table>
</dd>
</dl>
</div>
</div>
<a class="anchor" id="a2492183af4fecec44a423a5b7eae6faf"></a><!-- doxytag: member="pp::InputEvent::~InputEvent" ref="a2492183af4fecec44a423a5b7eae6faf" args="()" -->
<div class="memitem">
<div class="memproto">
<table class="memname">
<tr>
<td class="memname"><a class="el" href="classpp_1_1_input_event.html#a2492183af4fecec44a423a5b7eae6faf">pp::InputEvent::~InputEvent</a> </td>
<td>(</td>
<td class="paramname"></td><td>)</td>
<td></td>
</tr>
</table>
</div>
<div class="memdoc">
</div>
</div>
<hr /><h2>Member Function Documentation</h2>
<a class="anchor" id="a6f94a5cd8453f1b69e55aadde73354e7"></a><!-- doxytag: member="pp::InputEvent::GetModifiers" ref="a6f94a5cd8453f1b69e55aadde73354e7" args="() const " -->
<div class="memitem">
<div class="memproto">
<table class="memname">
<tr>
<td class="memname">uint32_t <a class="el" href="classpp_1_1_input_event.html#a6f94a5cd8453f1b69e55aadde73354e7">pp::InputEvent::GetModifiers</a> </td>
<td>(</td>
<td class="paramname"></td><td>)</td>
<td> const</td>
</tr>
</table>
</div>
<div class="memdoc">
<p><a class="el" href="classpp_1_1_input_event.html#a6f94a5cd8453f1b69e55aadde73354e7" title="GetModifiers() returns a bitfield indicating which modifiers were down at the time of the event...">GetModifiers()</a> returns a bitfield indicating which modifiers were down at the time of the event. </p>
<p>This is a combination of the flags in the <code>PP_InputEvent_Modifier</code> enum.</p>
<dl class="return"><dt><b>Returns:</b></dt><dd>The modifiers associated with the event, or 0 if the given resource is not a valid event resource. </dd></dl>
</div>
</div>
<a class="anchor" id="acc79ecdcf19f5b8a8a7268fc8ff51531"></a><!-- doxytag: member="pp::InputEvent::GetTimeStamp" ref="acc79ecdcf19f5b8a8a7268fc8ff51531" args="() const " -->
<div class="memitem">
<div class="memproto">
<table class="memname">
<tr>
<td class="memname">PP_TimeTicks <a class="el" href="classpp_1_1_input_event.html#acc79ecdcf19f5b8a8a7268fc8ff51531">pp::InputEvent::GetTimeStamp</a> </td>
<td>(</td>
<td class="paramname"></td><td>)</td>
<td> const</td>
</tr>
</table>
</div>
<div class="memdoc">
<p><a class="el" href="classpp_1_1_input_event.html#acc79ecdcf19f5b8a8a7268fc8ff51531" title="GetTimeStamp() returns the time that the event was generated.">GetTimeStamp()</a> returns the time that the event was generated. </p>
<p>The time will be before the current time since processing and dispatching the event has some overhead. Use this value to compare the times the user generated two events without being sensitive to variable processing time.</p>
<p>The return value is in time ticks, which is a monotonically increasing clock not related to the wall clock time. It will not change if the user changes their clock or daylight savings time starts, so can be reliably used to compare events. This means, however, that you can't correlate event times to a particular time of day on the system clock.</p>
<dl class="return"><dt><b>Returns:</b></dt><dd>A <code>PP_TimeTicks</code> containing the time the event was generated. </dd></dl>
</div>
</div>
<a class="anchor" id="a73ca79c06ff9a39304e3b390090f03dc"></a><!-- doxytag: member="pp::InputEvent::GetType" ref="a73ca79c06ff9a39304e3b390090f03dc" args="() const " -->
<div class="memitem">
<div class="memproto">
<table class="memname">
<tr>
<td class="memname">PP_InputEvent_Type <a class="el" href="classpp_1_1_input_event.html#a73ca79c06ff9a39304e3b390090f03dc">pp::InputEvent::GetType</a> </td>
<td>(</td>
<td class="paramname"></td><td>)</td>
<td> const</td>
</tr>
</table>
</div>
<div class="memdoc">
<p><a class="el" href="classpp_1_1_input_event.html#a73ca79c06ff9a39304e3b390090f03dc" title="GetType() returns the type of input event for this input event object.">GetType()</a> returns the type of input event for this input event object. </p>
<dl class="return"><dt><b>Returns:</b></dt><dd>A <code>PP_InputEvent_Type</code> if successful, PP_INPUTEVENT_TYPE_UNDEFINED if the resource is invalid. </dd></dl>
</div>
</div>
<hr />The documentation for this class was generated from the following file:<ul>
<li><a class="el" href="input__event_8h.html">input_event.h</a></li>
</ul>
</div><!-- contents -->
</div>
{{/partials.standard_nacl_api}}