private bool NativeKeyboard_OnKeyDown(string input) { if (string.IsNullOrEmpty(CurrentKey)) { return(false); } if (input == "Escape") { CurrentKey = null; return(true); } if (!IsKeybindUsed(input, CurrentKey)) { var currentKeybind = Keybinds.ToCollection().FirstOrDefault(x => x.Key == CurrentKey); currentKeybind.Value = input; } CurrentKey = null; return(true); }
public void Clear(string key) { Keybinds.ToCollection().FirstOrDefault(x => x.Key == key).Value = string.Empty; }
public bool IsKeybindUsed(string keybind, string ignoreKey = null) { return(Keybinds.ToCollection().Any(x => x.Value == keybind && x.Key != ignoreKey)); }