| Introduction | MTB Statements | File System | Compiler | Applications | Reference Guide | Index |
Your MTB program can poll the mouse without requiring the operator to click a mouse button. This allows for continuous mouse monitoring and gives you the ability to create "hot zones" on the screen (i.e., screen locations that respond to mouse movements without mouse clicks).
The (Read Mouse) mnemonic polls the mouse and places 4 bytes (binary encoded) into the input buffer.
Note: This action occurs automatically when the mouse is clicked. However, the (Read Mouse) mnemonic does not require a mouse click.
The 4 bytes are:
| Byte | Description |
|---|---|
| 1-2 | Screen coordinates where mouse was clicked |
| 3 | which button was pressed |
| 4 | the current state of the mouse buttons |
See Reading the mouse pseudocode for a complete description.
Also see the Mouse demo program.