(Formerly known as global function IsButtonDown, which is now obsolete)
Mouse.IsButtonDown(MouseButton)
Tests whether the user has the specified mouse button down. BUTTON must either
be eMouseLeft or eMouseRight (the middle button does not work with this function).
Returns 1 if the button is currently pressed, 0 if not. This could be used to
test the length of a mouse click and similar effects.
Example:
int timer=0; // (at top of script file)
if (mouse.IsButtonDown(eMouseRight)) {
if (timer == 40) {
Display("You pressed the right button for 1 sec");
timer = 0;
}
else {
timer++;
}
}
will display the message if the player presses the right button for 1 sec.
See Also: IsKeyPressed
|