Esempio n. 1
0
        //Add any additional event handlers here. NOTE: this method is not for binding event handlers to
        //Menu Items. That is handled in the Routed UI Commands (Maps to Custom Event Handlers) section at
        //the bottom of this class. Also see README for more info
        public void ProcessKeyDownEvent(KeyEventArgs e)
        {
            switch (e.Key)
            {
            case Key.Left:
            case Key.Right:
            case Key.Up:
            case Key.Down:
                ContentGrid.ProcessArrowNavigation(e.Key, isAltDown, isControlDown, isShiftDown);
                break;

            case Key.LeftAlt:
            case Key.RightAlt:
                isAltDown = true;
                break;

            case Key.LeftCtrl:
            case Key.RightCtrl:
                isControlDown = true;
                break;

            case Key.LeftShift:
            case Key.RightShift:
                isShiftDown = true;
                break;

            default:
                break;
            }
            switch ((ModifierKeys)e.Key)
            {
            case ModifierKeys.Alt:
                isAltDown = true;
                break;

            case ModifierKeys.Control:
                isControlDown = true;
                break;

            case ModifierKeys.Shift:
                isShiftDown = true;
                break;

            default:
                break;
            }
        }