Ejemplo n.º 1
0
        public static KeyPressCode Key2KeyPressCode(Key k)
        {
            KeyPressCode rv = (KeyPressCode)k;

            if (Keyboard.IsKeyDown(Key.LeftCtrl))
            {
                rv |= KeyPressCode.LeftCtrl;
            }
            if (Keyboard.IsKeyDown(Key.RightCtrl))
            {
                rv |= KeyPressCode.RightShift;
            }

            if (Keyboard.IsKeyDown(Key.LeftAlt))
            {
                rv |= KeyPressCode.LeftAlt;
            }
            if (Keyboard.IsKeyDown(Key.RightAlt))
            {
                rv |= KeyPressCode.RightAlt;
            }

            if (Keyboard.IsKeyDown(Key.LeftShift))
            {
                rv |= KeyPressCode.LeftShift;
            }
            if (Keyboard.IsKeyDown(Key.RightShift))
            {
                rv |= KeyPressCode.RightShift;
            }

            if (Keyboard.IsKeyDown(Key.LWin))
            {
                rv |= KeyPressCode.LeftWin;
            }
            if (Keyboard.IsKeyDown(Key.RWin))
            {
                rv |= KeyPressCode.RightWin;
            }

            if (Keyboard.IsKeyDown(Key.Apps))
            {
                rv |= KeyPressCode.Apps;
            }

            return(rv);
        }
Ejemplo n.º 2
0
 public static KeyPressCode GetKeyPressMetaBits(KeyPressCode k)
 {
     return(k & KeyPressCode.MetaKeysMask);
 }
Ejemplo n.º 3
0
 public static KeyPressCode GetCleanKeyPressCode(KeyPressCode k)
 {
     return(k & KeyPressCode.KeyCodeMask);
 }