New to Telerik UI for WinFormsStart a free 30-day trial

Provides helper methods for the keyboard input.

Definition

Namespace:Telerik.WinForms.Controls.Spreadsheet.Utilities

Assembly:Telerik.WinControls.RadSpreadsheet.dll

Syntax:

C#
public static class KeyboardHelper

Inheritance: objectKeyboardHelper

Methods

Adds modifier to the key modifiers.

C#
public static ModifierKeys AddModifier(ModifierKeys modifiers, ModifierKeys modifier)
Parameters:modifiersModifierKeys

The key modifiers.

modifierModifierKeys

The modifier to add.

Returns:

ModifierKeys

The result key modifiers.

Gets the modifier key for Enter.

C#
public static ModifierKeys GetModifierKeyForEnter()
Returns:

ModifierKeys

The modifier key for Enter.

Determines whether alt key is pressed.

C#
public static bool IsAltPressed()
Returns:

bool

True if ALT key is pressed.

Determines whether the given key is CTRL.

C#
public static bool IsCtrlKey(Keys key)
Parameters:keyKeys

The key to be checked.

Returns:

bool

True if the key is CTRL.

Determines whether CTRL or Mac is pressed.

C#
public static bool IsCtrlOrMacPressed()
Returns:

bool

True if CTRL or Mac is pressed.

Determines whether keyboard focus is within the current UI element.

C#
public static bool IsKeyboardFocusWithin()
Returns:

bool

True if the focus is within the current UI element.

Determines whether modifier keys are pressed.

C#
public static bool IsModifierPressed(ModifierKeys modifiers, ModifierKeys modifier)
Parameters:modifiersModifierKeys

The modifier keys to check if modifier is contained.

modifierModifierKeys

The modifier.

Returns:

bool

True if modifier key is pressed.

Determines whether modifier keys are pressed.

C#
public static bool IsModifierPressed(ModifierKeys modifier)
Parameters:modifierModifierKeys

The modifier keys to look for.

Returns:

bool

True if modifier keys are pressed.

Determines whether the key is Shift key.

C#
public static bool IsShiftKey(Keys key)
Parameters:keyKeys

The key to be checked.

Returns:

bool

True if the key is Shift.

Determines whether shift key is pressed.

C#
public static bool IsShiftPressed()
Returns:

bool

True if shift key is pressed.

Determines whether shift key is pressed.

C#
public static bool IsShiftPressed(ModifierKeys modifiers)
Parameters:modifiersModifierKeys

The modifier keys to check if shift key is contained.

Returns:

bool

True if shift is pressed.

Removes key modifier from key modifiers.

C#
public static ModifierKeys RemoveModifier(ModifierKeys modifiers, ModifierKeys modifier)
Parameters:modifiersModifierKeys

The key modifiers.

modifierModifierKeys

The modifier to remove.

Returns:

ModifierKeys

The result key modifiers.