Sub OnKeyUp(Sender: Object; Args: IKeyEventArgs);
Begin
//set of operators;
End Sub OnKeyUp;
Sender. Parameter that returns the component that has generated the event.
Args. Parameter that enables the user to determine event parameters.
The OnKeyUp event occurs if the component is in focus when the user releases any pressed key including such auxiliary keys as CTRL, SHIFT, and ALT.
If it is not necessary to recognize the auxiliary keys pressing, it is reasonable to use the OnKeyPress event.
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 OnKeyUp event for all components:
Sub OnKeyUp(Sender: Object; Args: IKeyEventArgs);
Begin
If (Args.ShiftState = ShiftState.Ctrl) And (Args.Key = Keys.B) Then
Text := (Sender As IControl).Name + " Up";
End If;
End Sub OnKeyUp;
After executing the example, if the combination of CTRL+B keys was pressed and released in the area of any component, the name of this component with the Up word is displayed in the form name.
See also: