spacer graphic
spacer graphic
Montage of games AGS Logo
spacer graphic

 

spacer graphic
Menu
spacer graphic Home
About
News
Features
Download AGS
spacer graphic Games 
Games main page
Award Winners
Picks of the month
Short games
Medium length games
Full length games
In Production
Hints & Tips
Community
Forums
AGSers World Map
Member websites
Chat
Resources
Tutorials
FAQ
Knowledge Base
Downloads
Links
AGS-related links
* AGS Manual
  * Scripting
    * Mouse functions and properties

IsButtonDown

(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


User comments and notes
There are currently no user comments on this page.
The user comment facility is currently disabled.