Exemplo n.º 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);
        }
Exemplo n.º 2
0
        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);
        }
Exemplo n.º 3
0
 public bool IsButtonPressed(uint port, RETRO_DEVICE_ID_JOYPAD button)
 {
     return(false);
 }
Exemplo n.º 4
0
 public bool IsButtonPressed(uint port, RETRO_DEVICE_ID_JOYPAD button)
 {
     return(port < _maxControllers ? _retroPads[port].IsButtonPressed(port, button) : false);
 }
Exemplo n.º 5
0
 protected bool GetRetroPadStatus(uint port, RETRO_DEVICE_ID_JOYPAD button)
 {
     return(_retroPad != null && _retroPad.IsButtonPressed(port, button));
 }
Exemplo n.º 6
0
        public bool IsButtonPressed(uint port, RETRO_DEVICE_ID_JOYPAD button)
        {
            Keys key;

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