void SetupInput() { InputManager inputManager = new InputManager(); GamePadInputDeviceManager gamePadInputDeviceManager = new GamePadInputDeviceManager(); inputManager.Setup(); inputManager.AddDeviceManager(gamePadInputDeviceManager); registerGlobalManager(inputManager); }
public static Guid GetPlayerDeviceGuid(PlayerIndex playerIndex) { Guid deviceGuid = Guid.Empty; GamePadInputDeviceManager deviceManager = GetDeviceManager <GamePadInputDeviceManager>(); if (deviceManager != null) { deviceGuid = deviceManager.GetPlayerInputDeviceGuid(playerIndex); } Console.WriteLine($"{deviceGuid} Device GUID found for Player Index {playerIndex.ToString()}"); return(deviceGuid); }
private (PlayerActionSet playerActionSetOne, PlayerActionSet playerActionSetTwo) SetupInput() { InputManager inputManager = new InputManager(); GamePadInputDeviceManager gamePadInputDeviceManager = new GamePadInputDeviceManager(); inputManager.Setup(); inputManager.AddDeviceManager(gamePadInputDeviceManager); var playerActionSetOne = new PlayerActionSet(); playerActionSetOne.SetupDefaultBindings(); playerActionSetOne.SetupDefaultKeebBindings(); // playerActionSetOne.Device = InputManager.devices[(int)PlayerIndex.One]; // var playerActionSetTwo = new PlayerActionSet(); // playerActionSetTwo.Device = InputManager.devices[(int)PlayerIndex.Two]; registerGlobalManager(inputManager); return(playerActionSetOne, playerActionSetTwo); }