Ejemplo n.º 1
0
    static void UpdateControllerInput(float delta)
    {
        Stick leftStick  = ControllerHub.MainController.LeftStick;
        Stick rightStick = ControllerHub.MainController.LeftStick;

        Main.Update(delta);
        DirectionalKeys joystickDPadLeft = leftStick.ReturnDpad();
        //DirectionalKeys joystickDPadRight = rightStick.GetDirectionals();//not used yet
        DpadButton pcDpad           = ControllerHub.MainController.Dpad;
        DpadButton keyboardDpad     = ControllerHub.PCInput.Dpad;
        DpadButton keyboardDpad_alt = ControllerHub.PCInputAlt.Dpad;
        bool       rightKeyGlobal   = (
            joystickDPadLeft.RightKey ||
            RightDpad);
        bool upKeyGlobal = (
            joystickDPadLeft.UpKey ||
            UpDpad);
        bool leftKeyGlobal = (
            joystickDPadLeft.LeftKey ||
            LeftDpad);
        bool downKeyGlobal = (
            joystickDPadLeft.DownKey ||
            DownDpad);

        _globalDPad.Set(rightKeyGlobal, upKeyGlobal, leftKeyGlobal, downKeyGlobal);
    }
Ejemplo n.º 2
0
 /// <summary>
 /// IMPORTANT: Initialize the system before running.
 /// <para>Don't forget to update to take full advantage if it with:</para>
 /// <para>ProInput.UpdateInput(float delta, bool debug)</para>
 /// </summary>
 public static void Init()
 {
     Main        = new GlobalController(ControllerHub.MainController, ControllerHub.PCInput, ControllerHub.PCInputAlt);
     debugButton = new Button(DebugKeys.MAPPING_KEY);
     testButton  = new Button(DebugKeys.TEST_KEY);
     _globalDPad = new DirectionalKeys();
 }