windows.gaming.input.idl 28 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613614615616617618619620621622623624625626627628629630631632633634635636637638639640641642643644645646647648649650651652653654655656657658659660661662663664665666667668669670671672673674675676677678679680681682683
  1. /*
  2. * Copyright 2021 Rémi Bernon for CodeWeavers
  3. *
  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.
  8. *
  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.
  13. *
  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
  17. */
  18. #ifdef __WIDL__
  19. #pragma winrt ns_prefix
  20. #endif
  21. #ifndef DO_NO_IMPORTS
  22. import "inspectable.idl";
  23. import "asyncinfo.idl";
  24. import "eventtoken.idl";
  25. import "windowscontracts.idl";
  26. import "windows.foundation.idl";
  27. import "windows.devices.haptics.idl";
  28. import "windows.gaming.input.forcefeedback.idl";
  29. import "windows.system.idl";
  30. import "windows.devices.power.idl";
  31. #endif
  32. namespace Windows.Gaming.Input {
  33. typedef enum ArcadeStickButtons ArcadeStickButtons;
  34. typedef enum FlightStickButtons FlightStickButtons;
  35. typedef enum GamepadButtons GamepadButtons;
  36. typedef enum GameControllerButtonLabel GameControllerButtonLabel;
  37. typedef enum GameControllerSwitchKind GameControllerSwitchKind;
  38. typedef enum GameControllerSwitchPosition GameControllerSwitchPosition;
  39. typedef enum RacingWheelButtons RacingWheelButtons;
  40. typedef struct ArcadeStickReading ArcadeStickReading;
  41. typedef struct FlightStickReading FlightStickReading;
  42. typedef struct GamepadReading GamepadReading;
  43. typedef struct GamepadVibration GamepadVibration;
  44. typedef struct RacingWheelReading RacingWheelReading;
  45. interface IArcadeStick;
  46. interface IArcadeStickStatics;
  47. interface IArcadeStickStatics2;
  48. interface IFlightStick;
  49. interface IFlightStickStatics;
  50. interface IGameController;
  51. interface IGameControllerBatteryInfo;
  52. interface IGamepad;
  53. interface IGamepad2;
  54. interface IGamepadStatics;
  55. interface IGamepadStatics2;
  56. interface IRacingWheel;
  57. interface IRacingWheelStatics;
  58. interface IRacingWheelStatics2;
  59. interface IRawGameController;
  60. interface IRawGameController2;
  61. runtimeclass ArcadeStick;
  62. runtimeclass FlightStick;
  63. runtimeclass Gamepad;
  64. runtimeclass Headset;
  65. runtimeclass RacingWheel;
  66. runtimeclass RawGameController;
  67. declare {
  68. interface Windows.Foundation.EventHandler<Windows.Gaming.Input.ArcadeStick *>;
  69. interface Windows.Foundation.EventHandler<Windows.Gaming.Input.FlightStick *>;
  70. interface Windows.Foundation.EventHandler<Windows.Gaming.Input.Gamepad *>;
  71. interface Windows.Foundation.EventHandler<Windows.Gaming.Input.RacingWheel *>;
  72. interface Windows.Foundation.EventHandler<Windows.Gaming.Input.RawGameController *>;
  73. interface Windows.Foundation.TypedEventHandler<Windows.Gaming.Input.IGameController *, Windows.Gaming.Input.Headset *>;
  74. interface Windows.Foundation.TypedEventHandler<Windows.Gaming.Input.IGameController *, Windows.System.UserChangedEventArgs *>;
  75. interface Windows.Foundation.Collections.IIterator<Windows.Gaming.Input.ArcadeStick *>;
  76. interface Windows.Foundation.Collections.IIterable<Windows.Gaming.Input.ArcadeStick *>;
  77. interface Windows.Foundation.Collections.IVectorView<Windows.Gaming.Input.ArcadeStick *>;
  78. interface Windows.Foundation.Collections.IIterator<Windows.Gaming.Input.FlightStick *>;
  79. interface Windows.Foundation.Collections.IIterable<Windows.Gaming.Input.FlightStick *>;
  80. interface Windows.Foundation.Collections.IVectorView<Windows.Gaming.Input.FlightStick *>;
  81. interface Windows.Foundation.Collections.IIterator<Windows.Gaming.Input.Gamepad *>;
  82. interface Windows.Foundation.Collections.IIterable<Windows.Gaming.Input.Gamepad *>;
  83. interface Windows.Foundation.Collections.IVectorView<Windows.Gaming.Input.Gamepad *>;
  84. interface Windows.Foundation.Collections.IVector<Windows.Gaming.Input.Gamepad *>;
  85. interface Windows.Foundation.Collections.IIterator<Windows.Gaming.Input.RacingWheel *>;
  86. interface Windows.Foundation.Collections.IIterable<Windows.Gaming.Input.RacingWheel *>;
  87. interface Windows.Foundation.Collections.IVectorView<Windows.Gaming.Input.RacingWheel *>;
  88. interface Windows.Foundation.Collections.IVector<Windows.Gaming.Input.RacingWheel *>;
  89. interface Windows.Foundation.Collections.IIterator<Windows.Gaming.Input.RawGameController *>;
  90. interface Windows.Foundation.Collections.IIterable<Windows.Gaming.Input.RawGameController *>;
  91. interface Windows.Foundation.Collections.IVectorView<Windows.Gaming.Input.RawGameController *>;
  92. interface Windows.Foundation.Collections.IVector<Windows.Gaming.Input.RawGameController *>;
  93. }
  94. [
  95. contract(Windows.Foundation.UniversalApiContract, 3.0),
  96. flags
  97. ]
  98. enum ArcadeStickButtons
  99. {
  100. None = 0x0,
  101. StickUp = 0x1,
  102. StickDown = 0x2,
  103. StickLeft = 0x4,
  104. StickRight = 0x8,
  105. Action1 = 0x10,
  106. Action2 = 0x20,
  107. Action3 = 0x40,
  108. Action4 = 0x80,
  109. Action5 = 0x100,
  110. Action6 = 0x200,
  111. Special1 = 0x400,
  112. Special2 = 0x800
  113. };
  114. [
  115. contract(Windows.Foundation.UniversalApiContract, 4.0),
  116. flags
  117. ]
  118. enum FlightStickButtons
  119. {
  120. None = 0x0,
  121. FirePrimary = 0x1,
  122. FireSecondary = 0x2,
  123. };
  124. [
  125. contract(Windows.Foundation.UniversalApiContract, 1.0),
  126. flags
  127. ]
  128. enum GamepadButtons
  129. {
  130. None = 0x0,
  131. Menu = 0x1,
  132. View = 0x2,
  133. A = 0x4,
  134. B = 0x8,
  135. X = 0x10,
  136. Y = 0x20,
  137. DPadUp = 0x40,
  138. DPadDown = 0x80,
  139. DPadLeft = 0x100,
  140. DPadRight = 0x200,
  141. LeftShoulder = 0x400,
  142. RightShoulder = 0x800,
  143. LeftThumbstick = 0x1000,
  144. RightThumbstick = 0x2000,
  145. [contract(Windows.Foundation.UniversalApiContract, 3.0)]
  146. Paddle1 = 0x4000,
  147. [contract(Windows.Foundation.UniversalApiContract, 3.0)]
  148. Paddle2 = 0x8000,
  149. [contract(Windows.Foundation.UniversalApiContract, 3.0)]
  150. Paddle3 = 0x10000,
  151. [contract(Windows.Foundation.UniversalApiContract, 3.0)]
  152. Paddle4 = 0x20000
  153. };
  154. [contract(Windows.Foundation.UniversalApiContract, 3.0)]
  155. enum GameControllerButtonLabel
  156. {
  157. None = 0,
  158. XboxBack = 1,
  159. XboxStart = 2,
  160. XboxMenu = 3,
  161. XboxView = 4,
  162. XboxUp = 5,
  163. XboxDown = 6,
  164. XboxLeft = 7,
  165. XboxRight = 8,
  166. XboxA = 9,
  167. XboxB = 10,
  168. XboxX = 11,
  169. XboxY = 12,
  170. XboxLeftBumper = 13,
  171. XboxLeftTrigger = 14,
  172. XboxLeftStickButton = 15,
  173. XboxRightBumper = 16,
  174. XboxRightTrigger = 17,
  175. XboxRightStickButton = 18,
  176. XboxPaddle1 = 19,
  177. XboxPaddle2 = 20,
  178. XboxPaddle3 = 21,
  179. XboxPaddle4 = 22,
  180. Mode = 23,
  181. Select = 24,
  182. Menu = 25,
  183. View = 26,
  184. Back = 27,
  185. Start = 28,
  186. Options = 29,
  187. Share = 30,
  188. Up = 31,
  189. Down = 32,
  190. Left = 33,
  191. Right = 34,
  192. LetterA = 35,
  193. LetterB = 36,
  194. LetterC = 37,
  195. LetterL = 38,
  196. LetterR = 39,
  197. LetterX = 40,
  198. LetterY = 41,
  199. LetterZ = 42,
  200. Cross = 43,
  201. Circle = 44,
  202. Square = 45,
  203. Triangle = 46,
  204. LeftBumper = 47,
  205. LeftTrigger = 48,
  206. LeftStickButton = 49,
  207. Left1 = 50,
  208. Left2 = 51,
  209. Left3 = 52,
  210. RightBumper = 53,
  211. RightTrigger = 54,
  212. RightStickButton = 55,
  213. Right1 = 56,
  214. Right2 = 57,
  215. Right3 = 58,
  216. Paddle1 = 59,
  217. Paddle2 = 60,
  218. Paddle3 = 61,
  219. Paddle4 = 62,
  220. Plus = 63,
  221. Minus = 64,
  222. DownLeftArrow = 65,
  223. DialLeft = 66,
  224. DialRight = 67,
  225. Suspension = 68
  226. };
  227. [contract(Windows.Foundation.UniversalApiContract, 4.0)]
  228. enum GameControllerSwitchKind
  229. {
  230. TwoWay = 0,
  231. FourWay = 1,
  232. EightWay = 2
  233. };
  234. [contract(Windows.Foundation.UniversalApiContract, 4.0)]
  235. enum GameControllerSwitchPosition
  236. {
  237. Center = 0,
  238. Up = 1,
  239. UpRight = 2,
  240. Right = 3,
  241. DownRight = 4,
  242. Down = 5,
  243. DownLeft = 6,
  244. Left = 7,
  245. UpLeft = 8
  246. };
  247. [
  248. contract(Windows.Foundation.UniversalApiContract, 3.0),
  249. flags
  250. ]
  251. enum RacingWheelButtons
  252. {
  253. None = 0x0,
  254. PreviousGear = 0x1,
  255. NextGear = 0x2,
  256. DPadUp = 0x4,
  257. DPadDown = 0x8,
  258. DPadLeft = 0x10,
  259. DPadRight = 0x20,
  260. Button1 = 0x40,
  261. Button2 = 0x80,
  262. Button3 = 0x100,
  263. Button4 = 0x200,
  264. Button5 = 0x400,
  265. Button6 = 0x800,
  266. Button7 = 0x1000,
  267. Button8 = 0x2000,
  268. Button9 = 0x4000,
  269. Button10 = 0x8000,
  270. Button11 = 0x10000,
  271. Button12 = 0x20000,
  272. Button13 = 0x40000,
  273. Button14 = 0x80000,
  274. Button15 = 0x100000,
  275. Button16 = 0x200000,
  276. };
  277. [contract(Windows.Foundation.UniversalApiContract, 3.0)]
  278. struct ArcadeStickReading
  279. {
  280. UINT64 Timestamp;
  281. Windows.Gaming.Input.ArcadeStickButtons Buttons;
  282. };
  283. [contract(Windows.Foundation.UniversalApiContract, 4.0)]
  284. struct FlightStickReading
  285. {
  286. UINT64 Timestamp;
  287. Windows.Gaming.Input.FlightStickButtons Buttons;
  288. Windows.Gaming.Input.GameControllerSwitchPosition HatSwitch;
  289. DOUBLE Roll;
  290. DOUBLE Pitch;
  291. DOUBLE Yaw;
  292. DOUBLE Throttle;
  293. };
  294. [contract(Windows.Foundation.UniversalApiContract, 1.0)]
  295. struct GamepadReading
  296. {
  297. UINT64 Timestamp;
  298. Windows.Gaming.Input.GamepadButtons Buttons;
  299. DOUBLE LeftTrigger;
  300. DOUBLE RightTrigger;
  301. DOUBLE LeftThumbstickX;
  302. DOUBLE LeftThumbstickY;
  303. DOUBLE RightThumbstickX;
  304. DOUBLE RightThumbstickY;
  305. };
  306. [contract(Windows.Foundation.UniversalApiContract, 1.0)]
  307. struct GamepadVibration
  308. {
  309. DOUBLE LeftMotor;
  310. DOUBLE RightMotor;
  311. DOUBLE LeftTrigger;
  312. DOUBLE RightTrigger;
  313. };
  314. [contract(Windows.Foundation.UniversalApiContract, 3.0)]
  315. struct RacingWheelReading
  316. {
  317. UINT64 Timestamp;
  318. Windows.Gaming.Input.RacingWheelButtons Buttons;
  319. INT32 PatternShifterGear;
  320. DOUBLE Wheel;
  321. DOUBLE Throttle;
  322. DOUBLE Brake;
  323. DOUBLE Clutch;
  324. DOUBLE Handbrake;
  325. };
  326. [
  327. contract(Windows.Foundation.UniversalApiContract, 3.0),
  328. exclusiveto(Windows.Gaming.Input.ArcadeStick),
  329. uuid(b14a539d-befb-4c81-8051-15ecf3b13036)
  330. ]
  331. interface IArcadeStick : IInspectable
  332. requires Windows.Gaming.Input.IGameController
  333. {
  334. HRESULT GetButtonLabel([in] Windows.Gaming.Input.ArcadeStickButtons button,
  335. [out, retval] Windows.Gaming.Input.GameControllerButtonLabel *value);
  336. HRESULT GetCurrentReading([out, retval] Windows.Gaming.Input.ArcadeStickReading *value);
  337. }
  338. [
  339. contract(Windows.Foundation.UniversalApiContract, 3.0),
  340. exclusiveto(Windows.Gaming.Input.ArcadeStick),
  341. uuid(5c37b8c8-37b1-4ad8-9458-200f1a30018e)
  342. ]
  343. interface IArcadeStickStatics : IInspectable
  344. {
  345. [eventadd] HRESULT ArcadeStickAdded([in] Windows.Foundation.EventHandler<Windows.Gaming.Input.ArcadeStick *> *value,
  346. [out, retval] EventRegistrationToken *token);
  347. [eventremove] HRESULT ArcadeStickAdded([in] EventRegistrationToken token);
  348. [eventadd] HRESULT ArcadeStickRemoved([in] Windows.Foundation.EventHandler<Windows.Gaming.Input.ArcadeStick *> *value,
  349. [out, retval] EventRegistrationToken *token);
  350. [eventremove] HRESULT ArcadeStickRemoved([in] EventRegistrationToken token);
  351. [propget] HRESULT ArcadeSticks([out, retval] Windows.Foundation.Collections.IVectorView<Windows.Gaming.Input.ArcadeStick *> **value);
  352. }
  353. [
  354. contract(Windows.Foundation.UniversalApiContract, 4.0),
  355. exclusiveto(Windows.Gaming.Input.ArcadeStick),
  356. uuid(52b5d744-bb86-445a-b59c-596f0e2a49df)
  357. ]
  358. interface IArcadeStickStatics2 : IInspectable
  359. requires Windows.Gaming.Input.IArcadeStickStatics
  360. {
  361. HRESULT FromGameController([in] Windows.Gaming.Input.IGameController *controller,
  362. [out, retval] Windows.Gaming.Input.ArcadeStick **value);
  363. }
  364. [
  365. contract(Windows.Foundation.UniversalApiContract, 4.0),
  366. exclusiveto(Windows.Gaming.Input.FlightStick),
  367. uuid(b4a2c01c-b83b-4459-a1a9-97b03c33da7c)
  368. ]
  369. interface IFlightStick : IInspectable
  370. requires Windows.Gaming.Input.IGameController
  371. {
  372. [propget] HRESULT HatSwitchKind([out, retval] Windows.Gaming.Input.GameControllerSwitchKind *value);
  373. HRESULT GetButtonLabel([in] Windows.Gaming.Input.FlightStickButtons button,
  374. [out, retval] Windows.Gaming.Input.GameControllerButtonLabel *value);
  375. HRESULT GetCurrentReading([out, retval] Windows.Gaming.Input.FlightStickReading *value);
  376. }
  377. [
  378. contract(Windows.Foundation.UniversalApiContract, 4.0),
  379. exclusiveto(Windows.Gaming.Input.FlightStick),
  380. uuid(5514924a-fecc-435e-83dc-5cec8a18a520)
  381. ]
  382. interface IFlightStickStatics : IInspectable
  383. {
  384. [eventadd] HRESULT FlightStickAdded([in] Windows.Foundation.EventHandler<Windows.Gaming.Input.FlightStick *> *value,
  385. [out, retval] EventRegistrationToken *token);
  386. [eventremove] HRESULT FlightStickAdded([in] EventRegistrationToken token);
  387. [eventadd] HRESULT FlightStickRemoved([in] Windows.Foundation.EventHandler<Windows.Gaming.Input.FlightStick *> *value,
  388. [out, retval] EventRegistrationToken *token);
  389. [eventremove] HRESULT FlightStickRemoved([in] EventRegistrationToken token);
  390. [propget] HRESULT FlightSticks([out, retval] Windows.Foundation.Collections.IVectorView<Windows.Gaming.Input.FlightStick *> **value);
  391. HRESULT FromGameController([in] Windows.Gaming.Input.IGameController *controller,
  392. [out, retval] Windows.Gaming.Input.FlightStick **value);
  393. }
  394. [
  395. contract(Windows.Foundation.UniversalApiContract, 1.0),
  396. uuid(1baf6522-5f64-42c5-8267-b9fe2215bfbd)
  397. ]
  398. interface IGameController : IInspectable
  399. {
  400. [eventadd] HRESULT HeadsetConnected([in] Windows.Foundation.TypedEventHandler<Windows.Gaming.Input.IGameController *, Windows.Gaming.Input.Headset *> *handler,
  401. [out, retval] EventRegistrationToken *token);
  402. [eventremove] HRESULT HeadsetConnected([in] EventRegistrationToken token);
  403. [eventadd] HRESULT HeadsetDisconnected([in] Windows.Foundation.TypedEventHandler<Windows.Gaming.Input.IGameController *, Windows.Gaming.Input.Headset *> *handler,
  404. [out, retval] EventRegistrationToken *token);
  405. [eventremove] HRESULT HeadsetDisconnected([in] EventRegistrationToken token);
  406. [eventadd] HRESULT UserChanged([in] Windows.Foundation.TypedEventHandler<Windows.Gaming.Input.IGameController *, Windows.System.UserChangedEventArgs *> *handler,
  407. [out, retval] EventRegistrationToken *token);
  408. [eventremove] HRESULT UserChanged([in] EventRegistrationToken token);
  409. [propget] HRESULT Headset([out, retval] Windows.Gaming.Input.Headset **value);
  410. [propget] HRESULT IsWireless([out, retval] boolean *value);
  411. [propget] HRESULT User([out, retval] Windows.System.User **value);
  412. }
  413. [
  414. contract(Windows.Foundation.UniversalApiContract, 1.0),
  415. exclusiveto(Windows.Gaming.Input.Gamepad),
  416. uuid(bc7bb43c-0a69-3903-9e9d-a50f86a45de5)
  417. ]
  418. interface IGamepad : IInspectable
  419. requires Windows.Gaming.Input.IGameController
  420. {
  421. [propget] HRESULT Vibration([out, retval] Windows.Gaming.Input.GamepadVibration *value);
  422. [propput] HRESULT Vibration([in] Windows.Gaming.Input.GamepadVibration value);
  423. HRESULT GetCurrentReading([out, retval] Windows.Gaming.Input.GamepadReading *value);
  424. }
  425. [
  426. contract(Windows.Foundation.UniversalApiContract, 3.0),
  427. exclusiveto(Windows.Gaming.Input.Gamepad),
  428. uuid(3c1689bd-5915-4245-b0c0-c89fae0308ff)
  429. ]
  430. interface IGamepad2 : IInspectable
  431. requires Windows.Gaming.Input.IGamepad,
  432. Windows.Gaming.Input.IGameController
  433. {
  434. HRESULT GetButtonLabel([in] Windows.Gaming.Input.GamepadButtons button,
  435. [out, retval] Windows.Gaming.Input.GameControllerButtonLabel *value);
  436. }
  437. [
  438. contract(Windows.Foundation.UniversalApiContract, 3.0),
  439. exclusiveto(Windows.Gaming.Input.RacingWheel),
  440. uuid(f546656f-e106-4c82-a90f-554012904b85)
  441. ]
  442. interface IRacingWheel : IInspectable
  443. requires Windows.Gaming.Input.IGameController
  444. {
  445. [propget] HRESULT HasClutch([out, retval] boolean *value);
  446. [propget] HRESULT HasHandbrake([out, retval] boolean *value);
  447. [propget] HRESULT HasPatternShifter([out, retval] boolean *value);
  448. [propget] HRESULT MaxPatternShifterGear([out, retval] INT32 *value);
  449. [propget] HRESULT MaxWheelAngle([out, retval] DOUBLE *value);
  450. [propget] HRESULT WheelMotor([out, retval] Windows.Gaming.Input.ForceFeedback.ForceFeedbackMotor **value);
  451. HRESULT GetButtonLabel([in] Windows.Gaming.Input.RacingWheelButtons button, [out, retval] Windows.Gaming.Input.GameControllerButtonLabel *value);
  452. HRESULT GetCurrentReading([out, retval] Windows.Gaming.Input.RacingWheelReading *value);
  453. }
  454. [
  455. contract(Windows.Foundation.UniversalApiContract, 3.0),
  456. exclusiveto(Windows.Gaming.Input.RacingWheel),
  457. uuid(3ac12cd5-581b-4936-9f94-69f1e6514c7d)
  458. ]
  459. interface IRacingWheelStatics : IInspectable
  460. {
  461. [eventadd] HRESULT RacingWheelAdded([in] Windows.Foundation.EventHandler<RacingWheel *> *value, [out, retval] EventRegistrationToken *token);
  462. [eventremove] HRESULT RacingWheelAdded([in] EventRegistrationToken token);
  463. [eventadd] HRESULT RacingWheelRemoved([in] Windows.Foundation.EventHandler<RacingWheel *> *value, [out, retval] EventRegistrationToken *token);
  464. [eventremove] HRESULT RacingWheelRemoved([in] EventRegistrationToken token);
  465. [propget] HRESULT RacingWheels([out, retval] Windows.Foundation.Collections.IVectorView<RacingWheel *> **value);
  466. }
  467. [
  468. contract(Windows.Foundation.UniversalApiContract, 4.0),
  469. exclusiveto(Windows.Gaming.Input.RacingWheel),
  470. uuid(e666bcaa-edfd-4323-a9f6-3c384048d1ed)
  471. ]
  472. interface IRacingWheelStatics2 : IInspectable
  473. requires Windows.Gaming.Input.IRacingWheelStatics
  474. {
  475. HRESULT FromGameController([in] Windows.Gaming.Input.IGameController *controller,
  476. [out, retval] Windows.Gaming.Input.RacingWheel **value);
  477. }
  478. [
  479. contract(Windows.Foundation.UniversalApiContract, 4.0),
  480. exclusiveto(Windows.Gaming.Input.RawGameController),
  481. uuid(7cad6d91-a7e1-4f71-9a78-33e9c5dfea62)
  482. ]
  483. interface IRawGameController : IInspectable
  484. requires Windows.Gaming.Input.IGameController
  485. {
  486. [propget] HRESULT AxisCount([out, retval] INT32 *value);
  487. [propget] HRESULT ButtonCount([out, retval] INT32 *value);
  488. [propget] HRESULT ForceFeedbackMotors([out, retval] Windows.Foundation.Collections.IVectorView<Windows.Gaming.Input.ForceFeedback.ForceFeedbackMotor *> **value);
  489. [propget] HRESULT HardwareProductId([out, retval] UINT16 *value);
  490. [propget] HRESULT HardwareVendorId([out, retval] UINT16 *value);
  491. [propget] HRESULT SwitchCount([out, retval] INT32 *value);
  492. HRESULT GetButtonLabel([in] INT32 index, [out, retval] Windows.Gaming.Input.GameControllerButtonLabel *value);
  493. HRESULT GetCurrentReading([in] UINT32 buttons_size, [out, size_is(buttons_size)] boolean *buttons,
  494. [in] UINT32 switches_size, [out, size_is(switches_size)] Windows.Gaming.Input.GameControllerSwitchPosition *switches,
  495. [in] UINT32 axes_size, [out, size_is(axes_size)] DOUBLE *axes,
  496. [out, retval] UINT64 *timestamp);
  497. HRESULT GetSwitchKind([in] INT32 index, [out, retval] Windows.Gaming.Input.GameControllerSwitchKind *value);
  498. }
  499. [
  500. contract(Windows.Foundation.UniversalApiContract, 5.0),
  501. exclusiveto(Windows.Gaming.Input.RawGameController),
  502. uuid(43c0c035-bb73-4756-a787-3ed6bea617bd)
  503. ]
  504. interface IRawGameController2 : IInspectable
  505. requires Windows.Gaming.Input.IRawGameController,
  506. Windows.Gaming.Input.IGameController
  507. {
  508. [propget] HRESULT SimpleHapticsControllers([out, retval] Windows.Foundation.Collections.IVectorView<Windows.Devices.Haptics.SimpleHapticsController *> **value);
  509. [propget] HRESULT NonRoamableId([out, retval] HSTRING *value);
  510. [propget] HRESULT DisplayName([out, retval] HSTRING *value);
  511. }
  512. [
  513. object,
  514. uuid(8bbce529-d49c-39e9-9560-e47dde96b7c8)
  515. ]
  516. interface IGamepadStatics : IInspectable
  517. {
  518. [eventadd] HRESULT GamepadAdded([in] Windows.Foundation.EventHandler<Gamepad *> *value, [out, retval] EventRegistrationToken *token);
  519. [eventremove] HRESULT GamepadAdded([in] EventRegistrationToken token);
  520. [eventadd] HRESULT GamepadRemoved([in] Windows.Foundation.EventHandler<Gamepad *> *value, [out, retval] EventRegistrationToken *token);
  521. [eventremove] HRESULT GamepadRemoved([in] EventRegistrationToken token);
  522. [propget] HRESULT Gamepads([out, retval] Windows.Foundation.Collections.IVectorView<Gamepad *> **value);
  523. }
  524. [
  525. contract(Windows.Foundation.UniversalApiContract, 4.0),
  526. exclusiveto(Windows.Gaming.Input.Gamepad),
  527. uuid(42676dc5-0856-47c4-9213-b395504c3a3c)
  528. ]
  529. interface IGamepadStatics2 : IInspectable
  530. requires Windows.Gaming.Input.IGamepadStatics
  531. {
  532. HRESULT FromGameController([in] Windows.Gaming.Input.IGameController *controller,
  533. [out, retval] Windows.Gaming.Input.Gamepad **value);
  534. }
  535. [
  536. contract(Windows.Foundation.UniversalApiContract, 1.0),
  537. exclusiveto(Windows.Gaming.Input.Headset),
  538. uuid(3fd156ef-6925-3fa8-9181-029c5223ae3b)
  539. ]
  540. interface IHeadset : IInspectable
  541. {
  542. [propget] HRESULT CaptureDeviceId([out, retval] HSTRING *value);
  543. [propget] HRESULT RenderDeviceId([out, retval] HSTRING *value);
  544. }
  545. [
  546. object,
  547. uuid(eb8d0792-e95a-4b19-afc7-0a59f8bf759e)
  548. ]
  549. interface IRawGameControllerStatics : IInspectable
  550. {
  551. [eventadd] HRESULT RawGameControllerAdded([in] Windows.Foundation.EventHandler<Windows.Gaming.Input.RawGameController *> *handler,
  552. [out, retval] EventRegistrationToken *token);
  553. [eventremove] HRESULT RawGameControllerAdded([in] EventRegistrationToken token);
  554. [eventadd] HRESULT RawGameControllerRemoved([in] Windows.Foundation.EventHandler<Windows.Gaming.Input.RawGameController *> *handler,
  555. [out, retval] EventRegistrationToken *token);
  556. [eventremove] HRESULT RawGameControllerRemoved([in] EventRegistrationToken token);
  557. [propget] HRESULT RawGameControllers([out, retval] Windows.Foundation.Collections.IVectorView<Windows.Gaming.Input.RawGameController *> **value);
  558. HRESULT FromGameController([in] Windows.Gaming.Input.IGameController *game_controller, [out, retval] Windows.Gaming.Input.RawGameController **value);
  559. }
  560. [
  561. contract(Windows.Foundation.UniversalApiContract, 4.0),
  562. uuid(dcecc681-3963-4da6-955d-553f3b6f6161)
  563. ]
  564. interface IGameControllerBatteryInfo : IInspectable
  565. {
  566. HRESULT TryGetBatteryReport([out, retval] Windows.Devices.Power.BatteryReport **value);
  567. }
  568. [
  569. contract(Windows.Foundation.UniversalApiContract, 3.0),
  570. marshaling_behavior(agile),
  571. static(Windows.Gaming.Input.IArcadeStickStatics, Windows.Foundation.UniversalApiContract, 3.0),
  572. static(Windows.Gaming.Input.IArcadeStickStatics2, Windows.Foundation.UniversalApiContract, 4.0),
  573. threading(both)
  574. ]
  575. runtimeclass ArcadeStick
  576. {
  577. [default] interface Windows.Gaming.Input.IArcadeStick;
  578. interface Windows.Gaming.Input.IGameController;
  579. [contract(Windows.Foundation.UniversalApiContract, 4.0)] interface Windows.Gaming.Input.IGameControllerBatteryInfo;
  580. }
  581. [
  582. contract(Windows.Foundation.UniversalApiContract, 4.0),
  583. marshaling_behavior(agile),
  584. static(Windows.Gaming.Input.IFlightStickStatics, Windows.Foundation.UniversalApiContract, 4.0),
  585. threading(both)
  586. ]
  587. runtimeclass FlightStick
  588. {
  589. [default] interface Windows.Gaming.Input.IFlightStick;
  590. interface Windows.Gaming.Input.IGameController;
  591. interface Windows.Gaming.Input.IGameControllerBatteryInfo;
  592. }
  593. [
  594. contract(Windows.Foundation.UniversalApiContract, 1.0),
  595. marshaling_behavior(agile),
  596. static(Windows.Gaming.Input.IGamepadStatics, Windows.Foundation.UniversalApiContract, 1.0),
  597. static(Windows.Gaming.Input.IGamepadStatics2, Windows.Foundation.UniversalApiContract, 4.0),
  598. threading(both)
  599. ]
  600. runtimeclass Gamepad
  601. {
  602. [default] interface Windows.Gaming.Input.IGamepad;
  603. interface Windows.Gaming.Input.IGameController;
  604. [contract(Windows.Foundation.UniversalApiContract, 3.0)] interface Windows.Gaming.Input.IGamepad2;
  605. [contract(Windows.Foundation.UniversalApiContract, 4.0)] interface Windows.Gaming.Input.IGameControllerBatteryInfo;
  606. }
  607. [
  608. contract(Windows.Foundation.UniversalApiContract, 1.0),
  609. marshaling_behavior(agile),
  610. threading(both)
  611. ]
  612. runtimeclass Headset
  613. {
  614. [default] interface Windows.Gaming.Input.IHeadset;
  615. [contract(Windows.Foundation.UniversalApiContract, 4.0)] interface Windows.Gaming.Input.IGameControllerBatteryInfo;
  616. }
  617. [
  618. contract(Windows.Foundation.UniversalApiContract, 3.0),
  619. marshaling_behavior(agile),
  620. static(Windows.Gaming.Input.IRacingWheelStatics, Windows.Foundation.UniversalApiContract, 3.0),
  621. static(Windows.Gaming.Input.IRacingWheelStatics2, Windows.Foundation.UniversalApiContract, 4.0),
  622. threading(both)
  623. ]
  624. runtimeclass RacingWheel
  625. {
  626. [default] interface Windows.Gaming.Input.IRacingWheel;
  627. interface Windows.Gaming.Input.IGameController;
  628. [contract(Windows.Foundation.UniversalApiContract, 4.0)] interface Windows.Gaming.Input.IGameControllerBatteryInfo;
  629. }
  630. [
  631. contract(Windows.Foundation.UniversalApiContract, 4.0),
  632. marshaling_behavior(agile),
  633. static(Windows.Gaming.Input.IRawGameControllerStatics, Windows.Foundation.UniversalApiContract, 4.0),
  634. threading(both)
  635. ]
  636. runtimeclass RawGameController
  637. {
  638. [default] interface Windows.Gaming.Input.IRawGameController;
  639. interface Windows.Gaming.Input.IGameController;
  640. interface Windows.Gaming.Input.IGameControllerBatteryInfo;
  641. [contract(Windows.Foundation.UniversalApiContract, 5.0)] interface Windows.Gaming.Input.IRawGameController2;
  642. }
  643. }