IVsFilterKeys2.TranslateAcceleratorEx Method

Takes a Windows message, translates it into a command, and, optionally, executes the command.

Namespace:  Microsoft.VisualStudio.Shell.Interop
Assembly:  Microsoft.VisualStudio.Shell.Interop.8.0 (in Microsoft.VisualStudio.Shell.Interop.8.0.dll)

Syntax

'Declaration
Function TranslateAcceleratorEx ( _
    pMsg As MSG(), _
    dwFlags As UInteger, _
    cKeyBindingScopes As UInteger, _
    rgguidKeyBindingScopes As Guid(), _
    <OutAttribute> ByRef pguidCmd As Guid, _
    <OutAttribute> ByRef pdwCmd As UInteger, _
    <OutAttribute> ByRef fCmdTranslated As Integer, _
    <OutAttribute> ByRef pfKeyComboStartsChord As Integer _
) As Integer
int TranslateAcceleratorEx(
    MSG[] pMsg,
    uint dwFlags,
    uint cKeyBindingScopes,
    Guid[] rgguidKeyBindingScopes,
    out Guid pguidCmd,
    out uint pdwCmd,
    out int fCmdTranslated,
    out int pfKeyComboStartsChord
)
int TranslateAcceleratorEx(
    [InAttribute] array<MSG>^ pMsg, 
    [InAttribute] unsigned int dwFlags, 
    [InAttribute] unsigned int cKeyBindingScopes, 
    [InAttribute] array<Guid>^ rgguidKeyBindingScopes, 
    [OutAttribute] Guid% pguidCmd, 
    [OutAttribute] unsigned int% pdwCmd, 
    [OutAttribute] int% fCmdTranslated, 
    [OutAttribute] int% pfKeyComboStartsChord
)
abstract TranslateAcceleratorEx : 
        pMsg:MSG[] * 
        dwFlags:uint32 * 
        cKeyBindingScopes:uint32 * 
        rgguidKeyBindingScopes:Guid[] * 
        pguidCmd:Guid byref * 
        pdwCmd:uint32 byref * 
        fCmdTranslated:int byref * 
        pfKeyComboStartsChord:int byref -> int
function TranslateAcceleratorEx(
    pMsg : MSG[], 
    dwFlags : uint, 
    cKeyBindingScopes : uint, 
    rgguidKeyBindingScopes : Guid[], 
    pguidCmd : Guid, 
    pdwCmd : uint, 
    fCmdTranslated : int, 
    pfKeyComboStartsChord : int
) : int

Parameters

  • dwFlags
    Type: UInt32

    [in] Bit flags to determine whether or not to perform default actions, to execute the command, and the key bindings to use. Values formed from the __VSTRANSACCELEXFLAGS enumeration.

  • cKeyBindingScopes
    Type: UInt32

    [in] Number of key binding scopes to check. Length of the rgguidKeyBindingScopes array.

  • rgguidKeyBindingScopes
    Type: array<Guid[]

    [in] Array of GUIDs of the key binding scopes to use such as CMDUIGUID_TextEditor to use the current text editor key bindings.

  • pguidCmd
    Type: Guid%

    [out] Pointer to the GUID of the corresponding command.

  • pdwCmd
    Type: UInt32%

    [out] Pointer to the identifier of the command.

  • fCmdTranslated
    Type: Int32%

    [out] Boolean. Set to true if the message will translate to a command.

  • pfKeyComboStartsChord
    Type: Int32%

    [out] Boolean. Set to true if the key is the start of a multi-key sequence (chord).

Return Value

Type: Int32
If the message does or will translate to a command, the method returns S_OK, fills the pguidCmd and pdwCmd parameters with the command's GUID and ID, and sets fCmdTranslated to true. If the message does not or will not translate to a command, the method returns S_FALSE, sets the GUID and ID parameters to zero, and sets fCmdTranslated to false.

Remarks

COM Signature

From vsshell80.idl:

HRESULT TranslateAcceleratorEx(
  [in] LPMSG pMsg, 
  [in] VSTRANSACCELEXFLAGS dwFlags, 
  [in] DWORD cKeyBindingScopes,
  [in, size_is(cKeyBindingScopes)] const GUID rgguidKeyBindingScopes[],
  [out] GUID *pguidCmd, 
  [out] DWORD *pdwCmd,
  [out] BOOL *fCmdTranslated,
  [out] BOOL *pfKeyComboStartsChord
);

Notes to Callers

If you do not specify VSTAEXF_IgnoreActiveKBScopes, the currently active scopes are searched after those specified by the flags in dwFlags.

.NET Framework Security

See Also

Reference

IVsFilterKeys2 Interface

Microsoft.VisualStudio.Shell.Interop Namespace