This document is archived and information here might be outdated. Recommended version. |
ArcObjects namespaces > Controls > ESRI ArcGIS Controls > Interfaces > IC > ICommandPool2 Interface > ICommandPool2.TranslateAcceleratorKey Method (ArcObjects .NET 10.4 SDK) |
Translates the specified keyCode, if a corresponding accelerator exists.
[Visual Basic .NET] Public Function TranslateAcceleratorKey ( _ ByVal keyCode As Integer _ ) As Boolean
[C#] public bool TranslateAcceleratorKey ( int keyCode );
[C++]
HRESULT TranslateAcceleratorKey(
long keyCode,
VARIANT_BOOL* bHandled
);
[C++]
Parameters keyCode [in] keyCode is a parameter of type long bHandled [out, retval] bHandled is a parameter of type VARIANT_BOOL
Returns whether the specified keyCode is a supported accelerator (shortcut) or access key, defined in an ICommand::Caption property of a Command in the CommandPool. To translate an accelerator key, the ICommand::OnClick method must be called.
For example, a 'Close' command with the caption "&Close\tAlt+F4" has the 'ALT+F4' key combination as its shortcut key, and the 'C' key as its access key.
When using the TranslateAcceleratorKey pass the keyCode of the none system key only. For example, if the accelerator is "Ctrl+K", pass the keyCode for "K" to TranslateAcceleratorKey. The system will automatically check for the system key "Ctrl".