Identify left and right mouse button clicks?

I am wondering how is it possible to identify left mouse button click and right mouse button click using Java rather than just identify a mouse click.
Kumar

I'm not sure if this is what you mean, but you can use MouseEvent's getButton() function.
For example
class MyListener implements MouseListener
    public void mousePressed(MouseEvent e)
        int btn = e.getButton();
        //btn = 1 (left button), btn=2 (right button) for 2 button mouse and so on...
}

Similar Messages

  • I am using the firefox on my laptop, I had my photoshop on and my setting for pressing left and right mouse button is "autoscroll", and everytime I left-right click a link, it automatically jump to my photoshop app

    vaio laptop, vista

    Two things that were not mentioned that might lead to
    *Are you syncing active tabs on two devices?
    *Is Auto-Sync selected on the mobile device in the Account Settings?

  • Jbuttons and right mouse button question

    I want to make a jbutton respond to the right mouse button as well as the left. It seems that the action listener cannot do this (maybe it can which is why im posting here!).
    So I used a mouse listener, but, that isn't working out as well as I'd like it too. I happen to have to click the button twice with my right mouse button before it'll respond to events. So is there a way to make a jbutton respond properly to a right mouse button click?
    thanks!

    I want to make a jbutton respond to the right mouse
    button as well as the left. It seems that the action
    listener cannot do this (maybe it can which is why im
    posting here!).No, it can't. And it shouldn't, as it's in 99.9% of all cases I know horribly bad GUI design.
    But there are MouseListenres, you know.
    So I used a mouse listener, but, that isn't working
    out as well as I'd like it too. I happen to have to
    click the button twice with my right mouse button
    before it'll respond to events. So is there a way to
    make a jbutton respond properly to a right mouse
    button click?Look at the MouseEvent you get. It counts the clicks.

  • Left and Right Side buttons

    I just got a replacement 8330 because I dropped my previous one in a muddy puddle. I cannot remember how I originally re-programmed the left and right side buttons to run different applications than the default (camera, and voice dial). Can someone help me out?
    Solved!
    Go to Solution.

    Options > Screen/Keyboard > Left and Right Convenience keys.
    1. If any post helps you please click the below the post(s) that helped you.
    2. Please resolve your thread by marking the post "Solution?" which solved it for you!
    3. Install free BlackBerry Protect today for backups of contacts and data.
    4. Guide to Unlocking your BlackBerry & Unlock Codes
    Join our BBM Channels (Beta)
    BlackBerry Support Forums Channel
    PIN: C0001B7B4   Display/Scan Bar Code
    Knowledge Base Updates
    PIN: C0005A9AA   Display/Scan Bar Code

  • Left and right mouse coding for games

    Hi
    Can anyone point me in the right direction on where to find actionscript 2/3 coding for left and right mouse clicks for gaming. I am a student and want to design a game that will use both left and right mouse clicks on a object that will give different results depending on which mouse click you had made.
    For example on a red object you click right, on a blue object you click left. Depending on how you clicked on a object will determine the next step in the code.
    Does this make sense?
    Cheers
    Beth

    I believe there is no method provided for isolating right clicks with a mouse in Flash.  The right click is reserved for pulling up a menu and there are no properties associated with it in the code.

  • Distinguish left and right mouse click

    I am making some demo, I don't use any narration. How do I
    tell the viewer when to use left mouse click and when to use right
    mouse click? Can it be done automatically?

    Hello Simon,
    Hmmm, I don't think that there is anything in Captivate that
    will automatically let the leaner know that you are
    right-clicking...Here are some of the things that I might try.
    1. Adding a text caption that notifies the learner that I am
    right-clicking
    2. At the very start of the demonstration point out to
    learners that when they hear a certain sound this is an indication
    that I am right-clicking.
    3. Create a small animation that shows pressing the right
    mouse button
    4. Use one of the existing animations that you can find in
    the Adobe Captivate 2 gallery such as visual clicks and again point
    out at the beginning of the demo that when they see this animation
    you are performing a right-click action, you could also record or
    import audio onto your animation if you so desired.
    Those are my (of the top of my head) thoughts . I am sure
    that there are others.
    Regards,
    Mark

  • Where are the left and right action buttons on the touchpad on the HP ENVY 17t Quad TouchSmart

    My new HP ENVY 17t Quad TouchSmart laptop has a touchpad, but no left or right action buttons.  How do I simulate their action.  Apparently a single tap simulates a left click, but how do I get a right click?  How do I drag a cell in a spreadsheet (to copy it) using the touchpad?  I may have to end up using a mouse.
    This question was solved.
    View Solution.

    I believe that model features a ClickPad, which doesn't have distinct left/right-click buttons but does have left/right-click areas where the buttons would normally be. See Using and Configuring the ClickPad for more info.
    Please click the thumbs up button to say "Thanks!"
    Clicking "Accept as Solution" on a reply that solves your problem makes it easier for other people to find solutions.
    I am an HP employee.

  • Flash Island: right mouse button click will trigger a refresh of Flash

    Dear all,
    I'm trying the example IslandsWDATutorial1 (bar chart) http://wiki.sdn.sap.com/wiki/display/EmTech/IslandsWDATutorial1
    I found when I click right mouse button (or  context menu button on keyboard) in web dynpro area, the flash (bar chart) will refresh.
    I debugged but can't find the reason. Does anyone know how to prevent this refresh?
    Thanks for your help
    Donny

    Currently the XML for the Island is not delta handled. It is resent to the FlashIsland on any event. Although the Flash Player isn't recreated on these events, the data is rebound to the UI controls  - causing linked animations to replay. 
    This was recently discussed on the forum and I created a prototype implementation of a possible delta handler mechanism for the Islands XML.  It creates a stable Island when there are no changes that impact the context(s) bound to the Island. This has been turned over to development and they will consider it for the next development sprint. Likely this functionality won't make its way into the product until the next enhancement package, however.

  • No backgroun and right mouse button xfce4

    Hello.
    Everything worked great so I decided to try Xgl. I put Shadowhand repo in my pacman.conf than I ran
    pacman -Syu
    and than
    pacman -S xgl-cvs compiz-cvs mesa-cvs cairo-cvs
    first I lost my right mouse button menu and than background. I recovered bacground by running
    xfdesktop in terminal. How do I get my right mouse button working? This is when I run startxfce4 as root. When I try as other user everything work like before. Thanks for help.
    Andrey

    it sounds like one of the dot files that xfce4 stores it's config files in is corrupt. besides that, you shoulden't run as root anyway

  • Xfce4 no background and right mouse button menu

    Hello.
    Everything worked great so I decided to try Xgl. I put Shadowhand repo in my pacman.conf than I ran
    pacman -Syu
    and than
    pacman -S xgl-cvs compiz-cvs mesa-cvs cairo-cvs
    first I lost my right mouse button menu and than background. I recovered bacground by running
    xfdesktop in terminal. How do I get my right mouse button working? This is when I run startxfce4 as root. When I try as other user everything work like before.
    I tried to remove xfce4 and install again. I tried to remove .config directory from root folder and replace with one from users on the system(startxfce4 as user everything is there). Still the same black background and no menu on right mouse button.
    Thanks for help.
    Andrey

    Thanks. Worked for me also. What a great distro it is. This is like coming back to basics but everything works + great community.
    Andrey

  • Right mouse button click in a JTree leaf

    Hi,
    how can I add a mouse listener in a JTree leaf? I have DOM nodes wrapped and a JTree model adapter to set up the JTree. I want the popup menu to show everytime the user clicks on a leaf, but not on the tree itself.
    Thanks!

    Really you just have to add your listener to the tree itself, then use the Point to find the corresponding TreePath (getPathForLocation), from which you'll easily find the node.

  • Is it possible to create a context menu, which is launched by right mouse button click event?

    The question is following: when you are pushing right button in the window of a working vi you see the build-in context menu of labview. Is it possible to customize it, or create the new one?
    www.xinstruments.com
    Custom Software for Industrial Automation
    www.hdrconverter.com
    Picture processing made easy

    There's no nuilt-in LabVIEW function or tool to do it, but Dave Ritter published an artical in the LabVIEW Technical Resource last year that described how to do this. It uses the Event Structure so you need to have at least LabVIEW 6.1.
    You can read a bit of the artical here. There's also a link on the bottom of the page where you can purchase that issue to get the entire artical and sample code.
    Ed
    Ed Dickens - Certified LabVIEW Architect - DISTek Integration, Inc. - NI Certified Alliance Partner
    Using the Abort button to stop your VI is like using a tree to stop your car. It works, but there may be consequences.

  • The right mouse button on my 8740w has failed (clicks but no result, i.e Cut/Copy/Paste/Delete menu

    My right mouse button clicks but no result, i.e Cut/Copy/Paste/Delete menu does not appear.
    I think the hardware has failed.
    Note the mousepd is not the issue.  The right button is the problem
    Left button works fine

    Same deal with me except the right button has failed twice. You may find that if you push on it past the click with a bit more force it will respond. They swapped the hardware and same thing occurred.
    HP should be ashamed that they would put such awful mouse hardware on its flagship product. Whoever designed it should be fired.
    If HP had any customer loyalty they would offer a hardware update and offer it to those who are still under warranty.
    Suffice to say I will never, ever purchase an HP workstation again.
    Good luck.

  • I can't remove Yandex Elements from the Open menu list with right mouse button and Tools menu although I removed Yandex. I think it slows down Firefox.

    I downloaded Freeyoutube downloader from internet and somehow got yandex installed in my computer with toolbars on firefox.Despite I removed Yandex from my computer Yandex elements still stays in open menu when right mouse button clicked and in the Tools menu. I tried to uninstall Firefox, remove yandex registry from windows registry and restart computer, and then reinstall firefox, Yandex elements still hangs there. Firefox is now running very slow compared to the running before Yandex.

    hello, please try all these steps:
    # [[Reset Firefox – easily fix most problems|reset firefox]] (this will keep your bookmarks and passwords)
    # afterwards go to the firefox menu [[Image:New Fx Menu]] > addons > extensions and in case there are still extensions listed there, disable them.
    # finally run a full scan of your system with different security tools like the [http://www.malwarebytes.org/products/malwarebytes_free free version of malwarebytes] and [http://www.bleepingcomputer.com/download/adwcleaner/ adwcleaner] to make sure that adware isn't present in other places of your system as well.
    [[Troubleshoot Firefox issues caused by malware]]

  • Right mouse button and middle mouse button

    Hi,
    How can i add a right mouse button and middle mouse button
    click in captivate, is there a way out of this.

    Hi prem1280
    There is a Developer Center article that may help here.
    Click
    here to read it.
    Additionally, if you are planning on publishing to .EXE
    format, fellow Adobe Community Expert Paul Dewhurst has something
    at
    This
    Link that you may be interested in.
    Cheers... Rick

Maybe you are looking for