IKeyPressEventArgs.Key

Syntax

Key: Char;

Description

The Key property determines character of the key that was pressed. The characters in the upper and lower cases and characters of Cyrillic and Latin alphabets are distinguished.

Example

Executing the example requires a form. Several components that can receive focus are placed on the form. The following procedure is used as a handler of the OnKeyPress event for all components:

Sub ProcedureOnKeyPress(Sender: Object; Args: IKeyPressEventArgs);

Begin

If Args.Key = 'A' Then

Args.Key := 'a';

End If;

End Sub ProcedureOnKeyPress;

After executing the example, if the "A" Latin capital was pressed on entering the text in the area of any component, this letter is replaced with the "a" Latin lowercase letter in the text.

See also:

IKeyPressEventArgs