Mapping Key Bindings
You can invoke most commands with a keyboard shortcut in addition to a menu entry or button on a command bar. You can set these keyboard shortcuts on a per-command basis by using the Command.Bindings property. This property returns or accepts a SafeArray (essentially an array of objects) that contains each shortcut as an element of the array.
Key bindings are represented as strings with the following format: [scopename]::[modifier+][key].
Scopename is used to refer to the scope where the shortcut is valid, such as Text Editor or Global. The modifier token is used to specify the key modifier, such as Ctrl+, Alt+, or Shift+. (Modifiers are not required.) And the key is the keyboard key that is pressed (in conjunction with the ...
Become an O’Reilly member and get unlimited access to this title plus top books and audiobooks from O’Reilly and nearly 200 top publishers, thousands of courses curated by job role, 150+ live events each month,
and much more.
Read now
Unlock full access