public RebindResult Rebind(Buttons newButton) { if (!IsRebindable) { return(RebindResult.NotAllowed); } if (GlobalInputProperties.IsButtonAllowed(newButton)) { if (ButtonList.Contains(newButton)) { ButtonList.Remove(newButton); return(RebindResult.Removed); } else { if (ButtonList.Count >= GlobalInputProperties.MaxGamepadButtons) { // if too many buttons, remove from head ButtonList.RemoveRange(0, ButtonList.Count - GlobalInputProperties.MaxGamepadButtons + 1); } ButtonList.Add(newButton); return(RebindResult.Added); } } else { return(RebindResult.NotAllowed); } }
public RebindResult Rebind(Keys newKey) { if (GlobalInputProperties.IsKeyAllowed(newKey)) { if (newKey == HardcodedKey) { if (UserKey == null) { return(RebindResult.NoOp); } else { UserKey = null; return(RebindResult.Removed); } } else if (newKey == UserKey) { UserKey = null; return(RebindResult.Removed); } else { UserKey = newKey; return(RebindResult.Added); } } else { return(RebindResult.NotAllowed); } }
protected override void Update() { var v = 0f; foreach (var item in SubAxes) { v += item.Value; } Value = GlobalInputProperties.CleanAxisInput(v); }
protected override void Update() { if (input2 == null) { Value = GlobalInputProperties.CleanAxisInput(input.Get(Index)); } else { Value = GlobalInputProperties.CleanAxisInput(input.Get(Index) + input2.Get(Index)); } }