Class KeyboardModifiers
This class presents a way to query the state of the various keyboard modifier keys. It also allows you to check the state of the shortcut key for the current platform.
Inheritance
Namespace: Telerik.Windows.Controls
Assembly: Telerik.Windows.Controls.dll
Syntax
public static class KeyboardModifiers : Object
Remarks
The different platforms Silverlight runs on employ differing input conventions. Thus shortcuts for common actions such as Copy, Paste and Select All are activated using one key on Windows (Control), but using another on Mac OS X (Apple). Using this class should save you tedious platform checks. It is inadvisable, however, to use the IsShortcutKeyDown property before you've researched what the accepted shortcut for the relevant platform is. Even though this class addresses a Silverlight scenario, it will also work on WPF.
Properties
IsAltDown
Gets a value indicating whether the Alt key is pressed.
Declaration
public static bool IsAltDown { get; }
Property Value
System.Boolean
|
IsCommandDown
Gets a value indicating whether the Apple (Command) key is pressed.
Declaration
public static bool IsCommandDown { get; }
Property Value
System.Boolean
|
Remarks
This is only applicable on Silverlight under Mac OS X.
IsControlDown
Gets a value indicating whether the Control key is pressed.
Declaration
public static bool IsControlDown { get; }
Property Value
System.Boolean
|
IsShiftDown
Gets a value indicating whether the Shift key is pressed.
Declaration
public static bool IsShiftDown { get; }
Property Value
System.Boolean
|
IsShortcutKeyDown
Gets a value indicating whether the platform-specific shortcut meta key is pressed.
Declaration
public static bool IsShortcutKeyDown { get; }
Property Value
System.Boolean
|
Remarks
For most systems (Windows + Linux) the shortcut key is Control. However, under Mac OS X the shortcut key is Apple (Command). Note that you still have to know if the relevant shortcut on Mac uses Command, because it can be entirely different.
Modifiers
Gets the keyboard modifier keys.
Declaration
public static ModifierKeys Modifiers { get; }
Property Value
System.Windows.Input.ModifierKeys
|