2020-03-31 17:07:35 +00:00
|
|
|
[< back to index](../doc_index.md)
|
|
|
|
|
|
|
|
## mouse
|
|
|
|
|
2020-05-01 13:18:34 +00:00
|
|
|
The `mouse` module automatically imports the `coord` module.
|
2020-03-31 17:07:35 +00:00
|
|
|
|
|
|
|
The module contains global variables representing the state of the mouse.
|
|
|
|
If the program is not using any mouse driver, the state of these variables is undefined.
|
|
|
|
|
|
|
|
To actually use this module, an appropriate mouse module must be used, such as [`c1531`](./c64.md).
|
|
|
|
|
|
|
|
#### `x_coord mouse_x`
|
|
|
|
|
|
|
|
Mouse X position.
|
|
|
|
|
2020-05-01 13:18:34 +00:00
|
|
|
#### `y_coord mouse_y`
|
2020-03-31 17:07:35 +00:00
|
|
|
|
|
|
|
Mouse Y position.
|
|
|
|
|
2020-05-01 13:18:34 +00:00
|
|
|
#### `bool mouse_lbm`
|
2020-03-31 17:07:35 +00:00
|
|
|
|
2020-05-01 13:18:34 +00:00
|
|
|
`true` if the left mouse button is being pressed, `false` otherwise
|
|
|
|
|
|
|
|
#### `byte mouse_mbm`
|
|
|
|
|
|
|
|
`true` if the middle mouse button is being pressed, `false` otherwise.
|
|
|
|
Available only if `USE_MOUSE_MBM` is set and non-zero.
|
2020-03-31 17:07:35 +00:00
|
|
|
|
|
|
|
#### `byte mouse_rbm`
|
|
|
|
|
2020-05-01 13:18:34 +00:00
|
|
|
`true` if the right mouse button is being pressed, `false` otherwise
|
2020-03-31 17:07:35 +00:00
|
|
|
|
2020-05-01 13:18:34 +00:00
|
|
|
## coord
|
2020-03-31 17:07:35 +00:00
|
|
|
|
|
|
|
#### `alias x_coord`
|
|
|
|
|
|
|
|
The type for representing horizontal screen coordinates.
|
|
|
|
It's `byte` if the screen is 256 pixels wide or less,
|
|
|
|
or `word` if the screen is more that 256 pixels wide.
|
|
|
|
|
2020-05-01 13:18:34 +00:00
|
|
|
#### `alias y_coord`
|
|
|
|
|
|
|
|
The type for representing vertical screen coordinates.
|
|
|
|
It's `byte` if the screen is 256 pixels tall or less,
|
|
|
|
or `word` if the screen is more that 256 pixels tall.
|
|
|
|
|
2020-03-31 17:07:35 +00:00
|
|
|
## null_mouse_default
|
|
|
|
|
|
|
|
This module set the default mouse to null mouse.
|
|
|
|
The null mouse has no button pressed and the cursos is fixed at coordinates (0,0).
|
|
|
|
|
|
|
|
#### `void read_mouse()`
|