Results 1 to 2 of 2

Thread: Mouse Buttons

  1. #1
    xael is offline Member
    Join Date
    Sep 2010
    Posts
    31
    Rep Power
    0

    Default Mouse Buttons

    I'm working with the robot class. I want to push the right mouse button virtually, and for a Robot instance r, I can say:
    Java Code:
    r.mousePress(MouseEvent.BUTTON1);
    There is MouseEvent.BUTTON1, MouseEvent.BUTTON2 and MouseEvent.BUTTON3. Which does each of these actually correlate to on a mouse? 1=left and 2 = right?

    Also, how do I virtually press the application key (between ctrl and alt right side)? Seems to be the one key I can't use.


    Can't find this basic bit of vital info online elsewhere... thanks for helping
    Last edited by xael; 09-07-2010 at 11:29 PM.

  2. #2
    Norm's Avatar
    Norm is offline Moderator
    Join Date
    Jun 2008
    Location
    SW Missouri
    Posts
    17,305
    Rep Power
    25

    Default

    Which does each of these actually correlate to on a mouse? 1=left and 2 = right?
    Write a test program that traps the Robot generated mouse press and displays the contents of the MouseEvent to answer your question.

Similar Threads

  1. Mouse
    By PhQ in forum AWT / Swing
    Replies: 18
    Last Post: 08-18-2010, 04:05 PM
  2. Mouse Listener for mouse floating over object?
    By Krooger in forum AWT / Swing
    Replies: 1
    Last Post: 11-18-2009, 04:34 AM
  3. Mouse events, are they best or only way to go?
    By dbashby in forum New To Java
    Replies: 2
    Last Post: 04-10-2009, 04:34 PM
  4. The mouse and the cheese
    By Don Quixote in forum Java 2D
    Replies: 4
    Last Post: 08-15-2007, 10:55 PM
  5. Mouse over JButton
    By sandor in forum AWT / Swing
    Replies: 1
    Last Post: 05-17-2007, 09:15 PM

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •