2 * Copyright 2021 RĂ©mi Bernon for CodeWeavers
4 * This library is free software; you can redistribute it and/or
5 * modify it under the terms of the GNU Lesser General Public
6 * License as published by the Free Software Foundation; either
7 * version 2.1 of the License, or (at your option) any later version.
9 * This library is distributed in the hope that it will be useful,
10 * but WITHOUT ANY WARRANTY; without even the implied warranty of
11 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
12 * Lesser General Public License for more details.
14 * You should have received a copy of the GNU Lesser General Public
15 * License along with this library; if not, write to the Free Software
16 * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301, USA
20 #pragma winrt ns_prefix
24 import
"inspectable.idl";
25 import
"asyncinfo.idl";
26 import
"eventtoken.idl";
27 import
"windowscontracts.idl";
28 import
"windows.foundation.idl";
29 import
"windows.devices.haptics.idl";
30 import
"windows.gaming.input.forcefeedback.idl";
31 import
"windows.system.idl";
32 import
"windows.devices.power.idl";
35 namespace Windows.Gaming.Input
{
36 typedef enum GamepadButtons GamepadButtons
;
37 typedef enum GameControllerButtonLabel GameControllerButtonLabel
;
38 typedef enum GameControllerSwitchKind GameControllerSwitchKind
;
39 typedef enum GameControllerSwitchPosition GameControllerSwitchPosition
;
40 typedef struct GamepadReading GamepadReading
;
41 typedef struct GamepadVibration GamepadVibration
;
42 interface IGameController
;
43 interface IGameControllerBatteryInfo
;
46 interface IGamepadStatics
;
47 interface IGamepadStatics2
;
48 interface IRawGameController
;
49 interface IRawGameController2
;
52 runtimeclass RawGameController
;
55 interface Windows.Foundation.EventHandler
<Windows.Gaming.Input.Gamepad
*>;
56 interface Windows.Foundation.EventHandler
<Windows.Gaming.Input.RawGameController
*>;
57 interface Windows.Foundation.TypedEventHandler
<Windows.Gaming.Input.IGameController
*, Windows.Gaming.Input.Headset
*>;
58 interface Windows.Foundation.TypedEventHandler
<Windows.Gaming.Input.IGameController
*, Windows.System.UserChangedEventArgs
*>;
59 interface Windows.Foundation.Collections.IIterator
<Windows.Gaming.Input.Gamepad
*>;
60 interface Windows.Foundation.Collections.IIterable
<Windows.Gaming.Input.Gamepad
*>;
61 interface Windows.Foundation.Collections.IVectorView
<Windows.Gaming.Input.Gamepad
*>;
62 interface Windows.Foundation.Collections.IVector
<Windows.Gaming.Input.Gamepad
*>;
63 interface Windows.Foundation.Collections.IIterator
<Windows.Gaming.Input.RawGameController
*>;
64 interface Windows.Foundation.Collections.IIterable
<Windows.Gaming.Input.RawGameController
*>;
65 interface Windows.Foundation.Collections.IVectorView
<Windows.Gaming.Input.RawGameController
*>;
66 interface Windows.Foundation.Collections.IVector
<Windows.Gaming.Input.RawGameController
*>;
70 contract
(Windows.Foundation.UniversalApiContract
, 1.0),
87 RightShoulder
= 0x800,
88 LeftThumbstick
= 0x1000,
89 RightThumbstick
= 0x2000,
90 [contract
(Windows.Foundation.UniversalApiContract
, 3.0)]
92 [contract
(Windows.Foundation.UniversalApiContract
, 3.0)]
94 [contract
(Windows.Foundation.UniversalApiContract
, 3.0)]
96 [contract
(Windows.Foundation.UniversalApiContract
, 3.0)]
100 [contract
(Windows.Foundation.UniversalApiContract
, 3.0)]
101 enum GameControllerButtonLabel
117 XboxLeftTrigger
= 14,
118 XboxLeftStickButton
= 15,
119 XboxRightBumper
= 16,
120 XboxRightTrigger
= 17,
121 XboxRightStickButton
= 18,
152 LeftStickButton
= 49,
158 RightStickButton
= 55,
174 [contract
(Windows.Foundation.UniversalApiContract
, 4.0)]
175 enum GameControllerSwitchKind
182 [contract
(Windows.Foundation.UniversalApiContract
, 4.0)]
183 enum GameControllerSwitchPosition
196 [contract
(Windows.Foundation.UniversalApiContract
, 1.0)]
197 struct GamepadReading
200 Windows.Gaming.Input.GamepadButtons Buttons
;
203 DOUBLE LeftThumbstickX
;
204 DOUBLE LeftThumbstickY
;
205 DOUBLE RightThumbstickX
;
206 DOUBLE RightThumbstickY
;
209 [contract
(Windows.Foundation.UniversalApiContract
, 1.0)]
210 struct GamepadVibration
219 contract
(Windows.Foundation.UniversalApiContract
, 1.0),
220 uuid(1baf6522
-5f64
-42c5
-8267-b9fe2215bfbd
)
222 interface IGameController
: IInspectable
224 [eventadd
] HRESULT HeadsetConnected
([in] Windows.Foundation.TypedEventHandler
<Windows.Gaming.Input.IGameController
*, Windows.Gaming.Input.Headset
*> *handler
,
225 [out, retval] EventRegistrationToken
*token
);
226 [eventremove
] HRESULT HeadsetConnected
([in] EventRegistrationToken token
);
227 [eventadd
] HRESULT HeadsetDisconnected
([in] Windows.Foundation.TypedEventHandler
<Windows.Gaming.Input.IGameController
*, Windows.Gaming.Input.Headset
*> *handler
,
228 [out, retval] EventRegistrationToken
*token
);
229 [eventremove
] HRESULT HeadsetDisconnected
([in] EventRegistrationToken token
);
230 [eventadd
] HRESULT UserChanged
([in] Windows.Foundation.TypedEventHandler
<Windows.Gaming.Input.IGameController
*, Windows.System.UserChangedEventArgs
*> *handler
,
231 [out, retval] EventRegistrationToken
*token
);
232 [eventremove
] HRESULT UserChanged
([in] EventRegistrationToken token
);
233 [propget] HRESULT Headset
([out, retval] Windows.Gaming.Input.Headset
**value
);
234 [propget] HRESULT IsWireless
([out, retval] boolean *value
);
235 [propget] HRESULT User
([out, retval] Windows.System.User
**value
);
239 contract
(Windows.Foundation.UniversalApiContract
, 1.0),
240 exclusiveto
(Windows.Gaming.Input.Gamepad
),
241 uuid(bc7bb43c
-0a69
-3903-9e9d
-a50f86a45de5
)
243 interface IGamepad
: IInspectable
244 requires Windows.Gaming.Input.IGameController
246 [propget] HRESULT Vibration
([out, retval] Windows.Gaming.Input.GamepadVibration
*value
);
247 [propput] HRESULT Vibration
([in] Windows.Gaming.Input.GamepadVibration value
);
248 HRESULT GetCurrentReading
([out, retval] Windows.Gaming.Input.GamepadReading
*value
);
252 contract
(Windows.Foundation.UniversalApiContract
, 4.0),
253 exclusiveto
(Windows.Gaming.Input.RawGameController
),
254 uuid(7cad6d91
-a7e1
-4f71
-9a78
-33e9c5dfea62
)
256 interface IRawGameController
: IInspectable
257 requires Windows.Gaming.Input.IGameController
259 [propget] HRESULT AxisCount
([out, retval] INT32
*value
);
260 [propget] HRESULT ButtonCount
([out, retval] INT32
*value
);
261 [propget] HRESULT ForceFeedbackMotors
([out, retval] Windows.Foundation.Collections.IVectorView
<Windows.Gaming.Input.ForceFeedback.ForceFeedbackMotor
*> **value
);
262 [propget] HRESULT HardwareProductId
([out, retval] UINT16
*value
);
263 [propget] HRESULT HardwareVendorId
([out, retval] UINT16
*value
);
264 [propget] HRESULT SwitchCount
([out, retval] INT32
*value
);
265 HRESULT GetButtonLabel
([in] INT32 index
, [out, retval] Windows.Gaming.Input.GameControllerButtonLabel
*value
);
266 HRESULT GetCurrentReading
([in] UINT32 buttons_size
, [out, size_is(buttons_size
)] boolean *buttons
,
267 [in] UINT32 switches_size
, [out, size_is(switches_size
)] Windows.Gaming.Input.GameControllerSwitchPosition
*switches
,
268 [in] UINT32 axes_size
, [out, size_is(axes_size
)] DOUBLE *axes
,
269 [out, retval] UINT64
*timestamp
);
270 HRESULT GetSwitchKind
([in] INT32 index
, [out, retval] Windows.Gaming.Input.GameControllerSwitchKind
*value
);
274 contract
(Windows.Foundation.UniversalApiContract
, 5.0),
275 exclusiveto
(Windows.Gaming.Input.RawGameController
),
276 uuid(43c0c035
-bb73
-4756-a787
-3ed6bea617bd
)
278 interface IRawGameController2
: IInspectable
279 requires Windows.Gaming.Input.IRawGameController
,
280 Windows.Gaming.Input.IGameController
282 [propget] HRESULT SimpleHapticsControllers
([out, retval] Windows.Foundation.Collections.IVectorView
<Windows.Devices.Haptics.SimpleHapticsController
*> **value
);
283 [propget] HRESULT NonRoamableId
([out, retval] HSTRING
*value
);
284 [propget] HRESULT DisplayName
([out, retval] HSTRING
*value
);
289 uuid(8bbce529
-d49c
-39e9
-9560-e47dde96b7c8
)
291 interface IGamepadStatics
: IInspectable
293 [eventadd
] HRESULT GamepadAdded
([in] Windows.Foundation.EventHandler
<Gamepad
*> *value
, [out, retval] EventRegistrationToken
*token
);
294 [eventremove
] HRESULT GamepadAdded
([in] EventRegistrationToken token
);
295 [eventadd
] HRESULT GamepadRemoved
([in] Windows.Foundation.EventHandler
<Gamepad
*> *value
, [out, retval] EventRegistrationToken
*token
);
296 [eventremove
] HRESULT GamepadRemoved
([in] EventRegistrationToken token
);
297 [propget] HRESULT Gamepads
([out, retval] Windows.Foundation.Collections.IVectorView
<Gamepad
*> **value
);
301 contract
(Windows.Foundation.UniversalApiContract
, 4.0),
302 exclusiveto
(Windows.Gaming.Input.Gamepad
),
303 uuid(42676dc5
-0856-47c4
-9213-b395504c3a3c
)
305 interface IGamepadStatics2
: IInspectable
306 requires Windows.Gaming.Input.IGamepadStatics
308 HRESULT FromGameController
([in] Windows.Gaming.Input.IGameController
*controller
,
309 [out, retval] Windows.Gaming.Input.Gamepad
**value
);
313 contract
(Windows.Foundation.UniversalApiContract
, 1.0),
314 exclusiveto
(Windows.Gaming.Input.Headset
),
315 uuid(3fd156ef
-6925-3fa8
-9181-029c5223ae3b
)
317 interface IHeadset
: IInspectable
319 [propget] HRESULT CaptureDeviceId
([out, retval] HSTRING
*value
);
320 [propget] HRESULT RenderDeviceId
([out, retval] HSTRING
*value
);
325 uuid(eb8d0792
-e95a
-4b19
-afc7
-0a59f8bf759e
)
327 interface IRawGameControllerStatics
: IInspectable
329 [eventadd
] HRESULT RawGameControllerAdded
([in] Windows.Foundation.EventHandler
<Windows.Gaming.Input.RawGameController
*> *handler
,
330 [out, retval] EventRegistrationToken
*token
);
331 [eventremove
] HRESULT RawGameControllerAdded
([in] EventRegistrationToken token
);
332 [eventadd
] HRESULT RawGameControllerRemoved
([in] Windows.Foundation.EventHandler
<Windows.Gaming.Input.RawGameController
*> *handler
,
333 [out, retval] EventRegistrationToken
*token
);
334 [eventremove
] HRESULT RawGameControllerRemoved
([in] EventRegistrationToken token
);
335 [propget] HRESULT RawGameControllers
([out, retval] Windows.Foundation.Collections.IVectorView
<Windows.Gaming.Input.RawGameController
*> **value
);
336 HRESULT FromGameController
([in] Windows.Gaming.Input.IGameController
*game_controller
, [out, retval] Windows.Gaming.Input.RawGameController
**value
);
340 contract
(Windows.Foundation.UniversalApiContract
, 4.0),
341 uuid(dcecc681
-3963-4da6
-955d
-553f3b6f6161
)
343 interface IGameControllerBatteryInfo
: IInspectable
345 HRESULT TryGetBatteryReport
([out, retval] Windows.Devices.Power.BatteryReport
**value
);
349 contract
(Windows.Foundation.UniversalApiContract
, 1.0),
350 marshaling_behavior
(agile
),
351 static
(Windows.Gaming.Input.IGamepadStatics
, Windows.Foundation.UniversalApiContract
, 1.0),
352 static
(Windows.Gaming.Input.IGamepadStatics2
, Windows.Foundation.UniversalApiContract
, 4.0),
357 [default] interface Windows.Gaming.Input.IGamepad
;
358 interface Windows.Gaming.Input.IGameController
;
359 [contract
(Windows.Foundation.UniversalApiContract
, 3.0)] interface Windows.Gaming.Input.IGamepad2
;
360 [contract
(Windows.Foundation.UniversalApiContract
, 4.0)] interface Windows.Gaming.Input.IGameControllerBatteryInfo
;
364 contract
(Windows.Foundation.UniversalApiContract
, 1.0),
365 marshaling_behavior
(agile
),
370 [default] interface Windows.Gaming.Input.IHeadset
;
371 [contract
(Windows.Foundation.UniversalApiContract
, 4.0)] interface Windows.Gaming.Input.IGameControllerBatteryInfo
;
375 contract
(Windows.Foundation.UniversalApiContract
, 4.0),
376 marshaling_behavior
(agile
),
377 static
(Windows.Gaming.Input.IRawGameControllerStatics
, Windows.Foundation.UniversalApiContract
, 4.0),
380 runtimeclass RawGameController
382 [default] interface Windows.Gaming.Input.IRawGameController
;
383 interface Windows.Gaming.Input.IGameController
;
384 interface Windows.Gaming.Input.IGameControllerBatteryInfo
;
385 [contract
(Windows.Foundation.UniversalApiContract
, 5.0)] interface Windows.Gaming.Input.IRawGameController2
;