Beispiel #1
0
 private static void setUnbind(string args)
 {
     if (args == "all")
     {
         KeyBinds.Reset();
         Pigeon.Console.Log("all custom binds reset");
     }
     else
     {
         var key = KeyBinds.ParseToKey(args);
         KeyBinds.UnbindKey(key);
         displayKeybind(key);
     }
 }
Beispiel #2
0
        private static void setBind(string args)
        {
            if (string.IsNullOrWhiteSpace(args))
            {
                Pigeon.Console.Log("current keybinds:");
                foreach (var boundKey in KeyBinds.GetAllKeyBinds().Keys)
                {
                    displayKeybind(boundKey);
                }
                return;
            }

            string[] splitArgs = args.Split(new[] { ' ' }, 2);

            Keys key = KeyBinds.ParseToKey(splitArgs[0]);

            if (splitArgs.Length == 2)      // create a new bind
            {
                KeyBinds.BindKey(key, splitArgs[1]);
            }

            // if no command is given, just display current bind for that key
            displayKeybind(key);
        }