示例#1
0
        public override bool DispatchGenericMotionEvent(MotionEvent ev)
        {
            if (AndroidGamepad.IsJoystickEvent(ev))
            {
                AndroidGamepad.GetPad(GamepadId.Pad1).HandleJoystickEvent(ev);
                return(true); //Handled
            }

            return(base.DispatchGenericMotionEvent(ev)); //See what base has to say
        }
示例#2
0
 public override bool DispatchKeyEvent(KeyEvent e)
 {
     if (AndroidGamepad.IsJoystickEvent(e))
     {
         AndroidGamepad.GetPad(GamepadId.Pad1).HandleJoystickEvent(e);
         return(true); //Handled
     }
     else
     {
         return(base.DispatchKeyEvent(e)); //See what base has to say
     }
 }
示例#3
0
        public AndroidGamepad(Gamepad pad) : base(pad)
        {
            switch (pad.Id)
            {
            case GamepadId.Pad1:
                Pad1 = this;
                break;

            case GamepadId.Pad2:
                Pad2 = this;
                break;

            case GamepadId.Pad3:
                Pad3 = this;
                break;

            case GamepadId.Pad4:
                Pad4 = this;
                break;
            }
        }