# waitforbuttonpress

## Purpose

Wait for key or mouse button press over a figure.

## Synopsis

    k = waitforbuttonpress

## Description

`k = waitforbuttonpress` stops execution until it detects a mouse button or key press over a figure window. It returns 1 if it detects a key press, or 0 if it detects a mouse button press. Additional information about the terminating event is available through the figure's `CurrentCharacter`, `SelectionType`, and `CurrentPoint` properties.

## See Also

     figure, gcf, ginput

(c) Copyright 1994 by The MathWorks, Inc.