blob: 720e1f98e10b33526c265bcb75e6864811ed5cd1 [file] [log] [blame]
{{+bindTo:partials.standard_nacl_api}}
<h1>pp::WheelInputEvent 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::WheelInputEvent" --><!-- doxytag: inherits="pp::InputEvent" --><div class="dynheader">
Inheritance diagram for pp::WheelInputEvent:</div>
<div class="dyncontent">
<div class="center"><img src="classpp_1_1_wheel_input_event__inherit__graph.png" border="0" usemap="#pp_1_1_wheel_input_event_inherit__map" alt="Inheritance graph" /></div>
<map name="pp_1_1_wheel_input_event_inherit__map" id="pp_1_1_wheel_input_event_inherit__map">
<area shape="rect" id="node2" href="classpp_1_1_input_event.html" title="This class represents an input event resource." alt="" coords="24,80,139,107"></area><area shape="rect" id="node3" href="classpp_1_1_resource.html" title="A reference counted module resource." alt="" coords="29,5,133,32"></area></map>
<center><span class="legend">[<a href="graph_legend.html">legend</a>]</span></center></div>
<p><a href="classpp_1_1_wheel_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_wheel_input_event.html#a85e0f60e68512da2339d61158371fa59">WheelInputEvent</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_wheel_input_event.html#ab933e1f6aac0f96cdb2d84153bf957ca">WheelInputEvent</a> (const <a class="el" href="classpp_1_1_input_event.html">InputEvent</a> &amp;event)</td></tr>
<tr><td class="memItemLeft" align="right" valign="top">&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="classpp_1_1_wheel_input_event.html#a5b9fc5bc86d59a7a5f7703511e41fb33">WheelInputEvent</a> (const <a class="el" href="classpp_1_1_instance_handle.html">InstanceHandle</a> &amp;instance, PP_TimeTicks time_stamp, uint32_t modifiers, const <a class="el" href="classpp_1_1_float_point.html">FloatPoint</a> &amp;wheel_delta, const <a class="el" href="classpp_1_1_float_point.html">FloatPoint</a> &amp;wheel_ticks, bool scroll_by_page)</td></tr>
<tr><td class="memItemLeft" align="right" valign="top"><a class="el" href="classpp_1_1_float_point.html">FloatPoint</a>&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="classpp_1_1_wheel_input_event.html#ac9cfe394244f9ea55a842a0cd5ee7ab8">GetDelta</a> () const </td></tr>
<tr><td class="memItemLeft" align="right" valign="top"><a class="el" href="classpp_1_1_float_point.html">FloatPoint</a>&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="classpp_1_1_wheel_input_event.html#a6c841300d5c71d9cf83eec7da8bbf084">GetTicks</a> () const </td></tr>
<tr><td class="memItemLeft" align="right" valign="top">bool&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="classpp_1_1_wheel_input_event.html#a8082fa4d12d5b66aa0364825d1549ca6">GetScrollByPage</a> () const </td></tr>
</table>
<hr /><h2>Constructor &amp; Destructor Documentation</h2>
<a class="anchor" id="a85e0f60e68512da2339d61158371fa59"></a><!-- doxytag: member="pp::WheelInputEvent::WheelInputEvent" ref="a85e0f60e68512da2339d61158371fa59" args="()" -->
<div class="memitem">
<div class="memproto">
<table class="memname">
<tr>
<td class="memname"><a class="el" href="classpp_1_1_wheel_input_event.html#a85e0f60e68512da2339d61158371fa59">pp::WheelInputEvent::WheelInputEvent</a> </td>
<td>(</td>
<td class="paramname"></td><td>)</td>
<td></td>
</tr>
</table>
</div>
<div class="memdoc">
<p>Constructs 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> wheel input event object. </p>
</div>
</div>
<a class="anchor" id="ab933e1f6aac0f96cdb2d84153bf957ca"></a><!-- doxytag: member="pp::WheelInputEvent::WheelInputEvent" ref="ab933e1f6aac0f96cdb2d84153bf957ca" args="(const InputEvent &amp;event)" -->
<div class="memitem">
<div class="memproto">
<table class="memname">
<tr>
<td class="memname"><a class="el" href="classpp_1_1_wheel_input_event.html#a85e0f60e68512da2339d61158371fa59">pp::WheelInputEvent::WheelInputEvent</a> </td>
<td>(</td>
<td class="paramtype">const <a class="el" href="classpp_1_1_input_event.html">InputEvent</a> &amp;&#160;</td>
<td class="paramname"><em>event</em></td><td>)</td>
<td><code> [explicit]</code></td>
</tr>
</table>
</div>
<div class="memdoc">
<p>This constructor constructs a wheel input event object from the provided generic input event. </p>
<p>If the given event is itself <a class="el" href="classpp_1_1_resource.html#a859068e34cdc2dc0b78754c255323aa9" title="This functions determines if this resource is invalid or uninitialized.">is_null()</a> or is not a wheel input event, the wheel 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>.</p>
<dl class="params"><dt><b>Parameters:</b></dt><dd>
<table class="params">
<tr><td class="paramdir">[in]</td><td class="paramname">event</td><td>A generic input event. </td></tr>
</table>
</dd>
</dl>
</div>
</div>
<a class="anchor" id="a5b9fc5bc86d59a7a5f7703511e41fb33"></a><!-- doxytag: member="pp::WheelInputEvent::WheelInputEvent" ref="a5b9fc5bc86d59a7a5f7703511e41fb33" args="(const InstanceHandle &amp;instance, PP_TimeTicks time_stamp, uint32_t modifiers, const FloatPoint &amp;wheel_delta, const FloatPoint &amp;wheel_ticks, bool scroll_by_page)" -->
<div class="memitem">
<div class="memproto">
<table class="memname">
<tr>
<td class="memname"><a class="el" href="classpp_1_1_wheel_input_event.html#a85e0f60e68512da2339d61158371fa59">pp::WheelInputEvent::WheelInputEvent</a> </td>
<td>(</td>
<td class="paramtype">const <a class="el" href="classpp_1_1_instance_handle.html">InstanceHandle</a> &amp;&#160;</td>
<td class="paramname"><em>instance</em>, </td>
</tr>
<tr>
<td class="paramkey"></td>
<td></td>
<td class="paramtype">PP_TimeTicks&#160;</td>
<td class="paramname"><em>time_stamp</em>, </td>
</tr>
<tr>
<td class="paramkey"></td>
<td></td>
<td class="paramtype">uint32_t&#160;</td>
<td class="paramname"><em>modifiers</em>, </td>
</tr>
<tr>
<td class="paramkey"></td>
<td></td>
<td class="paramtype">const <a class="el" href="classpp_1_1_float_point.html">FloatPoint</a> &amp;&#160;</td>
<td class="paramname"><em>wheel_delta</em>, </td>
</tr>
<tr>
<td class="paramkey"></td>
<td></td>
<td class="paramtype">const <a class="el" href="classpp_1_1_float_point.html">FloatPoint</a> &amp;&#160;</td>
<td class="paramname"><em>wheel_ticks</em>, </td>
</tr>
<tr>
<td class="paramkey"></td>
<td></td>
<td class="paramtype">bool&#160;</td>
<td class="paramname"><em>scroll_by_page</em>&#160;</td>
</tr>
<tr>
<td></td>
<td>)</td>
<td></td><td></td>
</tr>
</table>
</div>
<div class="memdoc">
<p>Constructs a wheel input even from the given parameters. </p>
<dl class="params"><dt><b>Parameters:</b></dt><dd>
<table class="params">
<tr><td class="paramdir">[in]</td><td class="paramname">instance</td><td>The instance for which this event occurred.</td></tr>
<tr><td class="paramdir">[in]</td><td class="paramname">time_stamp</td><td>A <code>PP_TimeTicks</code> indicating the time when the event occurred.</td></tr>
<tr><td class="paramdir">[in]</td><td class="paramname">modifiers</td><td>A bit field combination of the <code>PP_InputEvent_Modifier</code> flags.</td></tr>
<tr><td class="paramdir">[in]</td><td class="paramname">wheel_delta</td><td>The scroll wheel's horizontal and vertical scroll amounts.</td></tr>
<tr><td class="paramdir">[in]</td><td class="paramname">wheel_ticks</td><td>The number of "clicks" of the scroll wheel that have produced the event.</td></tr>
<tr><td class="paramdir">[in]</td><td class="paramname">scroll_by_page</td><td>When true, the user is requesting to scroll by pages. When false, the user is requesting to scroll by lines. </td></tr>
</table>
</dd>
</dl>
</div>
</div>
<hr /><h2>Member Function Documentation</h2>
<a class="anchor" id="ac9cfe394244f9ea55a842a0cd5ee7ab8"></a><!-- doxytag: member="pp::WheelInputEvent::GetDelta" ref="ac9cfe394244f9ea55a842a0cd5ee7ab8" args="() const " -->
<div class="memitem">
<div class="memproto">
<table class="memname">
<tr>
<td class="memname"><a class="el" href="classpp_1_1_float_point.html">FloatPoint</a> <a class="el" href="classpp_1_1_wheel_input_event.html#ac9cfe394244f9ea55a842a0cd5ee7ab8">pp::WheelInputEvent::GetDelta</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_wheel_input_event.html#ac9cfe394244f9ea55a842a0cd5ee7ab8" title="GetDelta() returns the amount vertically and horizontally the user has requested to scroll by with th...">GetDelta()</a> returns the amount vertically and horizontally the user has requested to scroll by with their mouse wheel. </p>
<p>A scroll down or to the right (where the content moves up or left) is represented as positive values, and a scroll up or to the left (where the content moves down or right) is represented as negative values.</p>
<p>This amount is system dependent and will take into account the user's preferred scroll sensitivity and potentially also nonlinear acceleration based on the speed of the scrolling.</p>
<p>Devices will be of varying resolution. Some mice with large detents will only generate integer scroll amounts. But fractional values are also possible, for example, on some trackpads and newer mice that don't have "clicks".</p>
<dl class="return"><dt><b>Returns:</b></dt><dd>The vertical and horizontal scroll values. The units are either in pixels (when scroll_by_page is false) or pages (when scroll_by_page is true). For example, y = -3 means scroll up 3 pixels when scroll_by_page is false, and scroll up 3 pages when scroll_by_page is true. </dd></dl>
</div>
</div>
<a class="anchor" id="a8082fa4d12d5b66aa0364825d1549ca6"></a><!-- doxytag: member="pp::WheelInputEvent::GetScrollByPage" ref="a8082fa4d12d5b66aa0364825d1549ca6" args="() const " -->
<div class="memitem">
<div class="memproto">
<table class="memname">
<tr>
<td class="memname">bool <a class="el" href="classpp_1_1_wheel_input_event.html#a8082fa4d12d5b66aa0364825d1549ca6">pp::WheelInputEvent::GetScrollByPage</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_wheel_input_event.html#a8082fa4d12d5b66aa0364825d1549ca6" title="GetScrollByPage() indicates if the scroll delta x/y indicates pages or lines to scroll by...">GetScrollByPage()</a> indicates if the scroll delta x/y indicates pages or lines to scroll by. </p>
<dl class="return"><dt><b>Returns:</b></dt><dd>true if the event is a wheel event and the user is scrolling by pages, false if not or if the resource is not a wheel event. </dd></dl>
</div>
</div>
<a class="anchor" id="a6c841300d5c71d9cf83eec7da8bbf084"></a><!-- doxytag: member="pp::WheelInputEvent::GetTicks" ref="a6c841300d5c71d9cf83eec7da8bbf084" args="() const " -->
<div class="memitem">
<div class="memproto">
<table class="memname">
<tr>
<td class="memname"><a class="el" href="classpp_1_1_float_point.html">FloatPoint</a> <a class="el" href="classpp_1_1_wheel_input_event.html#a6c841300d5c71d9cf83eec7da8bbf084">pp::WheelInputEvent::GetTicks</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_wheel_input_event.html#a6c841300d5c71d9cf83eec7da8bbf084" title='GetTicks() returns the number of "clicks" of the scroll wheel that have produced the event...'>GetTicks()</a> returns the number of "clicks" of the scroll wheel that have produced the event. </p>
<p>The value may have system-specific acceleration applied to it, depending on the device. The positive and negative meanings are the same as for <a class="el" href="classpp_1_1_wheel_input_event.html#ac9cfe394244f9ea55a842a0cd5ee7ab8" title="GetDelta() returns the amount vertically and horizontally the user has requested to scroll by with th...">GetDelta()</a>.</p>
<p>If you are scrolling, you probably want to use the delta values. These tick events can be useful if you aren't doing actual scrolling and don't want or pixel values. An example may be cycling between different items in a game.</p>
<dl class="return"><dt><b>Returns:</b></dt><dd>The number of "clicks" of the scroll wheel. You may receive fractional values for the wheel ticks if the mouse wheel is high resolution or doesn't have "clicks". If your program wants discrete events (as in the "picking items" example) you should accumulate fractional click values from multiple messages until the total value reaches positive or negative one. This should represent a similar amount of scrolling as for a mouse that has a discrete mouse wheel. </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}}