Exemplo n.º 1
0
        public static string ToLabel(this KeyboardKey key)
        {
            if (key.IsAcceptableInput())
            {
                return(key.ToChar().ToString());
            }
            else
            {
                switch (key)
                {
                case KeyboardKey.Backspace:
                    return("←");

                case KeyboardKey.Return:
                    return("return");

                default:
                    throw new System.Exception($"unexpected keycode {key}");
                }
            }
        }