OLD | NEW |
1 // Copyright 2016 The Chromium Authors. All rights reserved. | 1 // Copyright 2016 The Chromium Authors. All rights reserved. |
2 // Use of this source code is governed by a BSD-style license that can be | 2 // Use of this source code is governed by a BSD-style license that can be |
3 // found in the LICENSE file. | 3 // found in the LICENSE file. |
4 | 4 |
5 module device.mojom; | 5 module device.mojom; |
6 | 6 |
7 struct GamepadQuaternion { | 7 struct GamepadQuaternion { |
8 float x; | 8 float x; |
9 float y; | 9 float y; |
10 float z; | 10 float z; |
(...skipping 31 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
42 bool connected; | 42 bool connected; |
43 array<uint16> id; | 43 array<uint16> id; |
44 uint64 timestamp; | 44 uint64 timestamp; |
45 array<double> axes; | 45 array<double> axes; |
46 array<GamepadButton> buttons; | 46 array<GamepadButton> buttons; |
47 array<uint16> mapping; | 47 array<uint16> mapping; |
48 GamepadPose? pose; | 48 GamepadPose? pose; |
49 GamepadHand hand; | 49 GamepadHand hand; |
50 uint32 display_id; | 50 uint32 display_id; |
51 }; | 51 }; |
| 52 |
| 53 interface GamepadObserver { |
| 54 GamepadConnected(int32 index, Gamepad gamepad); |
| 55 GamepadDisconnected(int32 index, Gamepad gamepad); |
| 56 }; |
| 57 |
| 58 // Asks the browser process to start polling, and return a shared memory |
| 59 // handle that will hold the data from the hardware. See |
| 60 // gamepad_hardware_buffer.h for a description of how synchronization is |
| 61 // handled. The number of Starts should match the number of Stops. |
| 62 interface GamepadMonitor { |
| 63 [Sync] |
| 64 GamepadStartPolling() => (handle<shared_buffer> memory_handle); |
| 65 |
| 66 [Sync] |
| 67 GamepadStopPolling() => (); |
| 68 |
| 69 SetObserver(GamepadObserver gamepad_observer); |
| 70 }; |
OLD | NEW |