Ejemplo n.º 1
0
        /// <summary>
        /// Handler for Left Arrow keyboard event.
        /// </summary>
        /// <param name="down">Indicates whether the key was pressed or released.</param>
        /// <returns>
        /// True if handled.
        /// </returns>
        protected override bool OnKeyLeft(bool down)
        {
            if (down)
            {
                var count = Parent.Children.Count;
                int me    = Parent.Children.IndexOf(this);
                if (me - 1 >= 0)
                {
                    var prevTab = Parent.Children[me - 1];
                    TabControl.OnTabPressed(prevTab);
                    InputHandler.Instance.KeyboardFocus = prevTab;
                }
            }

            return(true);
        }
Ejemplo n.º 2
0
        /// <summary>
        /// Handler for Right Arrow keyboard event.
        /// </summary>
        /// <param name="down">Indicates whether the key was pressed or released.</param>
        /// <returns>
        /// True if handled.
        /// </returns>
        protected override bool OnKeyRight(bool down)
        {
            if (down)
            {
                var count = Parent.Children.Count;
                int me    = Parent.Children.IndexOf(this);
                if (me + 1 < count)
                {
                    var nextTab = Parent.Children[me + 1];
                    TabControl.OnTabPressed(nextTab);
                    InputHandler.Instance.KeyboardFocus = nextTab;
                }
            }

            return(true);
        }