SourceGrid.GridVirtual.IsInputKey C# (CSharp) Method

IsInputKey() protected method

Allow the grid to handle specials keys like Arrows and Tab. See also Grid.SpecialKeys
protected IsInputKey ( Keys keyData ) : bool
keyData Keys
return bool
        protected override bool IsInputKey(Keys keyData)
        {
            //Handle arrows and tab keys only if OverrideCommonCmdKey
            if (OverrideCommonCmdKey)
            {
                if ((SpecialKeys & GridSpecialKeys.Arrows) == GridSpecialKeys.Arrows)
                {
                    switch (keyData)
                    {
                        case Keys.Up:
                        case Keys.Down:
                        case Keys.Left:
                        case Keys.Right:
                        //altrimenti venivano (per qualche strana ragione) selezionate le scrollbars
                        case (Keys.Up | Keys.Shift):
                        case (Keys.Down | Keys.Shift):
                        case (Keys.Left | Keys.Shift):
                        case (Keys.Right | Keys.Shift):
                            return true;
                    }
                }

                if ((SpecialKeys & GridSpecialKeys.Tab) == GridSpecialKeys.Tab)
                {
                    switch (keyData)
                    {
                        case Keys.Tab:
                        case (Keys.Tab | Keys.Shift):
                            return true;
                    }
                }
            }

            return base.IsInputKey(keyData);
        }