vimage.Config.ControlsToString C# (CSharp) Method

ControlsToString() public static method

Converts list of controls (Keyboard.Key and Mouse.Button) to their string names seperated by commas.
public static ControlsToString ( List controls ) : string
controls List
return string
        public static string ControlsToString(List<int> controls)
        {
            string str = "";
            bool nextIsKeyCombo = false;

            for (int i = 0; i < controls.Count; i++)
            {
                if (controls[i] == -2 && controls.Count > 2)
                {
                    nextIsKeyCombo = true;
                    continue;
                }
                if (nextIsKeyCombo)
                {
                    str += ControlToString(controls[i]) + "+" + ControlToString(controls[i+1]);
                    nextIsKeyCombo = false;
                    i++;
                }
                else
                    str += ControlToString(controls[i]);

                if (i != controls.Count - 1)
                    str += ", ";
            }

            return str;
        }