waitforbuttonpress

Wait for click or key press.

Syntax

  • w = waitforbuttonpress()

Output argument

  • w - a scalar double value: 0 for mouse button pressed, 1 for key pressed.

Description

w = waitforbuttonpress() pauses the execution of code until the user interacts with the current figure by either clicking a mouse button or pressing a key.

Example

cf = gcf(); w = waitforbuttonpress; axes;

See also

figure, gcf.

History

VersionDescription
1.7.0initial version

Author

Allan CORNET