ModifierKeys Enumeration
Collapse the table of content
Expand the table of content

ModifierKeys Enumeration


Specifies the set of modifier keys.

Namespace:   System.Windows.Input
Assembly:  WindowsBase (in WindowsBase.dll)

public enum ModifierKeys

Member nameDescription

The ALT key.


The CTRL key.


No modifiers are pressed.


The SHIFT key.


The Windows logo key.

The Modifiers property on the Keyboard class is the set of the modifier keys that are currently pressed.

Some APIs in Windows Presentation Foundation (WPF) that make use of the ModifierKeys enumeration are the Modifiers properties on the Keyboard, KeyBinding, KeyGesture, and MouseGesture classes.

<object property="oneOrMoreModifierKeys"/>


One or more modifier keys, defined by the ModifierKeys enumeration, delimited with a "+" character.

Legacy Code Example

The following example shows how to create a KeyBinding that associates a KeyGesture with a RoutedCommand. The KeyBinding uses the ModifierKeys enumeration to specify the modifier key of the gesture.

Code snippet is not found. Confirm that the code snippet name 'commandWithHandler' is correct.Code snippet is not found. Confirm that the code snippet name 'commandhandlerprocedural' is correct.

.NET Framework
Available since 3.0
Available since 2.0
Windows Phone Silverlight
Available since 7.0
Return to top
© 2015 Microsoft