Beispiel #1
0
        public bool IsButtonPressed(uint port, RETRO_DEVICE_ID_JOYPAD button)
        {
            HidState state = _currentState;

            if (state == null)
            {
                return(false);
            }

            ushort hidButton;

            if (_buttonToButtonMappings.TryGetValue(button, out hidButton))
            {
                return(IsButtonPressed(hidButton, state));
            }

            DirectionPadState directionPadState;

            if (_directionPadToButtonMappings.TryGetValue(button, out directionPadState))
            {
                return(IsDirectionPadPressed(directionPadState, state));
            }

            HidAxis axis;

            if (_analogToButtonMappings.TryGetValue(button, out axis))
            {
                return(IsAxisPressed(axis, state, _axisDeadZone));
            }

            return(false);
        }
        public bool IsButtonPressed(uint port, RETRO_DEVICE_ID_JOYPAD button)
        {
            if (port != _controllerIndex)
            {
                return(false);
            }
            Gamepad gamepad;

            if (!TryGetGamepad(out gamepad))
            {
                return(false);
            }

            GamepadButtonFlags buttonFlag;

            if (_buttonToButtonMappings.TryGetValue(button, out buttonFlag))
            {
                return(IsButtonPressed(buttonFlag, gamepad));
            }
            XInputAxis axis;

            if (_analogToButtonMappings.TryGetValue(button, out axis))
            {
                return(IsAxisPressed(axis, gamepad, _thumbDeadZone, _triggerDeadZone));
            }
            return(false);
        }
Beispiel #3
0
 public bool IsButtonPressed(uint port, RETRO_DEVICE_ID_JOYPAD button)
 {
     return(false);
 }
Beispiel #4
0
 public bool IsButtonPressed(uint port, RETRO_DEVICE_ID_JOYPAD button)
 {
     return(port < _maxControllers ? _retroPads[port].IsButtonPressed(port, button) : false);
 }
 protected bool GetRetroPadStatus(uint port, RETRO_DEVICE_ID_JOYPAD button)
 {
     return(_retroPad != null && _retroPad.IsButtonPressed(port, button));
 }
Beispiel #6
0
        public bool IsButtonPressed(uint port, RETRO_DEVICE_ID_JOYPAD button)
        {
            Keys key;

            return(_buttonMappings.TryGetValue(button, out key) && Keyboard.IsKeyDown(key));
        }
Beispiel #7
0
 public void MapButton(RETRO_DEVICE_ID_JOYPAD retroButton, DeviceInput deviceInput)
 {
     _buttonMappings[retroButton] = deviceInput;
 }