demoWaitForInput

A function that can be used in Scripting.

## Syntax and semantics

`demoWaitForInput` ( )
  wait for a user event (click or key press) in the Demo window.

## Behaviour

This function blocks until the user clicks in the Demo window or types a key into the Demo window.

## Return value

Once the function finally returns, it returns the value 1 (true). This makes it possible to use this function in a `while` loop:

`while demoWaitForInput ()
` `if demoClicked ())
` `# handle the mouse click
` `elsif demoKeyPressed ())
` `# handle the key press
` `endif
` `endwhile
`

### Links to this page

- `demoShow`
- Demo window
- Demo window 2. Getting user input
- Demo window 3. Getting click locations
- Demo window 5. Asynchronous play
- Demo window 6. Animation
- Functions