Exemplo n.º 1
0
        public override bool OnKeyUp([GeneratedEnum] Keycode keyCode, KeyEvent e)
        {
            PlayKey?key = null;

            switch (keyCode)
            {
            case Keycode.Escape:
            case Keycode.Q:
                key = PlayKey.Escape;
                break;

            case Keycode.DpadLeft:
                key = PlayKey.Left;
                break;

            case Keycode.DpadRight:
                key = PlayKey.Right;
                break;

            case Keycode.DpadUp:
                key = PlayKey.Up;
                break;

            case Keycode.DpadDown:
                key = PlayKey.Down;
                break;

            case Keycode.Space:
                key = PlayKey.Space;
                break;

            case Keycode.P:
                key = PlayKey.P;
                break;

            default:
                break;
            }

            if (key.HasValue)
            {
                _page.KeyUp(key.Value);
            }

            return(base.OnKeyUp(keyCode, e));
        }
Exemplo n.º 2
0
        private void ProcessKeyUp(VirtualKey virtualKey)
        {
            PlayKey key;

            switch (virtualKey)
            {
            case VirtualKey.Escape:
                key = PlayKey.Escape;
                break;

            case VirtualKey.Left:
                key = PlayKey.Left;
                break;

            case VirtualKey.Right:
                key = PlayKey.Right;
                break;

            case VirtualKey.Up:
                key = PlayKey.Up;
                break;

            case VirtualKey.Down:
                key = PlayKey.Down;
                break;

            case VirtualKey.Space:
                key = PlayKey.Space;
                break;

            case VirtualKey.P:
                key = PlayKey.P;
                break;

            default:
                return;
            }

            _page.KeyUp(key);
        }