Beispiel #1
0
        public bool TryLoadButtonAssignment(GamepadButtons button, out VirtualKey assignment)
        {
            assignment = VirtualKey.None;
            var value = settings.Values[button.ToString()] as string;

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

            if (Enum.TryParse <VirtualKey>(value, out assignment))
            {
                return(true);
            }

            return(false);
        }
Beispiel #2
0
 public void RemoveButtonAssignment(GamepadButtons button)
 {
     settings.Values.Remove(button.ToString());
 }
 private void Gamepad_OnXBoxGamepadButtonPressA(object sender, GamepadButtons e)
 {
     UpdateOutput(e.ToString());
 }
Beispiel #4
0
 public void SaveButtonAssignment(GamepadButtons button, VirtualKey assignment)
 {
     settings.Values[button.ToString()] = assignment.ToString();
 }
 private async void Gamepad_OnXBoxGamepadButtonPressX(object sender, GamepadButtons e)
 {
     UpdateOutput(e.ToString());
     await gamepad.Vibrate();
 }