This document is archived and information here might be outdated. Recommended version. |
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
);
[C++]
Parameters keyCode [in]
keyCode is a parameter of type long
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".