Skip to content

Latest commit

 

History

History
69 lines (55 loc) · 2.72 KB

keybinding-element.md

File metadata and controls

69 lines (55 loc) · 2.72 KB
title description ms.date ms.topic helpviewer_keywords author ms.author manager ms.subservice
KeyBinding Element
The KeyBinding element specifies keyboard shortcuts for the commands. Commands can have both single and dual key bindings associated with them.
11/04/2016
reference
VSCT XML schema elements, KeyBindings
KeyBinding element (VSCT XML schema)
maiak
maiak
mijacobs
extensibility-integration

KeyBinding element

The KeyBinding element specifies keyboard shortcuts for the commands.

Commands can have both single and dual key bindings associated with them. An example of a single key binding is Ctrl+S for the Save command. Dual key bindings require two successive key combinations to trigger a command. An example of a dual key binding is Ctrl+K,Ctrl+K to set a bookmark.

Syntax

<KeyBinding guid="MyGuid" id="MyId" editor="MyEditor" key1="B" key2="x" mod1="Control" mod2="Alt" />

Attributes and elements

The following sections describe attributes, child elements, and parent elements.

Attributes

Attribute Description
guid Required.
id Required.
editor Required. The editor GUID indicates the editing context for which this keyboard shortcut will be active. The global binding scope value is "guidVSStd97".
key1 Required. Valid values include all typable alphanumerics, and also two-digit hexadecimal values preceded by 0x and VK_constants.
mod1 Optional. Any combination of Control, Alt, and Shift separated by space.
key2 Optional. Valid values include all typable alphanumerics, and also two-digit hexadecimal values preceded by 0x and VK_constants.
mod2 Optional. Any combination of Control, Alt, and Shift separated by space.
emulator Optional.
Condition Optional. See Conditional attributes.

Child elements

Element Description
Parent
Annotation

Parent elements

Element Description
KeyBindings element Groups KeyBinding elements and other KeyBindings groupings.

Example

<KeyBindings>
  <KeyBinding guid="guidWidgetPackage" id="cmdidUpdateWidget"
    editor="guidWidgetEditor" key1="VK_F5"/>
  <KeyBinding guid="guidWidgetPackage" id="cmdidRunWidget"
    editor="guidWidgetEditor" key1="VK_F5" mod1="Control"/>
</KeyBindings>

See also