Exemple #1
0
        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);
        }
Exemple #2
0
 public void Clear(string key)
 {
     Keybinds.ToCollection().FirstOrDefault(x => x.Key == key).Value = string.Empty;
 }
Exemple #3
0
 public bool IsKeybindUsed(string keybind, string ignoreKey = null)
 {
     return(Keybinds.ToCollection().Any(x => x.Value == keybind && x.Key != ignoreKey));
 }