• Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

java

 
nerella kiran
Greenhorn
Posts: 1
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
how to recognize between the right and left click of the mouse button???
if any one knows the answer please mail back immediately cc to pmiriyala@yahoo.com
 
Warren Bell
Ranch Hand
Posts: 56
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Check out the method isPopupTrigger() in MouseEvent or getModifiers() and BUTTON3_MASK or BUTTON2_MASK in InputEvent.
First Example:
if(e.isPopupTrigger())
// Code to display a pop-up menu or what ever you want to do.
// This is more platform independent.
Second Example:
if((e.getModifiers() & e.BUTTON3_MASK) != 0)
// Code to display a pop-up menu or what ever you want to do.
// This is more platform dependant.
Hope this helps

------------------
Warren Bell
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic