예제 #1
0
        private bool InputGetButtonState(GamePadButtons buttons, GmpdButton btn)
        {
            switch (btn)
            {
            case (GmpdButton.A): return(ButtonStateToBool(buttons.A)); break;

            case (GmpdButton.B): return(ButtonStateToBool(buttons.B)); break;

            case (GmpdButton.X): return(ButtonStateToBool(buttons.X)); break;

            case (GmpdButton.Y): return(ButtonStateToBool(buttons.Y)); break;

            case (GmpdButton.Start): return(ButtonStateToBool(buttons.Start)); break;

            case (GmpdButton.Back): return(ButtonStateToBool(buttons.Back)); break;

            case (GmpdButton.LBumper): return(ButtonStateToBool(buttons.LeftShoulder)); break;

            case (GmpdButton.RBumper): return(ButtonStateToBool(buttons.RightShoulder)); break;

            case (GmpdButton.LStick): return(ButtonStateToBool(buttons.LeftStick)); break;

            case (GmpdButton.RStick): return(ButtonStateToBool(buttons.RightStick)); break;
            }
            return(false);
        }
예제 #2
0
 public bool IsDPad(GmpdButton gBttn)
 {
     return(gBttn == GmpdButton.DPadDown ||
            gBttn == GmpdButton.DPadUp ||
            gBttn == GmpdButton.DPadLeft ||
            gBttn == GmpdButton.DPadRight);
 }
예제 #3
0
        private bool InputGetDPadButtonState(GamePadDPad pad, GmpdButton btn) {

            switch (btn) {
                case (GmpdButton.DPadDown): return ButtonStateToBool(pad.Down); break;
                case (GmpdButton.DPadUp): return ButtonStateToBool(pad.Up); break;
                case (GmpdButton.DPadLeft): return ButtonStateToBool(pad.Left); break;
                case (GmpdButton.DPadRight): return ButtonStateToBool(pad.Right); break;
            }
            return false;
        }
예제 #4
0
        private void UpdateButtonStates(ref InputForm inptForm, GamePadState gmpdState, GmpdButton[] bttnCodes) {

            // Get buttons
            for (int i = 0; i < bttnCodes.Length; i++) {
                if (IsDPad(bttnCodes[i])) {
                    if (InputGetDPadButtonState(gmpdState.DPad, bttnCodes[i]))
                        inptForm.m_button |= (GenericButtonID)((int)1 << i);
                } else {
                    if (InputGetButtonState(gmpdState.Buttons, bttnCodes[i]))
                        inptForm.m_button |= (GenericButtonID)((int)1 << i);
                }
            }
        }
예제 #5
0
        private bool InputGetDPadButtonState(GamePadDPad pad, GmpdButton btn)
        {
            switch (btn)
            {
            case (GmpdButton.DPadDown): return(ButtonStateToBool(pad.Down)); break;

            case (GmpdButton.DPadUp): return(ButtonStateToBool(pad.Up)); break;

            case (GmpdButton.DPadLeft): return(ButtonStateToBool(pad.Left)); break;

            case (GmpdButton.DPadRight): return(ButtonStateToBool(pad.Right)); break;
            }
            return(false);
        }
예제 #6
0
 private bool InputGetButtonState(GamePadButtons buttons, GmpdButton btn) {
     
     switch (btn) {
         case (GmpdButton.A): return ButtonStateToBool(buttons.A); break;
         case (GmpdButton.B): return ButtonStateToBool(buttons.B); break;
         case (GmpdButton.X): return ButtonStateToBool(buttons.X); break;
         case (GmpdButton.Y): return ButtonStateToBool(buttons.Y); break;
         case (GmpdButton.Start): return ButtonStateToBool(buttons.Start); break;
         case (GmpdButton.Back): return ButtonStateToBool(buttons.Back); break;
         case (GmpdButton.LBumper): return ButtonStateToBool(buttons.LeftShoulder); break;
         case (GmpdButton.RBumper): return ButtonStateToBool(buttons.RightShoulder); break;
         case (GmpdButton.LStick): return ButtonStateToBool(buttons.LeftStick); break;
         case (GmpdButton.RStick): return ButtonStateToBool(buttons.RightStick); break;
     }
     return false;
 }
예제 #7
0
 public bool IsDPad(GmpdButton gBttn) {
     return (gBttn == GmpdButton.DPadDown ||
         gBttn == GmpdButton.DPadUp ||
         gBttn == GmpdButton.DPadLeft ||
         gBttn == GmpdButton.DPadRight);
 }