MATLAB Function Reference
  Go to function:
    Search    Help Desk 
waitforbuttonpress    Examples   See Also

Wait for key or mouse button press

Syntax

Description

k = waitforbuttonpress blocks the caller's execution stream until the function detects that the user has pressed a mouse button or a key while the Figure window is active. The function returns

Additional information about the event that causes execution to resume is available through the Figure's CurrentCharacter, SelectionType, and CurrentPoint properties.

If a WindowButtonDownFcn is defined for the Figure, its callback is executed before waitforbuttonpress returns a value.

Example

These statements display text in the Command Window when the user either clicks a mouse button or types a key in the Figure window:

See Also

dragrect, figure, gcf, ginput, rbbox, waitfor



[ Previous | Help Desk | Next ]