Skip to content

Commit 81ea0ec

Browse files
committed
✨ make a distinction between valid and invalid bindings
semver: minor
1 parent f474d48 commit 81ea0ec

2 files changed

Lines changed: 3 additions & 1 deletion

File tree

EliteAPI/bindings/Binding.cs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,7 @@ public readonly struct Binding
88

99
public string Key { get; init; }
1010

11-
public string KeyCode => $"{string.Join("", Modifiers?.Select(m => m.KeyCode) ?? Enumerable.Empty<string>())}{BindingsUtils.GetKeyCode(Key)}";
11+
public string KeyCode => $"{string.Join("", Modifiers?.Select(m => m.KeyCode) ?? [])}{BindingsUtils.GetKeyCode(Key)}";
1212

1313
public Binding[]? Modifiers { get; init; }
1414

EliteAPI/bindings/Control.cs

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -13,6 +13,8 @@ public readonly struct Control
1313
public bool? IsInverted { get; init; }
1414

1515
public float? Deadzone { get; init; }
16+
17+
public bool IsValid => !string.IsNullOrEmpty(KeyCode);
1618

1719
public string KeyCode { get {
1820
if (Primary is { Device: "Keyboard" })

0 commit comments

Comments
 (0)