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); }
public void RemoveButtonAssignment(GamepadButtons button) { settings.Values.Remove(button.ToString()); }
private void Gamepad_OnXBoxGamepadButtonPressA(object sender, GamepadButtons e) { UpdateOutput(e.ToString()); }
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(); }