vimage.Config.SetControls C# (CSharp) Method

SetControls() public static method

public static SetControls ( List controls ) : void
controls List
return void
        public static void SetControls(List<int> controls, params string[] bindings)
        {
            foreach (string str in bindings)
            {
                if (str.Equals(""))
                    continue;

                if (str.Contains("+"))
                {
                    controls.Add(-2); // denote that it's a key combo

                    string[] v = str.Split('+');

                    Keyboard.Key key1 = StringToKey(v[0].ToUpper());
                    if (key1 != Keyboard.Key.Unknown)
                        controls.Add((int)key1);
                    Keyboard.Key key2 = StringToKey(v[1].ToUpper());
                    if (key2 != Keyboard.Key.Unknown)
                        controls.Add((int)key2);

                }
                else if (str.StartsWith("MOUSE"))
                    controls.Add(StringToMouseButton(str));
                else
                    controls.Add((int)StringToKey(str.Replace(" ", "")));
            }
        }