From 52dab51a480aaa4b7fa50d4e1564789ae59d219a Mon Sep 17 00:00:00 2001 From: Martin Zikmund Date: Wed, 28 Oct 2020 20:09:10 +0100 Subject: [PATCH] feat(Gamepad): GetCurrentReading on WASM --- .../Windows_Gaming/GamepadReadingTest.xaml | 17 ++-- .../Windows_Gaming/GamepadReadingTest.xaml.cs | 33 ++++++- src/Uno.UI/WasmScripts/Uno.UI.d.ts | 14 +++ src/Uno.UI/WasmScripts/Uno.UI.js | 70 +++++++++++++ src/Uno.UI/ts/Windows/Gaming/Input/Gamepad.ts | 35 ++++++- src/Uno.UWP/Gaming/Input/Gamepad.cs | 4 +- src/Uno.UWP/Gaming/Input/Gamepad.wasm.cs | 98 ++++++++++++++++--- src/Uno.UWP/Gaming/Input/GamepadButtons.cs | 31 ++++++ src/Uno.UWP/Gaming/Input/GamepadReading.cs | 49 ++++++++++ src/Uno.UWP/Gaming/Input/IGameController.cs | 8 ++ .../3.0.0.0/Windows.Gaming.Input/Gamepad.cs | 14 +-- .../Windows.Gaming.Input/GamepadButtons.cs | 84 ++++++++-------- .../Windows.Gaming.Input/GamepadReading.cs | 18 ++-- .../Windows.Gaming.Input/IGameController.cs | 2 +- 14 files changed, 390 insertions(+), 87 deletions(-) create mode 100644 src/Uno.UWP/Gaming/Input/GamepadButtons.cs create mode 100644 src/Uno.UWP/Gaming/Input/GamepadReading.cs create mode 100644 src/Uno.UWP/Gaming/Input/IGameController.cs diff --git a/src/SamplesApp/UITests.Shared/Windows_Gaming/GamepadReadingTest.xaml b/src/SamplesApp/UITests.Shared/Windows_Gaming/GamepadReadingTest.xaml index 16e48c80082a..6a4b73b129de 100644 --- a/src/SamplesApp/UITests.Shared/Windows_Gaming/GamepadReadingTest.xaml +++ b/src/SamplesApp/UITests.Shared/Windows_Gaming/GamepadReadingTest.xaml @@ -11,41 +11,42 @@ + - + - + - + - + - + - + - + - + diff --git a/src/SamplesApp/UITests.Shared/Windows_Gaming/GamepadReadingTest.xaml.cs b/src/SamplesApp/UITests.Shared/Windows_Gaming/GamepadReadingTest.xaml.cs index c18c132256fc..574576d3c758 100644 --- a/src/SamplesApp/UITests.Shared/Windows_Gaming/GamepadReadingTest.xaml.cs +++ b/src/SamplesApp/UITests.Shared/Windows_Gaming/GamepadReadingTest.xaml.cs @@ -10,7 +10,6 @@ namespace UITests.Windows_Gaming { [Sample("Windows.Gaming", Name = "Gamepad_CurrentReading", ViewModelType = typeof(GamepadReadingTestViewModel))] - public sealed partial class GamepadReadingTest : Page { public GamepadReadingTest() @@ -35,20 +34,48 @@ public GamepadReadingTestViewModel(CoreDispatcher dispatcher) : base(dispatcher) public ICommand GetCurrentReadingCommand => GetOrCreateCommand(GetCurrentReading); + public ulong Timestamp => CurrentReading.Timestamp; + + public GamepadButtons Buttons => CurrentReading.Buttons; + + public double LeftTrigger => CurrentReading.LeftTrigger; + + public double RightTrigger => CurrentReading.RightTrigger; + + public double LeftThumbstickX => CurrentReading.LeftThumbstickX; + + public double LeftThumbstickY => CurrentReading.LeftThumbstickY; + + public double RightThumbstickX => CurrentReading.RightThumbstickX; + + public double RightThumbstickY => CurrentReading.RightThumbstickY; + public GamepadReading CurrentReading { get; set; } private void GetCurrentReading() { var gamepad = Gamepad.Gamepads.FirstOrDefault(); if (gamepad != null) - { + { CurrentReading = gamepad.GetCurrentReading(); } else { CurrentReading = new GamepadReading(); } - RaisePropertyChanged(nameof(CurrentReading)); + Refresh(); + } + + private void Refresh() + { + RaisePropertyChanged(nameof(Timestamp)); + RaisePropertyChanged(nameof(Buttons)); + RaisePropertyChanged(nameof(LeftTrigger)); + RaisePropertyChanged(nameof(RightTrigger)); + RaisePropertyChanged(nameof(LeftThumbstickX)); + RaisePropertyChanged(nameof(LeftThumbstickY)); + RaisePropertyChanged(nameof(RightThumbstickX)); + RaisePropertyChanged(nameof(RightThumbstickY)); } } } diff --git a/src/Uno.UI/WasmScripts/Uno.UI.d.ts b/src/Uno.UI/WasmScripts/Uno.UI.d.ts index 696151e59cdd..8c477c8cf51c 100644 --- a/src/Uno.UI/WasmScripts/Uno.UI.d.ts +++ b/src/Uno.UI/WasmScripts/Uno.UI.d.ts @@ -842,6 +842,20 @@ declare namespace Windows.Devices.Sensors { private static readingChangedHandler; } } +declare namespace Windows.Gaming.Input { + class Gamepad { + private static dispatchGamepadAdded; + private static dispatchGamepadRemoved; + static getConnectedGamepadIds(): string; + static getReading(id: number): string; + static startGamepadAdded(): void; + static endGamepadAdded(): void; + static startGamepadRemoved(): void; + static endGamepadRemoved(): void; + private static onGamepadConnected; + private static onGamepadDisconnected; + } +} declare namespace Windows.Graphics.Display { class DisplayInformation { private static readonly DpiCheckInterval; diff --git a/src/Uno.UI/WasmScripts/Uno.UI.js b/src/Uno.UI/WasmScripts/Uno.UI.js index 4d1cea14f123..7ce95ae89ad5 100644 --- a/src/Uno.UI/WasmScripts/Uno.UI.js +++ b/src/Uno.UI/WasmScripts/Uno.UI.js @@ -2666,6 +2666,76 @@ var Windows; })(Devices = Windows.Devices || (Windows.Devices = {})); })(Windows || (Windows = {})); var Windows; +(function (Windows) { + var Gaming; + (function (Gaming) { + var Input; + (function (Input) { + class Gamepad { + static getConnectedGamepadIds() { + const gamepads = navigator.getGamepads(); + const separator = ";"; + var result = ''; + for (var i = 0; i < gamepads.length; i++) { + if (gamepads[i]) { + result += gamepads[i].index + separator; + } + } + return result; + } + static getReading(id) { + var gamepad = navigator.getGamepads()[id]; + if (!gamepad) { + return ""; + } + var result = ""; + result += gamepad.timestamp; + result += '*'; + for (var axisId = 0; axisId < gamepad.axes.length; axisId++) { + if (axisId != 0) { + result += '|'; + } + result += gamepad.axes[axisId]; + } + result += '*'; + for (var buttonId = 0; buttonId < gamepad.buttons.length; buttonId++) { + if (buttonId != 0) { + result += '|'; + } + result += gamepad.buttons[buttonId].value; + } + return result; + } + static startGamepadAdded() { + window.addEventListener("gamepadconnected", Gamepad.onGamepadConnected); + } + static endGamepadAdded() { + window.removeEventListener("gamepadconnected", Gamepad.onGamepadConnected); + } + static startGamepadRemoved() { + window.addEventListener("gamepaddisconnected", Gamepad.onGamepadDisconnected); + } + static endGamepadRemoved() { + window.removeEventListener("gamepaddisconnected", Gamepad.onGamepadDisconnected); + } + static onGamepadConnected(e) { + if (!Gamepad.dispatchGamepadAdded) { + Gamepad.dispatchGamepadAdded = Module.mono_bind_static_method("[Uno] Windows.Gaming.Input.Gamepad:DispatchGamepadAdded"); + } + Gamepad.dispatchGamepadAdded(e.gamepad.index.toString()); + } + static onGamepadDisconnected(e) { + if (!Gamepad.dispatchGamepadRemoved) { + Gamepad.dispatchGamepadRemoved = Module.mono_bind_static_method("[Uno] Windows.Gaming.Input.Gamepad:DispatchGamepadRemoved"); + } + Gamepad.dispatchGamepadRemoved(e.gamepad.index.toString()); + } + } + Input.Gamepad = Gamepad; + })(Input = Gaming.Input || (Gaming.Input = {})); + })(Gaming = Windows.Gaming || (Windows.Gaming = {})); +})(Windows || (Windows = {})); +var Windows; (function (Windows) { var Graphics; (function (Graphics) { diff --git a/src/Uno.UI/ts/Windows/Gaming/Input/Gamepad.ts b/src/Uno.UI/ts/Windows/Gaming/Input/Gamepad.ts index 0b42ead5d294..f5e48e8fff94 100644 --- a/src/Uno.UI/ts/Windows/Gaming/Input/Gamepad.ts +++ b/src/Uno.UI/ts/Windows/Gaming/Input/Gamepad.ts @@ -16,6 +16,37 @@ return result; } + public static getReading(id: number): string { + var gamepad = navigator.getGamepads()[id]; + if (!gamepad) { + return ""; + } + + var result = ""; + + result += gamepad.timestamp; + + result += '*'; + + for (var axisId = 0; axisId < gamepad.axes.length; axisId++) { + if (axisId != 0) { + result += '|'; + } + result += gamepad.axes[axisId]; + } + + result += '*'; + + for (var buttonId = 0; buttonId < gamepad.buttons.length; buttonId++) { + if (buttonId != 0) { + result += '|'; + } + result += gamepad.buttons[buttonId].value; + } + + return result; + } + public static startGamepadAdded() { window.addEventListener("gamepadconnected", Gamepad.onGamepadConnected); } @@ -32,7 +63,7 @@ window.removeEventListener("gamepaddisconnected", Gamepad.onGamepadDisconnected); } - private static onGamepadConnected(e : any) { + private static onGamepadConnected(e: any) { if (!Gamepad.dispatchGamepadAdded) { Gamepad.dispatchGamepadAdded = (Module).mono_bind_static_method( "[Uno] Windows.Gaming.Input.Gamepad:DispatchGamepadAdded"); @@ -40,7 +71,7 @@ Gamepad.dispatchGamepadAdded(e.gamepad.index.toString()); } - private static onGamepadDisconnected(e : any) { + private static onGamepadDisconnected(e: any) { if (!Gamepad.dispatchGamepadRemoved) { Gamepad.dispatchGamepadRemoved = (Module).mono_bind_static_method( "[Uno] Windows.Gaming.Input.Gamepad:DispatchGamepadRemoved"); diff --git a/src/Uno.UWP/Gaming/Input/Gamepad.cs b/src/Uno.UWP/Gaming/Input/Gamepad.cs index 80da6f1f59cd..2e98fcd70db9 100644 --- a/src/Uno.UWP/Gaming/Input/Gamepad.cs +++ b/src/Uno.UWP/Gaming/Input/Gamepad.cs @@ -7,7 +7,7 @@ namespace Windows.Gaming.Input { - public partial class Gamepad + public partial class Gamepad : IGameController { private readonly static object _syncLock = new object(); @@ -68,7 +68,7 @@ public static event EventHandler GamepadRemoved } } } - } + } internal static void OnGamepadAdded(Gamepad gamepad) => _gamepadAdded?.Invoke(null, gamepad); diff --git a/src/Uno.UWP/Gaming/Input/Gamepad.wasm.cs b/src/Uno.UWP/Gaming/Input/Gamepad.wasm.cs index b46a40ef048d..326166f4a53e 100644 --- a/src/Uno.UWP/Gaming/Input/Gamepad.wasm.cs +++ b/src/Uno.UWP/Gaming/Input/Gamepad.wasm.cs @@ -1,5 +1,4 @@ -#if __WASM__ -using System; +using System; using System.Collections.Generic; using System.Linq; using Uno; @@ -9,22 +8,78 @@ namespace Windows.Gaming.Input { public partial class Gamepad - { + { private const string JsType = "Windows.Gaming.Input.Gamepad"; private const char IdSeparator = ';'; - private readonly static Dictionary _gamepadCache = - new Dictionary(); + private readonly static Dictionary _gamepadCache = + new Dictionary(); - private readonly string _id; + private readonly long _id; - private Gamepad(string id) + private Gamepad(long id) { _id = id; } + public GamepadReading GetCurrentReading() + { + var reading = new GamepadReading(); + var result = WebAssemblyRuntime.InvokeJS($"{JsType}.getReading({_id})"); + if (string.IsNullOrEmpty(result)) + { + // Gamepad is not connected + return reading; + } + + var parts = result.Split('*'); + var timestampPart = parts[0]; + var axesPart = parts[1]; + var buttonsPart = parts[2]; + + var timestampDouble = double.Parse(timestampPart); + reading.Timestamp = (ulong)(timestampDouble * 1000); // JS timestamp is in milliseconds + + var axes = axesPart.Split('|').Select(double.Parse).ToArray(); + + reading.LeftThumbstickX = GetGamepadValueIfExists(ref axes, 0); + reading.LeftThumbstickY = GetGamepadValueIfExists(ref axes, 1); + reading.RightThumbstickX = GetGamepadValueIfExists(ref axes, 2); + reading.RightThumbstickY = GetGamepadValueIfExists(ref axes, 3); + + var buttons = buttonsPart.Split('|').Select(double.Parse).ToArray(); + + var pressedButtons = GamepadButtons.None; + pressedButtons |= IsButtonPressed(ref buttons, 0) ? GamepadButtons.A : GamepadButtons.None; + pressedButtons |= IsButtonPressed(ref buttons, 1) ? GamepadButtons.B : GamepadButtons.None; + pressedButtons |= IsButtonPressed(ref buttons, 2) ? GamepadButtons.X : GamepadButtons.None; + pressedButtons |= IsButtonPressed(ref buttons, 3) ? GamepadButtons.Y : GamepadButtons.None; + + pressedButtons |= IsButtonPressed(ref buttons, 4) ? GamepadButtons.LeftShoulder : GamepadButtons.None; + pressedButtons |= IsButtonPressed(ref buttons, 5) ? GamepadButtons.RightShoulder : GamepadButtons.None; + + pressedButtons |= IsButtonPressed(ref buttons, 8) ? GamepadButtons.View : GamepadButtons.None; + pressedButtons |= IsButtonPressed(ref buttons, 9) ? GamepadButtons.Menu : GamepadButtons.None; + + pressedButtons |= IsButtonPressed(ref buttons, 10) ? GamepadButtons.LeftThumbstick : GamepadButtons.None; + pressedButtons |= IsButtonPressed(ref buttons, 11) ? GamepadButtons.RightThumbstick : GamepadButtons.None; + + pressedButtons |= IsButtonPressed(ref buttons, 12) ? GamepadButtons.DPadUp : GamepadButtons.None; + pressedButtons |= IsButtonPressed(ref buttons, 13) ? GamepadButtons.DPadDown : GamepadButtons.None; + pressedButtons |= IsButtonPressed(ref buttons, 14) ? GamepadButtons.DPadLeft : GamepadButtons.None; + pressedButtons |= IsButtonPressed(ref buttons, 15) ? GamepadButtons.DPadRight : GamepadButtons.None; + + reading.Buttons = pressedButtons; + + reading.LeftTrigger = GetGamepadValueIfExists(ref buttons, 6); + reading.RightTrigger = GetGamepadValueIfExists(ref buttons, 7); + + return reading; + } + + [Preserve] - public static int DispatchGamepadAdded(string id) + public static int DispatchGamepadAdded(long id) { Gamepad gamepad; lock (_gamepadCache) @@ -40,7 +95,7 @@ public static int DispatchGamepadAdded(string id) } [Preserve] - public static int DispatchGamepadRemoved(string id) + public static int DispatchGamepadRemoved(long id) { Gamepad gamepad; lock (_gamepadCache) @@ -55,18 +110,34 @@ public static int DispatchGamepadRemoved(string id) return 0; } + private bool IsButtonPressed(ref double[] buttons, int index) => + GetGamepadValueIfExists(ref buttons, index) > 0.5; + + private double GetGamepadValueIfExists(ref double[] data, int index) + { + if (data.Length > index) + { + return data[index]; + } + return 0.0; + } + private static IReadOnlyList GetGamepadsInternal() { var getConnectedGamepadIdsCommand = $"{JsType}.getConnectedGamepadIds()"; var serializedIds = WebAssemblyRuntime.InvokeJS(getConnectedGamepadIdsCommand); - var connectedGamepadIds = serializedIds.Split(new[] { IdSeparator }, StringSplitOptions.RemoveEmptyEntries); + var connectedGamepadIds = + serializedIds + .Split(new[] { IdSeparator }, StringSplitOptions.RemoveEmptyEntries) + .Select(id => long.Parse(id)) + .ToList(); lock (_gamepadCache) { - var cachedGCControllers = _gamepadCache.Keys.ToArray(); - + var cachedGamepads = _gamepadCache.Keys.ToArray(); + //remove disconnected - var disconnectedDevices = cachedGCControllers.Except(connectedGamepadIds); + var disconnectedDevices = cachedGamepads.Except(connectedGamepadIds); _gamepadCache.RemoveKeys(disconnectedDevices); //add newly connected @@ -108,4 +179,3 @@ private static void EndGamepadRemoved() } } } -#endif diff --git a/src/Uno.UWP/Gaming/Input/GamepadButtons.cs b/src/Uno.UWP/Gaming/Input/GamepadButtons.cs new file mode 100644 index 000000000000..22854953b55a --- /dev/null +++ b/src/Uno.UWP/Gaming/Input/GamepadButtons.cs @@ -0,0 +1,31 @@ +using System; + +namespace Windows.Gaming.Input +{ + /// + /// Specifies the button type. + /// + [Flags] + public enum GamepadButtons + { + None = 0, + Menu = 1, + View = 2, + A = 4, + B = 8, + X = 16, + Y = 32, + DPadUp = 64, + DPadDown = 128, + DPadLeft = 256, + DPadRight = 512, + LeftShoulder = 1024, + RightShoulder = 2048, + LeftThumbstick = 4096, + RightThumbstick = 8192, + Paddle1 = 16384, + Paddle2 = 32768, + Paddle3 = 65536, + Paddle4 = 131072, + } +} diff --git a/src/Uno.UWP/Gaming/Input/GamepadReading.cs b/src/Uno.UWP/Gaming/Input/GamepadReading.cs new file mode 100644 index 000000000000..20a2d5cc4bd5 --- /dev/null +++ b/src/Uno.UWP/Gaming/Input/GamepadReading.cs @@ -0,0 +1,49 @@ +namespace Windows.Gaming.Input +{ + /// + /// Represents the current state of the gamepad. + /// + public partial struct GamepadReading + { + /// + /// Time when the state was retrieved from the gamepad. + /// + public ulong Timestamp; + + /// + /// The state of the gamepad's buttons. This will be a combination + /// of values in the GamepadButtons enumeration. + /// + public GamepadButtons Buttons; + + /// + /// The position of the left trigger. The value is between 0.0 (not depressed) and 1.0 (fully depressed). + /// + public double LeftTrigger; + + /// + /// The position of the right trigger. The value is between 0.0 (not depressed) and 1.0 (fully depressed). + /// + public double RightTrigger; + + /// + /// The position of the left thumbstick on the X-axis. The value is between -1.0 and 1.0. + /// + public double LeftThumbstickX; + + /// + /// The position of the left thumbstick on the Y-axis. The value is between -1.0 and 1.0. + /// + public double LeftThumbstickY; + + /// + /// The position of the right thumbstick on the X-axis.The value is between -1.0 and 1.0. + /// + public double RightThumbstickX; + + /// + /// The position of the right thumbstick on the Y-axis. The value is between -1.0 and 1.0. + /// + public double RightThumbstickY; + } +} diff --git a/src/Uno.UWP/Gaming/Input/IGameController.cs b/src/Uno.UWP/Gaming/Input/IGameController.cs new file mode 100644 index 000000000000..325140357ac9 --- /dev/null +++ b/src/Uno.UWP/Gaming/Input/IGameController.cs @@ -0,0 +1,8 @@ +#if __ANDROID__ || __IOS__ || __MACOS__ || __WASM__ +namespace Windows.Gaming.Input +{ + public partial interface IGameController + { + } +} +#endif diff --git a/src/Uno.UWP/Generated/3.0.0.0/Windows.Gaming.Input/Gamepad.cs b/src/Uno.UWP/Generated/3.0.0.0/Windows.Gaming.Input/Gamepad.cs index 9c119d99fa94..0de562b984a9 100644 --- a/src/Uno.UWP/Generated/3.0.0.0/Windows.Gaming.Input/Gamepad.cs +++ b/src/Uno.UWP/Generated/3.0.0.0/Windows.Gaming.Input/Gamepad.cs @@ -2,7 +2,7 @@ #pragma warning disable 114 // new keyword hiding namespace Windows.Gaming.Input { - #if __ANDROID__ || __IOS__ || NET461 || __WASM__ || __SKIA__ || __NETSTD_REFERENCE__ || __MACOS__ + #if false || false || NET461 || false || __SKIA__ || __NETSTD_REFERENCE__ || false [global::Uno.NotImplemented] #endif public partial class Gamepad : global::Windows.Gaming.Input.IGameController,global::Windows.Gaming.Input.IGameControllerBatteryInfo @@ -51,7 +51,7 @@ public bool IsWireless } } #endif - #if __ANDROID__ || __IOS__ || NET461 || __WASM__ || __SKIA__ || __NETSTD_REFERENCE__ || __MACOS__ + #if false || false || NET461 || false || __SKIA__ || __NETSTD_REFERENCE__ || false [global::Uno.NotImplemented("__ANDROID__", "__IOS__", "NET461", "__WASM__", "__SKIA__", "__NETSTD_REFERENCE__", "__MACOS__")] public static global::System.Collections.Generic.IReadOnlyList Gamepads { @@ -63,7 +63,7 @@ public bool IsWireless #endif // Forced skipping of method Windows.Gaming.Input.Gamepad.Vibration.get // Forced skipping of method Windows.Gaming.Input.Gamepad.Vibration.set - #if __ANDROID__ || __IOS__ || NET461 || __WASM__ || __SKIA__ || __NETSTD_REFERENCE__ || __MACOS__ + #if __ANDROID__ || __IOS__ || NET461 || false || __SKIA__ || __NETSTD_REFERENCE__ || __MACOS__ [global::Uno.NotImplemented("__ANDROID__", "__IOS__", "NET461", "__WASM__", "__SKIA__", "__NETSTD_REFERENCE__", "__MACOS__")] public global::Windows.Gaming.Input.GamepadReading GetCurrentReading() { @@ -153,8 +153,8 @@ public bool IsWireless } } #endif - #if __ANDROID__ || __IOS__ || NET461 || __WASM__ || __SKIA__ || __NETSTD_REFERENCE__ || __MACOS__ - [global::Uno.NotImplemented("__ANDROID__", "__IOS__", "NET461", "__WASM__", "__SKIA__", "__NETSTD_REFERENCE__", "__MACOS__")] + #if false || false || NET461 || false || __SKIA__ || __NETSTD_REFERENCE__ || false + [global::Uno.NotImplemented("NET461", "__SKIA__", "__NETSTD_REFERENCE__")] public static event global::System.EventHandler GamepadAdded { [global::Uno.NotImplemented("__ANDROID__", "__IOS__", "NET461", "__WASM__", "__SKIA__", "__NETSTD_REFERENCE__", "__MACOS__")] @@ -169,8 +169,8 @@ public bool IsWireless } } #endif - #if __ANDROID__ || __IOS__ || NET461 || __WASM__ || __SKIA__ || __NETSTD_REFERENCE__ || __MACOS__ - [global::Uno.NotImplemented("__ANDROID__", "__IOS__", "NET461", "__WASM__", "__SKIA__", "__NETSTD_REFERENCE__", "__MACOS__")] + #if false || false || NET461 || false || __SKIA__ || __NETSTD_REFERENCE__ || false + [global::Uno.NotImplemented("NET461", "__SKIA__", "__NETSTD_REFERENCE__")] public static event global::System.EventHandler GamepadRemoved { [global::Uno.NotImplemented("__ANDROID__", "__IOS__", "NET461", "__WASM__", "__SKIA__", "__NETSTD_REFERENCE__", "__MACOS__")] diff --git a/src/Uno.UWP/Generated/3.0.0.0/Windows.Gaming.Input/GamepadButtons.cs b/src/Uno.UWP/Generated/3.0.0.0/Windows.Gaming.Input/GamepadButtons.cs index 6e78e522f443..28e450b91b34 100644 --- a/src/Uno.UWP/Generated/3.0.0.0/Windows.Gaming.Input/GamepadButtons.cs +++ b/src/Uno.UWP/Generated/3.0.0.0/Windows.Gaming.Input/GamepadButtons.cs @@ -2,66 +2,68 @@ #pragma warning disable 114 // new keyword hiding namespace Windows.Gaming.Input { - #if __ANDROID__ || __IOS__ || NET461 || __WASM__ || __SKIA__ || __NETSTD_REFERENCE__ || __MACOS__ - [global::System.FlagsAttribute] - public enum GamepadButtons : uint + #if false + #if false + [global::Uno.NotImplemented] + #endif + public enum GamepadButtons { - #if __ANDROID__ || __IOS__ || NET461 || __WASM__ || __SKIA__ || __NETSTD_REFERENCE__ || __MACOS__ - None = 0, + #if false + None, #endif - #if __ANDROID__ || __IOS__ || NET461 || __WASM__ || __SKIA__ || __NETSTD_REFERENCE__ || __MACOS__ - Menu = 1, + #if false + Menu, #endif - #if __ANDROID__ || __IOS__ || NET461 || __WASM__ || __SKIA__ || __NETSTD_REFERENCE__ || __MACOS__ - View = 2, + #if false + View, #endif - #if __ANDROID__ || __IOS__ || NET461 || __WASM__ || __SKIA__ || __NETSTD_REFERENCE__ || __MACOS__ - A = 4, + #if false + A, #endif - #if __ANDROID__ || __IOS__ || NET461 || __WASM__ || __SKIA__ || __NETSTD_REFERENCE__ || __MACOS__ - B = 8, + #if false + B, #endif - #if __ANDROID__ || __IOS__ || NET461 || __WASM__ || __SKIA__ || __NETSTD_REFERENCE__ || __MACOS__ - X = 16, + #if false + X, #endif - #if __ANDROID__ || __IOS__ || NET461 || __WASM__ || __SKIA__ || __NETSTD_REFERENCE__ || __MACOS__ - Y = 32, + #if false + Y, #endif - #if __ANDROID__ || __IOS__ || NET461 || __WASM__ || __SKIA__ || __NETSTD_REFERENCE__ || __MACOS__ - DPadUp = 64, + #if false + DPadUp, #endif - #if __ANDROID__ || __IOS__ || NET461 || __WASM__ || __SKIA__ || __NETSTD_REFERENCE__ || __MACOS__ - DPadDown = 128, + #if false + DPadDown, #endif - #if __ANDROID__ || __IOS__ || NET461 || __WASM__ || __SKIA__ || __NETSTD_REFERENCE__ || __MACOS__ - DPadLeft = 256, + #if false + DPadLeft, #endif - #if __ANDROID__ || __IOS__ || NET461 || __WASM__ || __SKIA__ || __NETSTD_REFERENCE__ || __MACOS__ - DPadRight = 512, + #if false + DPadRight, #endif - #if __ANDROID__ || __IOS__ || NET461 || __WASM__ || __SKIA__ || __NETSTD_REFERENCE__ || __MACOS__ - LeftShoulder = 1024, + #if false + LeftShoulder, #endif - #if __ANDROID__ || __IOS__ || NET461 || __WASM__ || __SKIA__ || __NETSTD_REFERENCE__ || __MACOS__ - RightShoulder = 2048, + #if false + RightShoulder, #endif - #if __ANDROID__ || __IOS__ || NET461 || __WASM__ || __SKIA__ || __NETSTD_REFERENCE__ || __MACOS__ - LeftThumbstick = 4096, + #if false + LeftThumbstick, #endif - #if __ANDROID__ || __IOS__ || NET461 || __WASM__ || __SKIA__ || __NETSTD_REFERENCE__ || __MACOS__ - RightThumbstick = 8192, + #if false + RightThumbstick, #endif - #if __ANDROID__ || __IOS__ || NET461 || __WASM__ || __SKIA__ || __NETSTD_REFERENCE__ || __MACOS__ - Paddle1 = 16384, + #if false + Paddle1, #endif - #if __ANDROID__ || __IOS__ || NET461 || __WASM__ || __SKIA__ || __NETSTD_REFERENCE__ || __MACOS__ - Paddle2 = 32768, + #if false + Paddle2, #endif - #if __ANDROID__ || __IOS__ || NET461 || __WASM__ || __SKIA__ || __NETSTD_REFERENCE__ || __MACOS__ - Paddle3 = 65536, + #if false + Paddle3, #endif - #if __ANDROID__ || __IOS__ || NET461 || __WASM__ || __SKIA__ || __NETSTD_REFERENCE__ || __MACOS__ - Paddle4 = 131072, + #if false + Paddle4, #endif } #endif diff --git a/src/Uno.UWP/Generated/3.0.0.0/Windows.Gaming.Input/GamepadReading.cs b/src/Uno.UWP/Generated/3.0.0.0/Windows.Gaming.Input/GamepadReading.cs index 05ece33d8956..654ee9f9b5ca 100644 --- a/src/Uno.UWP/Generated/3.0.0.0/Windows.Gaming.Input/GamepadReading.cs +++ b/src/Uno.UWP/Generated/3.0.0.0/Windows.Gaming.Input/GamepadReading.cs @@ -2,34 +2,34 @@ #pragma warning disable 114 // new keyword hiding namespace Windows.Gaming.Input { - #if __ANDROID__ || __IOS__ || NET461 || __WASM__ || __SKIA__ || __NETSTD_REFERENCE__ || __MACOS__ + #if false [global::Uno.NotImplemented] #endif public partial struct GamepadReading { // Forced skipping of method Windows.Gaming.Input.GamepadReading.GamepadReading() - #if __ANDROID__ || __IOS__ || NET461 || __WASM__ || __SKIA__ || __NETSTD_REFERENCE__ || __MACOS__ + #if false public ulong Timestamp; #endif - #if __ANDROID__ || __IOS__ || NET461 || __WASM__ || __SKIA__ || __NETSTD_REFERENCE__ || __MACOS__ + #if false public global::Windows.Gaming.Input.GamepadButtons Buttons; #endif - #if __ANDROID__ || __IOS__ || NET461 || __WASM__ || __SKIA__ || __NETSTD_REFERENCE__ || __MACOS__ + #if false public double LeftTrigger; #endif - #if __ANDROID__ || __IOS__ || NET461 || __WASM__ || __SKIA__ || __NETSTD_REFERENCE__ || __MACOS__ + #if false public double RightTrigger; #endif - #if __ANDROID__ || __IOS__ || NET461 || __WASM__ || __SKIA__ || __NETSTD_REFERENCE__ || __MACOS__ + #if false public double LeftThumbstickX; #endif - #if __ANDROID__ || __IOS__ || NET461 || __WASM__ || __SKIA__ || __NETSTD_REFERENCE__ || __MACOS__ + #if false public double LeftThumbstickY; #endif - #if __ANDROID__ || __IOS__ || NET461 || __WASM__ || __SKIA__ || __NETSTD_REFERENCE__ || __MACOS__ + #if false public double RightThumbstickX; #endif - #if __ANDROID__ || __IOS__ || NET461 || __WASM__ || __SKIA__ || __NETSTD_REFERENCE__ || __MACOS__ + #if false public double RightThumbstickY; #endif } diff --git a/src/Uno.UWP/Generated/3.0.0.0/Windows.Gaming.Input/IGameController.cs b/src/Uno.UWP/Generated/3.0.0.0/Windows.Gaming.Input/IGameController.cs index 2ab6070982eb..64d2fab29ac9 100644 --- a/src/Uno.UWP/Generated/3.0.0.0/Windows.Gaming.Input/IGameController.cs +++ b/src/Uno.UWP/Generated/3.0.0.0/Windows.Gaming.Input/IGameController.cs @@ -2,7 +2,7 @@ #pragma warning disable 114 // new keyword hiding namespace Windows.Gaming.Input { - #if __ANDROID__ || __IOS__ || NET461 || __WASM__ || __SKIA__ || __NETSTD_REFERENCE__ || __MACOS__ + #if false || false || NET461 || false || __SKIA__ || __NETSTD_REFERENCE__ || false [global::Uno.NotImplemented] #endif public partial interface IGameController