Function NumButtons() Foundation

Determines the number of buttons on the mouse.

Syntax
NumButtons() --> nMouseButtons
Return

NumButtons() returns an integer numeric value indicating the number of buttons on the mouse.

Description

NumButtons() determines the number of buttons on the mouse. If an Xbase++ application is linked in character mode, the mouse must first be turned on with SetMouse(.T.).

Examples
Determine the number of mouse buttons


PROCEDURE Main 
   LOCAL nButtons 

   SetMouse(.T.) 
   nButtons := NumButtons() 

   IF nButtons == 3 
      ? "Mouse has three buttons" 
   ELSEIF nButtons == 2 
      ? "Mouse has two buttons" 
   ELSE 
      ? "Number of buttons cannot be determined" 
   ENDIF 
RETURN 

Feedback

If you see anything in the documentation that is not correct, does not match your experience with the particular feature or requires further clarification, please use this form to report a documentation issue.