1 /* Copyright (c) 2012 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.
7 * This file defines the <code>PPB_Gamepad</code> interface, which
8 * provides access to gamepad devices.
18 * The data for one gamepad device.
21 struct PP_GamepadSampleData
{
23 * Number of valid elements in the |axes| array.
28 * Normalized values for the axes, indices valid up to |axes_length|-1. Axis
29 * values range from -1..1, and are in order of "importance".
34 * Number of valid elements in the |buttons| array.
36 uint32_t buttons_length
;
39 * Normalized values for the buttons, indices valid up to |buttons_length|
40 * - 1. Button values range from 0..1, and are in order of importance.
45 * Monotonically increasing value that is incremented when the data have
51 * Identifier for the type of device/manufacturer.
56 * Is there a gamepad connected at this index? If this is false, no other
57 * data in this structure is valid.
61 /* Padding to make the struct the same size between 64 and 32. */
66 * The data for all gamepads connected to the system.
69 struct PP_GamepadsSampleData
{
71 * Number of valid elements in the |items| array.
75 /* Padding to make the struct the same size between 64 and 32. */
79 * Data for an individual gamepad device connected to the system.
81 PP_GamepadSampleData
[4] items
;
85 * The <code>PPB_Gamepad</code> interface allows retrieving data from
86 * gamepad/joystick devices that are connected to the system.
88 [version=1.0, macro
="PPB_GAMEPAD_INTERFACE", singleton
]
89 interface PPB_Gamepad
{
91 * Samples the current state of the available gamepads.
93 [always_set_output_parameters
]
95 [in] PP_Instance instance
,
96 [out] PP_GamepadsSampleData data
);