public static void Init() { InputSourceLayoutManager.Init(); LoadBindings(); //Console.WriteLine("Gamepad 1 connected: {0}", GamePad.GetState(PlayerIndex.One).IsConnected); //Console.WriteLine("Gamepad 2 connected: {0}", GamePad.GetState(PlayerIndex.Two).IsConnected); }
public override void Update(GameTime gameTime) { // Update visibility if (InputManager.RebindingPanelInputSources.JustPressed) { Visible = !Visible; if (!Visible) { BindingManager.Save(); } } if (Visible) { int delta = 0; if (InputManager.Any.Vertical.RepeaterPos) { delta = -1; } if (InputManager.Any.Vertical.RepeaterNeg) { delta = +1; } if (delta != 0) { SelectionIndex = Calc.Loop(SelectionIndex + delta, 0, 2); } if (InputManager.Any.Enter.JustPressed) { switch (SelectionIndex) { case 0: BindingManager.CurrentBindings.InputSourceLayout.keyboardIsPlayer2 = !Toggles.keyboardIsPlayer2; break; case 1: BindingManager.CurrentBindings.InputSourceLayout.gamepad1IsPlayer2 = !Toggles.gamepad1IsPlayer2; break; default: break; } InputSourceLayoutManager.ApplyFromCurrent(); } } }