# BlitzMax/Modules/User input/Polled input

The polled input module provides an easy way to detect keyboard and mouse input.
The functions in this module are only available when your program is running in Graphics mode. When working on GUI applications, you should use events instead.

# Functions
## AppSuspended

Function AppSuspended
Description: Get app suspended state
Returns: True if application is currently suspended.

## AppTerminate

Function AppTerminate
Description: Return app terminate state
Returns: True if user has requested to terminate application
Example:

## KeyHit

Function KeyHit( key )
Description: Check for key hit
Returns: Number of times key has been hit.
Information: The returned value represents the number of the times key has been hit since the last call to KeyHit with the same key.
See the key codes module for a list of valid key codes.
Example:

## KeyDown

Function KeyDown( key )
Description: Check for key state
Returns: True if key is currently down
Information: See the key codes module for a list of valid keycodes.
Example:

## GetChar

Function GetChar
Description: Get next character
Returns: The character code of the next character.
Information: As the user hits keys on the keyboard, BlitzMax records the character codes of these keystrokes into an internal 'character queue'.
GetChar removes the next character code from this queue and returns it the application.
If the character queue is empty, 0 is returned.

## FlushKeys

Function FlushKeys
Description: Flush key states and character queue.
Information: FlushKeys resets the state of all keys to 'off', and resets the character queue used by GetChar.

## MouseX

Function MouseX
Description: Get mouse x location
Returns: Mouse x axis location
Information: The returned value is relative to the left of the screen.
Example:

## MouseY

Function MouseY
Description: Get mouse y location
Returns: Mouse y axis location
Information: The returned value is relative to the top of the screen.
Example:

## MouseZ

Function MouseZ
Description: Get mouse wheel
Returns: Mouse wheel value
Information: The mouse wheel value increments when the mouse wheel is rolled 'away' from the user, and decrements when the mouse wheel is rolled 'towards' the user.
Example:

## MouseXSpeed

Function MouseXSpeed
Description: Get mouse x speed
Returns: Mouse x speed

## MouseYSpeed

Function MouseYSpeed
Description: Get mouse y speed
Returns: Mouse y speed

## MouseZSpeed

Function MouseZSpeed
Description: Get mouse z speed
Returns: Mouse z speed

## FlushMouse

Function FlushMouse
Description: Flush mouse button states
Information: FlushMouse resets the state of all mouse buttons to 'off'.

## MouseHit

Function MouseHit( button )
Description: Check for mouse button click
Returns: Number of times button has been clicked.
Information: The returned value represents the number of the times button has been clicked since the last call to MouseHit with the same button.
button should be 1 for the left mouse button, 2 for the right mouse button or 3 for the middle mouse button.
Example:

## MouseDown

Function MouseDown( button )
Description: Check for mouse button down state
Returns: True if button is currently down
Information: button should be 1 for the left mouse button, 2 for the right mouse button or 3 for the middle mouse button.
Example:

## WaitKey

Function WaitKey
Description: Wait for a key press
Returns: The keycode of the pressed key
Information: WaitKey suspends program execution until a key has been hit. The keycode of this key is then returned to the application.
See the key codes module for a list of valid keycodes.

## WaitChar

Function WaitChar
Description: Wait for a key press
Returns: The character code of the pressed key
Information: WaitChar suspends program execution until a character is available from GetChar. This character is then returned to the application.

## WaitMouse

Function WaitMouse
Description: Wait for mouse button click
Returns: The clicked button
Information: WaitMouse suspends program execution until a mouse button is clicked.
WaitMouse returns 1 if the left mouse button was clicked, 2 if the right mouse button was clicked or 3 if the middle mouse button was clicked.