This variable returns the last mouse button that was pressed and can return any of the special mouse constants (you may also set this variable to one of the constants too). The constant returned (or being set) will be one of the following:
| Constant | Description |
|---|---|
| mb_left | The left mouse button |
| mb_middle | The middle mouse button (this may not be valid for all target platforms) |
| mb_right | The right mouse button |
| mb_none | No mouse button |
mouse_lastbutton;
Constant
if mouse_lastbutton = mb_left
{
x -= 1;
}
This moves the current instance left if the last button pressed was the left mouse button.