Partager via


IVsFilterKeys2.TranslateAcceleratorEx Method

Definition

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

public:
 int TranslateAcceleratorEx(cli::array <Microsoft::VisualStudio::OLE::Interop::MSG> ^ pMsg, System::UInt32 dwFlags, System::UInt32 cKeyBindingScopes, cli::array <Guid> ^ rgguidKeyBindingScopes, [Runtime::InteropServices::Out] Guid % pguidCmd, [Runtime::InteropServices::Out] System::UInt32 % pdwCmd, [Runtime::InteropServices::Out] int % fCmdTranslated, [Runtime::InteropServices::Out] int % pfKeyComboStartsChord);
public int TranslateAcceleratorEx (Microsoft.VisualStudio.OLE.Interop.MSG[] pMsg, uint dwFlags, uint cKeyBindingScopes, Guid[] rgguidKeyBindingScopes, out Guid pguidCmd, out uint pdwCmd, out int fCmdTranslated, out int pfKeyComboStartsChord);
abstract member TranslateAcceleratorEx : Microsoft.VisualStudio.OLE.Interop.MSG[] * uint32 * uint32 * Guid[] * Guid * uint32 * int * int -> int
Public Function TranslateAcceleratorEx (pMsg As MSG(), dwFlags As UInteger, cKeyBindingScopes As UInteger, rgguidKeyBindingScopes As Guid(), ByRef pguidCmd As Guid, ByRef pdwCmd As UInteger, ByRef fCmdTranslated As Integer, ByRef pfKeyComboStartsChord As Integer) As Integer

Parameters

pMsg
MSG[]

[in] Pointer to the Windows message.

dwFlags
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
UInt32

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

rgguidKeyBindingScopes
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
Guid

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

pdwCmd
UInt32

[out] Pointer to the identifier of the command.

fCmdTranslated
Int32

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

pfKeyComboStartsChord
Int32

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

Returns

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.

Applies to