Unit 'Forms' Package
[Overview][Constants][Types][Classes][Procedures and functions][Variables][Index] [#lcl]


Determines whether the specified virtual key is used as an accelerator (short cut) in the given caption string.


Source position: forms.pp line 1973

function IsAccel(

  VK: Word;

  const Str: string





The virtual key (uppercase ASCII) to find.



The string to scan.

Function result

True when the key is used as an accelerator.


An accelerator consists of an ampersand followed by the accelerator key. Duplicate ampersands are ignored; they denote a literal (displayed) ampersand character (&).

IsAccel calls UTF8Pos to locate all occurrences of a single Ampersand character in Str. The character immediately following the Ampersand is the short cut character for the accelerator, and it is compared to the numeric value in VK. If one of the short cut characters matches the value in VK, the return value is set to True and the routine is exited. If none of the short cut characters match VK, or an accelerator is not present in Str, the return value is False.

IsAccel is called from controls which implement overridden CMDialogChar or DialogChar methods. It is also called when widgetset classes handle menu item selection and execution in an application.

CT Web help

CodeTyphon Studio