chromium/native_client_sdk/doc_generated/pepper_beta/c/struct_p_p_b___mouse_lock__1__0.html

{{+bindTo:partials.standard_nacl_api}}
<h1>PPB_MouseLock Struct 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="PPB_MouseLock" --><h2>
Data Fields</h2><table class="memberdecls">

<tr><td class="memItemLeft" align="right" valign="top">int32_t(*&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="struct_p_p_b___mouse_lock__1__0.html#ac137bc2d66abfa39428ea67236c85401">LockMouse</a> )(<a class="el" href="group___typedefs.html#ga89b662403e6a687bb914b80114c0d19d">PP_Instance</a> instance, struct <a class="el" href="struct_p_p___completion_callback.html">PP_CompletionCallback</a> callback)</td></tr>
<tr><td class="memItemLeft" align="right" valign="top">void(*&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="struct_p_p_b___mouse_lock__1__0.html#a1b9ab648a3638b469be6235d4c76d634">UnlockMouse</a> )(<a class="el" href="group___typedefs.html#ga89b662403e6a687bb914b80114c0d19d">PP_Instance</a> instance)</td></tr>
</table>
<hr /><a name="details" id="details"></a><h2>Detailed Description</h2>
<div class="textblock"><p>The <code>PPB_MouseLock</code> interface is implemented by the browser. </p>
<p>This interface provides a way of locking the target of mouse events to a single module instance and removing the cursor from view. This mode is useful for certain classes of applications, especially first-person perspective 3D applications and 3D modeling software. </p>
</div><hr /><h2>Field Documentation</h2>
<a class="anchor" id="ac137bc2d66abfa39428ea67236c85401"></a><!-- doxytag: member="PPB_MouseLock::LockMouse" ref="ac137bc2d66abfa39428ea67236c85401" args=")(PP_Instance instance, struct PP_CompletionCallback callback)" -->
<div class="memitem">
<div class="memproto">
<table class="memname">
<tr>
<td class="memname">int32_t(* <a class="el" href="struct_p_p_b___mouse_lock__1__0.html#ac137bc2d66abfa39428ea67236c85401">PPB_MouseLock::LockMouse</a>)(<a class="el" href="group___typedefs.html#ga89b662403e6a687bb914b80114c0d19d">PP_Instance</a> instance, struct <a class="el" href="struct_p_p___completion_callback.html">PP_CompletionCallback</a> callback)</td>
</tr>
</table>
</div>
<div class="memdoc">
<p><a class="el" href="struct_p_p_b___mouse_lock__1__0.html#ac137bc2d66abfa39428ea67236c85401" title="LockMouse() requests the mouse to be locked.">LockMouse()</a> requests the mouse to be locked. </p>
<p>While the mouse is locked, the cursor is implicitly hidden from the user. Any movement of the mouse will generate a <code>PP_INPUTEVENT_TYPE_MOUSEMOVE</code> event. The <code>GetPosition()</code> function in the <code>PPB_MouseInputEvent</code> interface reports the last known mouse position just as mouse lock was entered. The <code>GetMovement()</code> function provides relative movement information indicating what the change in position of the mouse would be had it not been locked.</p>
<p>The browser may revoke the mouse lock for reasons including (but not limited to) the user pressing the ESC key, the user activating another program using a reserved keystroke (e.g. ALT+TAB), or some other system event.</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>A <code>PP_Instance</code> identifying one instance of a module. </td></tr>
<tr><td class="paramdir">[in]</td><td class="paramname">callback</td><td>A <code><a class="el" href="struct_p_p___completion_callback.html" title="PP_CompletionCallback is a common mechanism for supporting potentially asynchronous calls in browser ...">PP_CompletionCallback</a></code> to be called upon completion.</td></tr>
</table>
</dd>
</dl>
<dl class="return"><dt><b>Returns:</b></dt><dd>An int32_t containing an error code from <code><a class="el" href="pp__errors_8h.html" title="This file defines an enumeration of all PPAPI error codes.">pp_errors.h</a></code>. </dd></dl>
</div>
</div>
<a class="anchor" id="a1b9ab648a3638b469be6235d4c76d634"></a><!-- doxytag: member="PPB_MouseLock::UnlockMouse" ref="a1b9ab648a3638b469be6235d4c76d634" args=")(PP_Instance instance)" -->
<div class="memitem">
<div class="memproto">
<table class="memname">
<tr>
<td class="memname">void(* <a class="el" href="struct_p_p_b___mouse_lock__1__0.html#a1b9ab648a3638b469be6235d4c76d634">PPB_MouseLock::UnlockMouse</a>)(<a class="el" href="group___typedefs.html#ga89b662403e6a687bb914b80114c0d19d">PP_Instance</a> instance)</td>
</tr>
</table>
</div>
<div class="memdoc">
<p><a class="el" href="struct_p_p_b___mouse_lock__1__0.html#a1b9ab648a3638b469be6235d4c76d634" title="UnlockMouse() causes the mouse to be unlocked, allowing it to track user movement again...">UnlockMouse()</a> causes the mouse to be unlocked, allowing it to track user movement again. </p>
<p>This is an asynchronous operation. The module instance will be notified using the <code>PPP_MouseLock</code> interface when it has lost the mouse lock.</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>A <code>PP_Instance</code> identifying one instance of a module. </td></tr>
</table>
</dd>
</dl>
</div>
</div>
<hr />The documentation for this struct was generated from the following file:<ul>
<li><a class="el" href="ppb__mouse__lock_8h.html">ppb_mouse_lock.h</a></li>
</ul>
</div><!-- contents -->
</div>
{{/partials.standard_nacl_api}}