Exemple #1
0
        /// <summary>
        /// Called when the control should process keyboard information.
        /// </summary>
        /// <param name="info">The keyboard information.</param>
        /// <returns>True if the keyboard was handled by this control.</returns>
        public override bool ProcessKeyboard(Input.Keyboard info)
        {
            if (info.IsKeyReleased(Keys.Space) || info.IsKeyReleased(Keys.Enter))
            {
                IsSelected = true;

                return(true);
            }
            else if (Parent != null)
            {
                if (info.IsKeyReleased(Keys.Up))
                {
                    Parent.TabPreviousControl();
                }

                else if (info.IsKeyReleased(Keys.Down))
                {
                    Parent.TabNextControl();
                }

                return(true);
            }

            return(false);
        }
Exemple #2
0
        /// <summary>
        /// Detects if the SPACE and ENTER keys are pressed and calls the <see cref="Click"/> method.
        /// </summary>
        /// <param name="info"></param>
        public override bool ProcessKeyboard(Input.Keyboard info)
        {
            if (info.IsKeyReleased(Keys.Space) || info.IsKeyReleased(Keys.Enter))
            {
                DoClick();
                return(true);
            }

            return(false);
        }
Exemple #3
0
        /// <summary>
        /// Focuses the previous or next selection button depending on if the UP or DOWN arrow keys were pressed.
        /// </summary>
        /// <param name="info">The keyboard state.</param>
        public override bool ProcessKeyboard(Input.Keyboard info)
        {
            if (info.IsKeyReleased(Keys.Up) && PreviousSelection != null)
            {
                PreviousSelection.IsFocused = true;

                return(true);
            }

            else if (info.IsKeyReleased(Keys.Down) && NextSelection != null)
            {
                NextSelection.IsFocused = true;

                return(true);
            }

            return(base.ProcessKeyboard(info));
        }
Exemple #4
0
        /// <summary>
        /// Focuses the previous or next selection button depending on if the UP or DOWN arrow keys were pressed.
        /// </summary>
        /// <param name="info">The keyboard state.</param>
        public override bool ProcessKeyboard(Input.Keyboard info)
        {
            if (info.IsKeyReleased(Keys.Up))
            {
                SelectPrevious();

                return(true);
            }

            else if (info.IsKeyReleased(Keys.Down))
            {
                SelectNext();

                return(true);
            }

            return(base.ProcessKeyboard(info));
        }