Class KeyBinding
Implements input binding for keyboard keys
Implements
Inherited Members
Namespace: EmptyKeys.UserInterface.Input
Assembly: EmptyKeys.UserInterface.dll
Syntax
public class KeyBinding : InputBinding, ICommandSource
Constructors
KeyBinding()
Initializes a new instance of the KeyBinding class.
Declaration
public KeyBinding()
KeyBinding(ICommand, KeyCode, ModifierKeys)
Initializes a new instance of the KeyBinding class.
Declaration
public KeyBinding(ICommand command, KeyCode key, ModifierKeys modifiers)
Parameters
Type | Name | Description |
---|---|---|
ICommand | command | The command. |
EmptyKeys.UserInterface.Input.KeyCode | key | The key. |
ModifierKeys | modifiers | The modifiers. |
KeyBinding(ICommand, KeyGesture)
Initializes a new instance of the KeyBinding class.
Declaration
public KeyBinding(ICommand command, KeyGesture gesture)
Parameters
Type | Name | Description |
---|---|---|
ICommand | command | The command. |
KeyGesture | gesture | The gesture. |
Fields
KeyProperty
The key property
Declaration
public static readonly DependencyProperty KeyProperty
Field Value
Type | Description |
---|---|
DependencyProperty |
ModifiersProperty
The modifiers property
Declaration
public static readonly DependencyProperty ModifiersProperty
Field Value
Type | Description |
---|---|
DependencyProperty |
Properties
Gesture
Gets or sets the gesture.
Declaration
public override InputGesture Gesture { get; set; }
Property Value
Type | Description |
---|---|
InputGesture | The gesture. |
Overrides
Exceptions
Type | Condition |
---|---|
System.ArgumentException | Wrong Input Gesture type. Expected KeyGesture. |
Key
Gets or sets the key.
Declaration
public KeyCode Key { get; set; }
Property Value
Type | Description |
---|---|
EmptyKeys.UserInterface.Input.KeyCode | The key. |
Modifiers
Gets or sets the modifiers.
Declaration
public ModifierKeys Modifiers { get; set; }
Property Value
Type | Description |
---|---|
ModifierKeys | The modifiers. |