skip navigation
  • Product Bundles

    DevCraft

    All Telerik .NET tools and Kendo UI JavaScript components in one package. Now enhanced with:

    • AI Coding Assistants
    • Embedded Reporting
    • Document Processing Libraries
    • SSO Account Sign-in

    Web

    Kendo UI UI for Angular UI for Vue UI for jQuery KendoReact UI for Blazor UI for ASP.NET Core UI for ASP.NET MVC UI for ASP.NET AJAX

    Mobile

    UI for .NET MAUI

    Document Management

    Telerik Document Processing

    Desktop

    UI for .NET MAUI UI for WinUI UI for WinForms UI for WPF

    Reporting

    Telerik Reporting Telerik Report Server

    Testing & Mocking

    Test Studio Telerik JustMock

    CMS

    Sitefinity

    AI Productivity Tools

    AI Coding Assistants

    UI/UX Tools

    ThemeBuilder Design System Kit Templates and Building Blocks

    Debugging

    Fiddler Fiddler Everywhere Fiddler Classic Fiddler Everywhere Reporter FiddlerCore

    Free Tools

    KendoReact Free VB.NET to C# Converter Testing Framework
    View all products
  • Overview
  • Demos
    • What's New
    • Roadmap
    • Release History
  • Support and Learning

    • Support and Learning Hub
    • First Steps
    • Docs
    • Demos
    • Virtual Classroom
    • Forums
    • Videos
    • Blogs
    • Accessibility
    • Submit a Ticket

    Productivity and Design Tools

    • Visual Studio Extensions
    • Visual Studio Templates
    • Embedded Reporting
  • Pricing
  • Shopping cart
    • Account Overview
    • Your Licenses
    • Downloads
    • Support Center
    • Forum Profile
    • Payment Methods
    • Edit Profile
    • Log out
  • Login
  • Contact Us
  • Try now

Class KeyboardHelper

Provides helper methods for the keyboard input.

Inheritance
System.Object
KeyboardHelper
Inherited Members
System.Object.ToString()
System.Object.Equals(System.Object)
System.Object.Equals(System.Object, System.Object)
System.Object.ReferenceEquals(System.Object, System.Object)
System.Object.GetHashCode()
System.Object.GetType()
System.Object.MemberwiseClone()
Namespace: Telerik.WinForms.Controls.Spreadsheet.Utilities
Assembly: Telerik.WinControls.RadSpreadsheet.dll

Syntax

public static class KeyboardHelper

Methods

AddModifier(ModifierKeys, ModifierKeys)

Adds modifier to the key modifiers.

Declaration
public static ModifierKeys AddModifier(ModifierKeys modifiers, ModifierKeys modifier)
Parameters
System.Windows.Input.ModifierKeys modifiers

The key modifiers.

System.Windows.Input.ModifierKeys modifier

The modifier to add.

Returns
System.Windows.Input.ModifierKeys

The result key modifiers.

GetModifierKeyForEnter()

Gets the modifier key for Enter.

Declaration
public static ModifierKeys GetModifierKeyForEnter()
Returns
System.Windows.Input.ModifierKeys

The modifier key for Enter.

IsAltPressed()

Determines whether alt key is pressed.

Declaration
public static bool IsAltPressed()
Returns
System.Boolean

True if ALT key is pressed.

IsCtrlKey(Keys)

Determines whether the given key is CTRL.

Declaration
public static bool IsCtrlKey(Keys key)
Parameters
System.Windows.Forms.Keys key

The key to be checked.

Returns
System.Boolean

True if the key is CTRL.

IsCtrlOrMacPressed()

Determines whether CTRL or Mac is pressed.

Declaration
public static bool IsCtrlOrMacPressed()
Returns
System.Boolean

True if CTRL or Mac is pressed.

IsKeyboardFocusWithin()

Determines whether keyboard focus is within the current UI element.

Declaration
public static bool IsKeyboardFocusWithin()
Returns
System.Boolean

True if the focus is within the current UI element.

IsModifierPressed(ModifierKeys)

Determines whether modifier keys are pressed.

Declaration
public static bool IsModifierPressed(ModifierKeys modifier)
Parameters
System.Windows.Input.ModifierKeys modifier

The modifier keys to look for.

Returns
System.Boolean

True if modifier keys are pressed.

IsModifierPressed(ModifierKeys, ModifierKeys)

Determines whether modifier keys are pressed.

Declaration
public static bool IsModifierPressed(ModifierKeys modifiers, ModifierKeys modifier)
Parameters
System.Windows.Input.ModifierKeys modifiers

The modifier keys to check if modifier is contained.

System.Windows.Input.ModifierKeys modifier

The modifier.

Returns
System.Boolean

True if modifier key is pressed.

IsShiftKey(Keys)

Determines whether the key is Shift key.

Declaration
public static bool IsShiftKey(Keys key)
Parameters
System.Windows.Forms.Keys key

The key to be checked.

Returns
System.Boolean

True if the key is Shift.

IsShiftPressed()

Determines whether shift key is pressed.

Declaration
public static bool IsShiftPressed()
Returns
System.Boolean

True if shift key is pressed.

IsShiftPressed(ModifierKeys)

Determines whether shift key is pressed.

Declaration
public static bool IsShiftPressed(ModifierKeys modifiers)
Parameters
System.Windows.Input.ModifierKeys modifiers

The modifier keys to check if shift key is contained.

Returns
System.Boolean

True if shift is pressed.

RemoveModifier(ModifierKeys, ModifierKeys)

Removes key modifier from key modifiers.

Declaration
public static ModifierKeys RemoveModifier(ModifierKeys modifiers, ModifierKeys modifier)
Parameters
System.Windows.Input.ModifierKeys modifiers

The key modifiers.

System.Windows.Input.ModifierKeys modifier

The modifier to remove.

Returns
System.Windows.Input.ModifierKeys

The result key modifiers.

Getting Started
  • Install Now
  • Demos
  • Step-by-Step Tutorial
  • Sample Applications
  • SDK Samples
  • Visual Studio Extensions
Support Resources
  • Code Library
  • Knowledge Base
  • Videos
Community
  • Forums
  • Blogs
  • Feedback Portal
  • Document Processing Feedback Portal

Copyright © 2018 Progress Software Corporation and/or its subsidiaries or affiliates.
All Rights Reserved.

Progress, Telerik, and certain product names used herein are trademarks or registered trademarks of Progress Software Corporation and/or one of its subsidiaries or affiliates in the U.S. and/or other countries. See Trademarks for appropriate markings.