Skip to content

KeyboardShortcuts.KeyboardShortcut

JaykeBird edited this page Feb 21, 2023 · 7 revisions

Back to home | Back to Reference | View raw text

KeyboardShortcut class

Description

Represents a single keyboard shortcut entry.

Diagram

  flowchart LR
  classDef interfaceStyle stroke-dasharray: 5 5;
  classDef abstractStyle stroke-width:4px
  subgraph SolidShineUi.KeyboardShortcuts
  SolidShineUi.KeyboardShortcuts.KeyboardShortcut[[KeyboardShortcut]]
  end
Loading

Members

Properties

Public properties

Type Name Methods
IKeyAction Action
The action associated with this keyboard shortcut. When this shortcut is activated, this is the action that will occur.
get
KeyboardCombination Combination
The control key combination needed before activating this shortcut. This shortcut will not activate unless these keys are also held down.
get
Key Key
The specific key that, when pressed, triggers the shortcut.
get
string KeyString
The string to display to the user, so they know which keys to press to activate the shortcut.
get
string MethodId
Get or set the ID associated with the action of the keyboard shortcut, which is used for mapping shortcuts to actions (for example while loading or saving files). This should match the ID in the Action property.
get, set
UIElement SourceElement
Get or set the element associated with this keyboard shortcut and action (such as a menu item if the action is associated with the command of a menu item). Having an element is not required.
get, set

Details

Summary

Represents a single keyboard shortcut entry.

Constructors

KeyboardShortcut

public KeyboardShortcut(KeyboardCombination combination, Key key, IKeyAction action)
Arguments
Type Name Description
KeyboardCombination combination The key combination needed, if any, for activating this shortcut.
Key key The specific key that corresponds to this shortcut.
IKeyAction action The action to perform when this shortcut is activated.
Summary

Create a keyboard shortcut entry.

Properties

Combination

public KeyboardCombination Combination { get; }
Summary

The control key combination needed before activating this shortcut. This shortcut will not activate unless these keys are also held down.

Key

public Key Key { get; }
Summary

The specific key that, when pressed, triggers the shortcut.

KeyString

public string KeyString { get; }
Summary

The string to display to the user, so they know which keys to press to activate the shortcut.

Action

public IKeyAction Action { get; }
Summary

The action associated with this keyboard shortcut. When this shortcut is activated, this is the action that will occur.

MethodId

public string MethodId { get; set; }
Summary

Get or set the ID associated with the action of the keyboard shortcut, which is used for mapping shortcuts to actions (for example while loading or saving files). This should match the ID in the Action property.

SourceElement

public UIElement SourceElement { get; set; }
Summary

Get or set the element associated with this keyboard shortcut and action (such as a menu item if the action is associated with the command of a menu item). Having an element is not required.

Generated with ModularDoc

Clone this wiki locally