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