| 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_Gamepad_Dev</code> interface, which |
| 8 * provides access to gamepad devices. |
| 9 */ |
| 10 |
| 11 label Chrome { |
| 12 M18 = 0.1 |
| 13 }; |
| 14 |
| 15 /** |
| 16 * The data for one gamepad device. |
| 17 */ |
| 18 struct PP_GamepadData_Dev { |
| 19 /** |
| 20 * Is there a gamepad connected at this index? If this is false, no other |
| 21 * data in this structure is valid. |
| 22 */ |
| 23 char connected; |
| 24 |
| 25 /** |
| 26 * String identifier for the type of device/manufacturer. |
| 27 */ |
| 28 uint16_t[128] id; |
| 29 |
| 30 /** |
| 31 * Monotonically increasing value that is incremented when the data have |
| 32 * been updated. |
| 33 */ |
| 34 uint64_t timestamp; |
| 35 |
| 36 /** |
| 37 * Number of valid elements in the |axes| array. |
| 38 */ |
| 39 uint32_t axes_length; |
| 40 |
| 41 /** |
| 42 * Normalized values for the axes, indices valid up to |axesLength|-1. Axis |
| 43 * values range from -1..1, and are in order of "importance". |
| 44 */ |
| 45 float_t[16] axes; |
| 46 |
| 47 /** |
| 48 * Number of valid elements in the |buttons| array. |
| 49 */ |
| 50 uint32_t buttons_length; |
| 51 |
| 52 /** |
| 53 * Normalized values for the buttons, indices valid up to |buttonsLength| |
| 54 * - 1. Button values range from 0..1, and are in order of importance. |
| 55 */ |
| 56 float_t[32] buttons; |
| 57 }; |
| 58 |
| 59 /** |
| 60 * The data for all gamepads connected to the system. |
| 61 */ |
| 62 struct PP_GamepadsData_Dev { |
| 63 /** |
| 64 * Number of valid elements in the |items| array. |
| 65 */ |
| 66 uint32_t length; |
| 67 |
| 68 /** |
| 69 * Data for an individual gamepad device connected to the system. |
| 70 */ |
| 71 PP_GamepadData_Dev[4] items; |
| 72 }; |
| 73 |
| 74 /** |
| 75 * The <code>PPB_Gamepad_Dev</code> interface allows retrieving data from |
| 76 * gamepad/joystick devices that are connected to the system. |
| 77 */ |
| 78 [version=0.1, macro="PPB_GAMEPAD_DEV_INTERFACE"] |
| 79 interface PPB_Gamepad_Dev { |
| 80 /** |
| 81 * Samples the current state of the connected gamepads. |
| 82 */ |
| 83 void SampleGamepads( |
| 84 [in] PP_Instance instance, |
| 85 [out] PP_GamepadsData_Dev data); |
| 86 |
| 87 }; |
| OLD | NEW |