示例#1
0
 private static char TranslateChar(Key key)
 {
     if (key >= Key.A && key <= Key.Z)
     {
         return((char)('a' + ((int)key - (int)Key.A)));
     }
     return(' ');
 }
示例#2
0
        private GwenMappedKey TranslateKeyCode(Key key)
        {
            switch (key)
            {
            case Key.BackSpace: return(GwenMappedKey.Backspace);

            case Key.Enter: return(GwenMappedKey.Return);

            case Key.KeypadEnter: return(GwenMappedKey.Return);

            case Key.Escape: return(GwenMappedKey.Escape);

            case Key.Tab: return(GwenMappedKey.Tab);

            case Key.Space: return(GwenMappedKey.Space);

            case Key.Up: return(GwenMappedKey.Up);

            case Key.Down: return(GwenMappedKey.Down);

            case Key.Left: return(GwenMappedKey.Left);

            case Key.Right: return(GwenMappedKey.Right);

            case Key.Home: return(GwenMappedKey.Home);

            case Key.End: return(GwenMappedKey.End);

            case Key.Delete: return(GwenMappedKey.Delete);

            case Key.LControl:
                controlPressed = true;
                return(GwenMappedKey.Control);

            case Key.LAlt: return(GwenMappedKey.Alt);

            case Key.LShift: return(GwenMappedKey.Shift);

            case Key.RControl: return(GwenMappedKey.Control);

            case Key.RAlt:
                if (controlPressed)
                {
                    canvas.Input_Key(GwenMappedKey.Control, false);
                }
                return(GwenMappedKey.Alt);

            case Key.RShift: return(GwenMappedKey.Shift);
            }
            return(GwenMappedKey.Invalid);
        }