| OLD | NEW |
| (Empty) |
| 1 /* Copyright (c) 2011 The Chromium Authors. All rights reserved. | |
| 2 * Use of this source code is governed by a BSD-style license that can be | |
| 3 * found in the LICENSE file. | |
| 4 */ | |
| 5 | |
| 6 /** | |
| 7 * This file defines the <code>PPB_MouseLock_Dev</code> interface. | |
| 8 */ | |
| 9 | |
| 10 label Chrome { | |
| 11 M15 = 0.1 | |
| 12 }; | |
| 13 | |
| 14 /** | |
| 15 * The <code>PPB_MouseLock_Dev</code> interface is implemented by the browser. | |
| 16 * It provides a way of locking the target of mouse events to a single plugin | |
| 17 * instance and removing the cursor from view. This is a useful input mode for | |
| 18 * certain classes of applications, especially first person perspective 3D | |
| 19 * applications and 3D modelling software. | |
| 20 */ | |
| 21 interface PPB_MouseLock_Dev { | |
| 22 /** | |
| 23 * Requests the mouse to be locked. The browser will permit mouse lock only | |
| 24 * while the tab is in fullscreen mode. | |
| 25 * | |
| 26 * While the mouse is locked, the cursor is implicitly hidden from the user. | |
| 27 * Any movement of the mouse will generate a | |
| 28 * <code>PP_INPUTEVENT_TYPE_MOUSEMOVE</code>. The <code>GetPosition</code> of | |
| 29 * <code>PPB_MouseInputEvent</code> reports the last known mouse position just | |
| 30 * as mouse lock was entered; while the <code>GetMovement</code> provides | |
| 31 * relative movement information, which indicates what the change in position | |
| 32 * of the mouse would be had it not been locked. | |
| 33 * | |
| 34 * The browser may revoke mouse lock for reasons including but not limited to | |
| 35 * the user pressing the ESC key, the user activating another program via a | |
| 36 * reserved keystroke (e.g., ALT+TAB), or some other system event. | |
| 37 * | |
| 38 * @param[in] instance A <code>PP_Instance</code> identifying one instance | |
| 39 * of a module. | |
| 40 * @param[in] callback A <code>PP_CompletionCallback</code> to be called upon | |
| 41 * completion. | |
| 42 * | |
| 43 * @return An int32_t containing an error code from <code>pp_errors.h</code>. | |
| 44 */ | |
| 45 int32_t LockMouse([in] PP_Instance instance, | |
| 46 [in] PP_CompletionCallback callback); | |
| 47 | |
| 48 /** | |
| 49 * Causes the mouse to be unlocked, allowing it to track user movement again. | |
| 50 * This is an asynchronous operation. The plugin instance will be notified via | |
| 51 * the <code>PPP_MouseLock</code> interface when it has lost the mouse lock. | |
| 52 * | |
| 53 * @param[in] instance A <code>PP_Instance</code> identifying one instance | |
| 54 * of a module. | |
| 55 */ | |
| 56 void UnlockMouse([in] PP_Instance instance); | |
| 57 }; | |
| OLD | NEW |