This week's book giveaway is in the JavaScript forum.
We're giving away four copies of Cross-Platform Desktop Applications: Using Node, Electron, and NW.js and have Paul Jensen on-line!
See this thread for details.
Win a copy of Cross-Platform Desktop Applications: Using Node, Electron, and NW.js this week in the JavaScript forum!
  • Post Reply Bookmark Topic Watch Topic
  • New Topic

Left and Right click  RSS feed

 
Jay Kamdar
Greenhorn
Posts: 22
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
How can you check if the user pressed the left and right click at the same time? I know how to do left or right click separately.
 
Campbell Ritchie
Sheriff
Posts: 55348
157
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
I am not sure you can. Have a look in the API specifications; I can find multiple clicks there, but not simultaneous. And is it possible to have two simultaneous clicks at all?

Anybody else got any ideas.

CR
 
Alan Moore
Ranch Hand
Posts: 262
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
http://java.sun.com/j2se/1.5.0/docs/api/java/awt/event/InputEvent.html

Check out the getModifiersEx() method. I think the first example shows how to do what you want.
 
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
Boost this thread!