Mouse Buttons and Modifiers

Why is there so much confusion about mouse buttons and modifiers?
Looking over past postings there seems to be differing opinions about
how the mouse buttons work with modifiers in mouse events.
My specific question is how to use ALT as a modifier.
Using InputEvent.BUTTON*_MASK, *=1,2,3, you can determine which button
is pressed, and this works fine as well with SHIFT and CNTRL modifiers.
However, when ALT is held down both buttons 1 and 3 also set the
BUTTON2_MASK. I suppose that this is a mechanism designed to support
three button functions with two button mice. Holding down ALT lets you
produce a middle button signal. Great - if you want it!
Is it possible to disable this functionality so that ALT and the three
buttons can be used independently with no ambiguity?

There is the MouseEvent.isAltDown() that returns a boolean value, so do:
public void MousePressed(MouseEvent me)
  boolean mClick=(!me.isAltDown && ((me.getModifiers() & me.BUTTON2_MASK)!=0)))   //middle mouse button
  boolean altClick=(me.isAltDown && !((me.getModifiers() & me.BUTTON2_MASK)!=0)))  //alt left or right click
}Note: this code is untested, but it should work because I've done Alt-click and isAltDown worked for left and right click.

Similar Messages

  • Mouse buttons and keyboard randomly stop responding on secondary display

    Hey,
    I'm facing this weird problem after a recent upgrade to Snow Leopard:
    In about half of the cases I'm switching to application windows on a secondary/external display the mouse buttons and Macbook keyboard are unresponsive. I have to keep clicking/pressing for some time or have to switch between applications to get them working, until they'll fail again after some time.
    I tested it with two different external displays with VGA and DVI adapter, different screen resolutions, I tested the mouse and mouse software, both keyboard and mouse work fine with the same applications moved to the primary laptop screen, trackpad works fine too.
    This occurred after the upgrade to Snow Leopard on a 2008 unibody Macbook. Updates to 10.6.2 didn't solve the problem.
    I'd be happy if anyone could help me with this issue.
    Thanks

    You do not provide the full model number but if it is an AMD processor you are seeing the start of video issues that plague that series. The freeze is caused by bad video memory which is a part of the video card in turn part of the motherboard. I have been getting a high percentage of people who do not respond back to posts so I am not going to write everything about your issue; it could be a book. I am happy to help further if you have any questions. There are some repair options but at the end of the day, you might want to consider a new laptop.

  • How can I disable right/left mouse buttons and scroll wheel in PDF?

    Hi all,
    I want the user to have to click on "forward" and "back" buttons that I've created in the PDF, in order to move around in it. Is there any way to disable the mouse buttons and scroll wheel from allowing users to go back and forth?
    Also, a separate question: I want the user to click on embedded images and receive either a pop-up comment, or be re-directed to another page in the PDF. Is there any way to set this up?
    Thanks for your time!

    You can achieve what you want in Question 1, just not via scripting.  You would need to create a plug-in in C/C++ that would be installed on the client machine.  Other than that option, try67 is correct - there is no way to achieve this from the document-level.

  • Lenovo Thinkpad Compact USB Keyboard with Trackpoint: Middle mouse button and scrolling

    I got this keyboard (KU-1255).
    Unfortunately, it generates bogus mouse button events if I click the middle mouse button and use the trackpoint:
    With "thinkpad scrolling mode" disabled, the middle mouse button is released as soon as I move the trackpoint while still pressing the button!
    Expected behaviour: The middle mouse button is pressed, the event created. Moving the trackpoint moves the cursor normally. Releasing the middle button creates a corresponding event.
    With "thinkpad scrolling mode" enabled, the button is registered as pressed, then scrolling occurs as I move the trackpoint and the button is released if I release it.
    Expected behaviour: No middle mouse button event is registered if I move the trackpoint. Pressing and releasing the middle mouse button is only registered if I click the button without moving the trackpoint.
    When will there be a firmware update available for the keyboard, like for the SK-8855?
    Since I am also using Linux, I would be really interested in fixing this in the firmware, not only getting a new Windows driver.

    Help please.

  • Why does my magic mouse button and scroll surface not work?

    My MacBook Air 13" ran out of power before I could connect it to a power source. After I was able to power it on again, the Magic Mouse button and scrolling surface could no longer work even though I could still use the optical pointer below to move the cursor. How can I restore the button and scrolling surface. Have tried powering down and up both the MacBook Air as well as the mouse. Also tried unpairing and re-pairing both but nothing works so far. Thanks.

    Have you tried to edit your settings in Apple menu -> System preferences -> Keyboard and Mouse?

  • 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

  • Iphoto ver 8.1.2 unable to open iphoto. can hold down mouse button and 1 page of iphoto will open. click anywhere on screen and iphoto closes

    Cannot open iPhoto. It's on the toolbar, but will not open. I can hold the mouse over the icon and hold the mouse button down and iPhoto will open to a thumbnail photo, but if I click anywhere on the page, iPhoto closes. iPhoto shows open on top of page, but practically all selectable items are gray.

    It sounds like the window might have slipped down below the Dock or similar. Try change your screen resolution and (SystemPreferneces -> Displays) and that should force it back into reach. The return the resolution to whatever it was.

  • I used to open, bbc radio 2, with a left click on the 'listen' tab? this now longer responds, I have to now right click the mouse button and open link in a new tab? whats wrong

    I used to be able to open BBc Radio 2 via the 'Listen' link with a left click of the mouse button, this nolonger works, I now have to right click the link and 'open link in a new tab'
    I must have disabled something?
    If you can help then please make it easy for me to understand.
    Thanks
    Regards
    Rj

    2 Solutions found in [http://support.mozilla.com/en-US/questions/791244]
    the user cor-el has a method that does not require any add-ons. He States
    This code in userChrome.css will move "Open Link in New Window" to the top of the context menu.
    <pre>@namespace url("<a href="http://www.mozilla.org/keymaster/gatekeeper/there.is.only.xul">http://www.mozilla.org/keymaster/gatekeeper/there.is.only.xul</a>"); /* only needed once */
    #contentAreaContextMenu &gt; * { -moz-box-ordinal-group: 2; }
    #context-openlink { -moz-box-ordinal-group: 1 !important; }</pre>
    the user jay_ff shows how to do it using the Menu Editor Add-on
    1. Install the Menu Editor add-on from https://addons.mozilla.org/en-US/firefox/addon/menu-editor/ .
    2. After the installation, go to Firefox> add-ons (or simply use Ctrl+Shift+A)
    3. Go to the Menu Editor "Options"
    4. In the "Main context menu," simply grab the "Open link in New Tab" and place it below the "Open Link in New Window"
    5. and Voila! You may also change other menu options if you want to!
    I tried jay_ff method first and found that indeed changing the Main Context Menu did cause the hotlink context menu to change as well.

  • 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]]

  • IMac 21.5 inch mid 2011 white screen when I wake it,  holding down mouse button and sweeping the screen restores the desktop.  Any one else had this and what was the solution?

    When the Mac is awaken from sleep mode the screen is white.  I can hold the mouse button down and sweep the screen and the desktop reappears and everything works as normal..This just started and I am concerned that some hardware, video card or video memory is failing.  Has anyone else had this problem and what was the solution?

    Please read this whole message before doing anything.
    This procedure is a diagnostic test. It’s unlikely to solve your problem. Don’t be disappointed when you find that nothing has changed after you complete it.
    The purpose of the test is to determine whether the problem is caused by third-party software that loads automatically at startup or login, or by a peripheral device. 
    Disconnect all wired peripherals except those needed for the test, and remove all aftermarket expansion cards. Boot in safe mode and log in to the account with the problem.  Note: If FileVault is enabled, or if a firmware password is set, or if the boot volume is a software RAID, you can’t do this. Post for further instructions.
    Safe mode is much slower to boot and run than normal, and some things won’t work at all, including wireless networking on certain Macs. The next normal boot may also be somewhat slow.
    The login screen appears even if you usually log in automatically. You must know your login password in order to log in. If you’ve forgotten the password, you will need to reset it before you begin. Test while in safe mode. Same problem? After testing, reboot as usual (i.e., not in safe mode) and verify that you still have the problem. Post the results of the test.

  • VNC issues: secondary mouse button and pixel depth.

    Hi,
    Recently I've started to manage a Windows PC running an UltraVNC server 1.0.2 with ARD 3.1. The VNC viewer in ARD 3.1 is very good and stable ( thanks for the reconnection mechanism wich is not present in other viewers ).
    But I don't know how to adjust pixel depth for slow connections ( image quality control doesn't work ) and also I don't know how to send a right mouse button click to the remote PC.
    Any idea ? Is it possible at all ?
    Regards,
    Joan

    Gee, thanks for the helpful answer, sig.
    I eventually found an uninstaller app in the Utilities folder that I was able to get to via the keyboard.  Turns out it's the Apple preference pane that isn't taking into account the Microsoft Mouse one.  I don't know if that's because MS didn't hook it properly or what, but just in case anyone else runs into the same problem.

  • Track ball mouse buttons and Logitech driver not fully working on Core Duo

    I have a Ligitech cordless optical TrackMan ball bluetooth ball mouse which works for me. Unfortunately, I could not map the buttons properly (the back button kept doing an F9 function rather than 'back' in Safari). The driver in System Preferences produced a warning message something like 'this won't work on a core duo imac'. Logitech did not seem to have any updates. I hunted around some alternative software and just wanted to recommend www.usboverdrive.com to anyone who has the same problem. All buttons can be easily mapped - you press the button to identify which one it is and then can change what it does.
    2GHz iMacCD 20" 2Gb RAM   Mac OS X (10.4.6)  

    Funny, not on their site!
    But! You can get it here:
    http://www.macupdate.com/info.php/id/8154
    Again, I don't have a trackball, but give this a shot. It is the "Control Center" software, and from their site the trackball is the save version (1.62) as the mouse/keyboard.
    Good luck!
    Steve
    20" iMac Intel 2gb RAM; Mac Mini; 14" iBook G4; iPod 3G 20gb (3rd gen)   Mac OS X (10.4.6)  

  • ALV  List Layout add new button  and modify Append Row Button Text and Logi

    Hi All,
    I am working on Employee custom development Application in Webdynpro ABAP>
    In my ALV list Layout  I have to add new  two Buttons  Top or Bottom of the ALV List.
    If I am adding I have to add logic for those Buttons. How to add and add logic for those buttons.
    as well as I have to Change the  Text  for  Existing Button ''Append Row''    to  "ADD NEW ROWS"
    and I have to add logic in this button while Append New Row I have to generate ID no for New Rows .
    Kindly help/advice  me to proceed further.
    Thanks in advance.
    Dav

    Hi Dav,
    To Add buttons please refer this thred,
    ALV with user-defined buttons on toolbar in wd abap
    To change or rename text in ALV standard buttons, please refer this ...
    How can i change the text of an standard button in ALV?
    and also see this article on self defined functions...
    http://www.sdn.sap.com/irj/scn/go/portal/prtroot/docs/library/uuid/101df93f-4b5c-2910-14aa-9eb0338c2110?quicklink=index&overridelayout=true
    Thanks,
    Kris.
    Edited by: kissnas on Feb 22, 2011 5:59 AM

  • Right mouse button and Windows Vista - 17'' MBP is ignored?

    I am curious why Apple released a trackpad driver update, which enables right button in Windows (BootCamp), but for all models EXCEPT my 17'' Mac Book Pro?
    http://support.apple.com/kb/TS2477
    Since it is 2008 year update, it seems no more updates will be released. Why Apple ignores the users of 17'' MBP unibody?

    for starters, the 17" unibody came out AFTER the update, so it should already have the software update.
    second, right click has to be turned on via the Boot Camp utility in Vista.
    & third, you should be posting in the unibody forum.

  • Ibm x60s and Win 7 - third mouse button plus nipple will not scroll in FF4

    I have an IBM x60s notebook with Win 7. On previous versions of Firefox I believe I could scroll down a web page successfully using the laptop's centre mouse button and the red nipple mouse.
    This seemed to have stopped working in Firefox 4 (main release) which I downloaded yesterday. The IBM mouse's scrolling action is enabled and works on other programs, so I suspect a possible bug.
    Your comments are appreciated :)

    Some of you might not be satisfied by the OSX zoom behavior, but rather would like Ctrl+"mousewheel up/down" to increase/decrease content size per app. Like in Windows.
    To be clear let's differ between the two features: OSX's whole screen (OS UI aswell) zoom and increase/decrease content size.
    Solution:
    This is the solution I came up with, which allows you to use Ctrl+"mousewheel up/down" to trigger the latter feature, the content zoom.
    1) Make sure you aren't using Ctrl as a zoom key modifier in Settings -> Accessibility -> Zoom (I use Cmd instead)
    2) Download and install BetterTouchTools (BTT) it's free and updated regularly. http://www.boastr.net
    3) Open BTT Preferences, switch to advanced mode and chose "Magic Mouse"
    Q: "But I don't have a magic mouse" A: "Doesn't matter, Normal Mice pane won't recognize mouse wheel scroll, so follow this guide".
    4) Press "Add new gesture", select Magic Mouse Gesture "Scroll Down (modifier key needed)"
    5) Set Custom Keyboard Shortcut to "Cmd + +" (don't be confused here, press Cmd and the button on your keyboard with a "+" (plus) sign)
    6) Do the same with "Scroll Up (modifier key needed)", this time of course add Custom Keyboard Shortcut to "Cmd + -"
    You might have to do this per specific app to counter some unforeseen consequences using applications that already try to counter this (like MS programs, virtual machines and the like.)

Maybe you are looking for

  • Sccm client v4 wont install and install client v5 - SCCM 2012 R2

    Hi, I am coming to the end of a SCCM 2012 R2 client deployment. I have come across 2 machines (so far)that have the SCCM 2007 (v4) client installed, and although the task is set to uninstall from the server the v5 client will not installed. iI have b

  • How do I get iphoto to work on my MacBook?

    For sometime now iphoto has been opening and then crashing.  It just will not work.  After reading though some posts of others having this problem I decided to see if it was a app issue.  I deleted and resinstalled from my ilife '11 disk.  I tried th

  • Archiving with iDive/FootTrack or Frameline 47/CatDV- Whats recommended?

    Does anybody here got experience archiving / referencing video footage with the above mentioned programs for key wording/ data basing? I cannot find any reviews that compare these programs. I've got many hours of video that I would like to database w

  • JMS-Provider max.Length of a xml-message

    Hallo, I want to send a message in a queue of the jms-provider, but I get the message, that the message is longer than the max length. Where or how can I configure the max. length of the xml-message in SAP XI? Thanks. Regards Stefan

  • No way of voice recording?

    After some web research I found that the iPod Mini doesn't support voice recording the normal way (by simply plugging in a 3rd party voice recorder). Isn't there any other way of making the Mini suitable for voice recording? Thanks in advance! iPod M