Skip to content
Permalink
Branch: master
Find file Copy path
Find file Copy path
Fetching contributors…
Cannot retrieve contributors at this time
174 lines (162 sloc) 8.48 KB
<Type Name="ModifierKeys" FullName="System.Windows.Input.ModifierKeys">
<TypeSignature Language="C#" Value="public enum ModifierKeys" />
<TypeSignature Language="ILAsm" Value=".class public auto ansi sealed ModifierKeys extends System.Enum" />
<TypeSignature Language="DocId" Value="T:System.Windows.Input.ModifierKeys" />
<TypeSignature Language="VB.NET" Value="Public Enum ModifierKeys" />
<TypeSignature Language="C++ CLI" Value="public enum class ModifierKeys" />
<TypeSignature Language="F#" Value="type ModifierKeys = " />
<AssemblyInfo>
<AssemblyName>WindowsBase</AssemblyName>
<AssemblyVersion>3.0.0.0</AssemblyVersion>
<AssemblyVersion>4.0.0.0</AssemblyVersion>
</AssemblyInfo>
<Base>
<BaseTypeName>System.Enum</BaseTypeName>
</Base>
<Attributes>
<Attribute>
<AttributeName>System.ComponentModel.TypeConverter(typeof(System.Windows.Input.ModifierKeysConverter))</AttributeName>
</Attribute>
<Attribute>
<AttributeName>System.Flags</AttributeName>
</Attribute>
<Attribute>
<AttributeName>System.Windows.Markup.ValueSerializer(typeof(System.Windows.Input.ModifierKeysValueSerializer))</AttributeName>
</Attribute>
</Attributes>
<Docs>
<summary>Specifies the set of modifier keys.</summary>
<remarks>
<format type="text/markdown"><![CDATA[
## Remarks
The <xref:System.Windows.Input.Keyboard.Modifiers%2A> property on the <xref:System.Windows.Input.Keyboard> class is the set of the modifier keys that are currently pressed.
Some [!INCLUDE[TLA#tla_api#plural](~/includes/tlasharptla-apisharpplural-md.md)] in [!INCLUDE[TLA#tla_winclient](~/includes/tlasharptla-winclient-md.md)] that make use of the <xref:System.Windows.Input.ModifierKeys> enumeration are the <xref:System.Windows.Input.Keyboard.Modifiers%2A> properties on the <xref:System.Windows.Input.Keyboard>, <xref:System.Windows.Input.KeyBinding>, <xref:System.Windows.Input.KeyGesture>, and <xref:System.Windows.Input.MouseGesture> classes.
<a name="xamlAttributeUsage_ModifierKeys"></a>
## XAML Attribute Usage
```
<object property="oneOrMoreModifierKeys"/>
```
<a name="xamlValues_ModifierKeys"></a>
## XAML Values
*oneOrMoreModifierKeys*
One or more modifier keys, defined by the <xref:System.Windows.Input.ModifierKeys> enumeration, delimited with a "+" character.
## Examples
The following example shows how to create a <xref:System.Windows.Input.KeyBinding> that associates a <xref:System.Windows.Input.KeyGesture> with a <xref:System.Windows.Input.RoutedCommand>. The <xref:System.Windows.Input.KeyBinding> uses the <xref:System.Windows.Input.ModifierKeys> enumeration to specify the modifier key of the gesture.
[!code-xaml[commandWithHandler#CommandHandlerKeyBinding](~/samples/snippets/csharp/VS_Snippets_Wpf/commandWithHandler/CSharp/Window1.xaml#commandhandlerkeybinding)]
[!code-csharp[commandhandlerprocedural#CommandHandlerKeyBindingCodeBehind](~/samples/snippets/csharp/VS_Snippets_Wpf/CommandHandlerProcedural/CSharp/Window1.xaml.cs#commandhandlerkeybindingcodebehind)]
[!code-vb[commandhandlerprocedural#CommandHandlerKeyBindingCodeBehind](~/samples/snippets/visualbasic/VS_Snippets_Wpf/CommandHandlerProcedural/visualbasic/window1.xaml.vb#commandhandlerkeybindingcodebehind)]
]]></format>
</remarks>
<altmember cref="P:System.Windows.Input.Keyboard.Modifiers" />
<altmember cref="T:System.Windows.Input.KeyBinding" />
<altmember cref="T:System.Windows.Input.KeyGesture" />
<altmember cref="T:System.Windows.Input.MouseGesture" />
</Docs>
<Members>
<Member MemberName="Alt">
<MemberSignature Language="C#" Value="Alt" />
<MemberSignature Language="ILAsm" Value=".field public static literal valuetype System.Windows.Input.ModifierKeys Alt = int32(1)" />
<MemberSignature Language="DocId" Value="F:System.Windows.Input.ModifierKeys.Alt" />
<MemberSignature Language="VB.NET" Value="Alt" />
<MemberSignature Language="C++ CLI" Value="Alt" />
<MemberSignature Language="F#" Value="Alt = 1" Usage="System.Windows.Input.ModifierKeys.Alt" />
<MemberType>Field</MemberType>
<AssemblyInfo>
<AssemblyName>WindowsBase</AssemblyName>
<AssemblyVersion>3.0.0.0</AssemblyVersion>
<AssemblyVersion>4.0.0.0</AssemblyVersion>
</AssemblyInfo>
<ReturnValue>
<ReturnType>System.Windows.Input.ModifierKeys</ReturnType>
</ReturnValue>
<MemberValue>1</MemberValue>
<Docs>
<summary>The ALT key.</summary>
</Docs>
</Member>
<Member MemberName="Control">
<MemberSignature Language="C#" Value="Control" />
<MemberSignature Language="ILAsm" Value=".field public static literal valuetype System.Windows.Input.ModifierKeys Control = int32(2)" />
<MemberSignature Language="DocId" Value="F:System.Windows.Input.ModifierKeys.Control" />
<MemberSignature Language="VB.NET" Value="Control" />
<MemberSignature Language="C++ CLI" Value="Control" />
<MemberSignature Language="F#" Value="Control = 2" Usage="System.Windows.Input.ModifierKeys.Control" />
<MemberType>Field</MemberType>
<AssemblyInfo>
<AssemblyName>WindowsBase</AssemblyName>
<AssemblyVersion>3.0.0.0</AssemblyVersion>
<AssemblyVersion>4.0.0.0</AssemblyVersion>
</AssemblyInfo>
<ReturnValue>
<ReturnType>System.Windows.Input.ModifierKeys</ReturnType>
</ReturnValue>
<MemberValue>2</MemberValue>
<Docs>
<summary>The CTRL key.</summary>
</Docs>
</Member>
<Member MemberName="None">
<MemberSignature Language="C#" Value="None" />
<MemberSignature Language="ILAsm" Value=".field public static literal valuetype System.Windows.Input.ModifierKeys None = int32(0)" />
<MemberSignature Language="DocId" Value="F:System.Windows.Input.ModifierKeys.None" />
<MemberSignature Language="VB.NET" Value="None" />
<MemberSignature Language="C++ CLI" Value="None" />
<MemberSignature Language="F#" Value="None = 0" Usage="System.Windows.Input.ModifierKeys.None" />
<MemberType>Field</MemberType>
<AssemblyInfo>
<AssemblyName>WindowsBase</AssemblyName>
<AssemblyVersion>3.0.0.0</AssemblyVersion>
<AssemblyVersion>4.0.0.0</AssemblyVersion>
</AssemblyInfo>
<ReturnValue>
<ReturnType>System.Windows.Input.ModifierKeys</ReturnType>
</ReturnValue>
<MemberValue>0</MemberValue>
<Docs>
<summary>No modifiers are pressed.</summary>
</Docs>
</Member>
<Member MemberName="Shift">
<MemberSignature Language="C#" Value="Shift" />
<MemberSignature Language="ILAsm" Value=".field public static literal valuetype System.Windows.Input.ModifierKeys Shift = int32(4)" />
<MemberSignature Language="DocId" Value="F:System.Windows.Input.ModifierKeys.Shift" />
<MemberSignature Language="VB.NET" Value="Shift" />
<MemberSignature Language="C++ CLI" Value="Shift" />
<MemberSignature Language="F#" Value="Shift = 4" Usage="System.Windows.Input.ModifierKeys.Shift" />
<MemberType>Field</MemberType>
<AssemblyInfo>
<AssemblyName>WindowsBase</AssemblyName>
<AssemblyVersion>3.0.0.0</AssemblyVersion>
<AssemblyVersion>4.0.0.0</AssemblyVersion>
</AssemblyInfo>
<ReturnValue>
<ReturnType>System.Windows.Input.ModifierKeys</ReturnType>
</ReturnValue>
<MemberValue>4</MemberValue>
<Docs>
<summary>The SHIFT key.</summary>
</Docs>
</Member>
<Member MemberName="Windows">
<MemberSignature Language="C#" Value="Windows" />
<MemberSignature Language="ILAsm" Value=".field public static literal valuetype System.Windows.Input.ModifierKeys Windows = int32(8)" />
<MemberSignature Language="DocId" Value="F:System.Windows.Input.ModifierKeys.Windows" />
<MemberSignature Language="VB.NET" Value="Windows" />
<MemberSignature Language="C++ CLI" Value="Windows" />
<MemberSignature Language="F#" Value="Windows = 8" Usage="System.Windows.Input.ModifierKeys.Windows" />
<MemberType>Field</MemberType>
<AssemblyInfo>
<AssemblyName>WindowsBase</AssemblyName>
<AssemblyVersion>3.0.0.0</AssemblyVersion>
<AssemblyVersion>4.0.0.0</AssemblyVersion>
</AssemblyInfo>
<ReturnValue>
<ReturnType>System.Windows.Input.ModifierKeys</ReturnType>
</ReturnValue>
<MemberValue>8</MemberValue>
<Docs>
<summary>The Windows logo key.</summary>
</Docs>
</Member>
</Members>
</Type>
You can’t perform that action at this time.