Sign in Join
FPDoc Onlineexperiment

TCustomIdleTimer.DoOnUserInput procedure

Member of TCustomIdleTimerprotectedIn unit ExtCtrls

Enables or disables the timer when a user input event is received and AutoEnable is set to True.

Declaration

pascal
procedure DoOnUserInput(Sender: TObject; var Msg: TLMessage); virtual

Arguments

Sender

Object instance for the event notification. Not used in the method.

Msg

Message structure with the message code and parameter values for the event notification. Not used in the method.

Description

DoOnUserInput is an event handler routine used to enable or disable the timer when a user input event has been received. It is an implementation of the TOnUserInputEvent type, and is added to (or removed from) the ahtUserInput handlers used in the TApplication instance when the value in AutoEnable has been changed; changing AutoEnable to True causes the handler routine to be added to the application.

DoOnUserInput ensures that FireOnIdle is to False to prevent execution of the OnTimer event while the method is active. No additional actions are performed in the method if AutoEnable has been set to False.

If AutoEnable is True, the Enabled property is updated based on the setting in AutoStartEvent and AutoEndEvent. Enabled is set to False if AutoEndEvent is set to itaOnUserInput. Enabled is set to True if AutoStartEvent is set to itaOnUserInput. AutoStartEvent takes precedence if both properties are set to itaOnUserInput.

Modified in LCL version 5.0 to use TLMessage in the Msg argument instead of the cardinal value for the notification message.

See also

An experiment, built from development snapshots. Not the official Free Pascal or Lazarus documentation.