Exemplo n.º 1
0
        // if XNA is being used, we need to do quite a bit of logic to make sure that the correct characters are output
        private static void KeyDownHandler(Keys key)
        {
            switch (key)
            {
            case Keys.LeftShift:
            case Keys.RightShift:
                KeyboardInputResolver.Shift = true;
                KeyboardInputResolver.Alt   = true;
                break;

            case Keys.CapsLock:
                KeyboardInputResolver.Caps = true;
                KeyboardInputResolver.Alt  = true;
                break;
            }

            KeyboardInputResolver.CharReceived?.Invoke(KeyboardInputResolver.ResolveChar(key));
        }
Exemplo n.º 2
0
 private static void KeyHeldHandler(Keys key)
 {
     KeyboardInputResolver.CharReceived?.Invoke(KeyboardInputResolver.ResolveChar(key));
 }