Class KeyGesture
Defines a keyboard combination that can be used to invoke a command.
Inheritance
System.Object
KeyGesture
Namespace: Syncfusion.Blazor.Diagram
Assembly: Syncfusion.Blazor.dll
Syntax
public class KeyGesture : Object
Constructors
KeyGesture()
Declaration
public KeyGesture()
Properties
Key
Gets the key associated with this KeyGesture.
Declaration
public DiagramKeys Key { get; set; }
Property Value
Type | Description |
---|---|
DiagramKeys | The default value will be None |
Examples
<summary>
Notifies when to execute the custom keyboard commands .
</summary>
<remarks>
The following code illustrates how to create a custom command.
</remarks>
<example>
<code lang="Razor">
<![CDATA[
<SfDiagramComponent >
@* Initializing the custom commands*@
<CommandManager Commands = "@command">
</CommandManager>
</SfDiagramComponent>
@code
{
DiagramObjectCollection<KeyboardCommand> command = new DiagramObjectCollection<KeyboardCommand>()
{
new Command()
{
Name = "CustomGroup",
Gesture = new KeyGesture() { Key = DiagramKeys.G, Modifiers = ModifierKeys.Control }
},
new Command()
{
Name = "CustomUngroup",
Gesture = new KeyGesture() { Key = DiagramKeys.U, Modifiers = ModifierKeys.Control }
},
};
}
Modifiers
Gets the modifier keys associated with this KeyGesture. The default value is None.
Declaration
public ModifierKeys Modifiers { get; set; }
Property Value
Type | Description |
---|---|
ModifierKeys | The default value will be None |
Examples
<summary>
Notifies when to execute the custom keyboard commands .
</summary>
<remarks>
The following code illustrates how to create a custom command.
</remarks>
<example>
<code lang="Razor">
<![CDATA[
<SfDiagramComponent >
@* Initializing the custom commands*@
<CommandManager Commands = "@command" >
</CommandManager>
</SfDiagramComponent>
@code
{
DiagramObjectCollection<KeyboardCommand> command = new DiagramObjectCollection<KeyboardCommand>()
{
new Command()
{
Name = "CustomGroup",
Gesture = new KeyGesture() { Key = DiagramKeys.G, Modifiers = ModifierKeys.Control }
},
new Command()
{
Name = "CustomUngroup",
Gesture = new KeyGesture() { Key = DiagramKeys.U, Modifiers = ModifierKeys.Control }
},
};
}