Mouse clicks occasionally stop working

I am currently deploying a Java Swing application, and sometimes the end-user encounters an unusual problem whereby they open the application and mouse clicks have no effect. The mouse movement is still tracked fine, as buttons and menus get highlighted as expected when the mouse passes over them. I searched for information about this problem, and learned that a work-around is to click the middle mouse button. This does indeed restore the mouse click behaviour and all continues to work fine after that.
So then I thought I might simulate a middle-button mouse click during my application start-up, in the hope of remedying the problem before any end-user actually sees it. The result is that instead of remedying the problem, I actually cause it to happen every time! The application gets into a state whereby mouse clicks are ignored, and clicking the middle-mouse button restores the mouse click behaviour.
Has anyone else experienced this problem, and know of a way to prevent end-users from experiencing this problem? Here's some example code that demonstrates the behaviour:
import java.awt.Robot;
import java.awt.event.InputEvent;
import javax.swing.JButton;
import javax.swing.JFrame;
public class Main
    public static void main(String[] args)
        JFrame frame = new JFrame();
        frame.getContentPane().add(new JButton("Click Me"));
        frame.pack();
        frame.setLocationRelativeTo(null);
        try
            // Simulate a middle-button mouse click
            Robot robot = new Robot();
            robot.mousePress(InputEvent.BUTTON2_MASK);
        catch (Exception e)
            e.printStackTrace();
        frame.setVisible(true);
}Note I'm using Java 1.6.0_07. Any help with this would be much appreciated,
Paul.

import java.awt.Robot;
import java.awt.event.InputEvent;
import javax.swing.JButton;
import javax.swing.JFrame;
public class Main
    public static void main(String[] args)
        JFrame frame = new JFrame();
        frame.getContentPane().add(new JButton("Click Me"));
        frame.pack();
        frame.setLocationRelativeTo(null);
        try
            // Simulate a middle-button mouse click
            Robot robot = new Robot();
            robot.mousePress(InputEvent.BUTTON2_MASK);
            // Simulate a middle-button mouse click again
            robot.mousePress(InputEvent.BUTTON2_MASK);
        catch (Exception e)
            e.printStackTrace();
        frame.setVisible(true);
}?

Similar Messages

  • Mouse Click Suddenly STOPS working... on all mice

    I had a situation today I've never seen before. I selected an item in a folder in the finder to drag and drop, but I couldn't let go. My mouse would not receive a single click/left click. I thought it might be the mouse so I switched mice to an Apple mouse and it wasn't working either. A RIGHT click worked with both mice, but the system stopped recognizing and registering single clicks. I had to reboot to get back control of my system and mice.
    Apple Mouse was plugged directly into the front of my G5.
    I just updated to 10.5.3 when it came out but I hadn't seen this problem till just now...
    Jeff
    Message was edited by: Jefferis Peterson

    I have a similar problem with 2 Mac Minis running 10.5.3. Prior to the update the mouse behaved fine, but now every so often mouse clicks are not registered. On any window the mouse click causes the window to loose focus, but nothing really happens. The only way to deal with the computer seems to be to try to quit all running applications and suddenly the mouse begins to function as normal. Any suggestions for a fix?

  • My macbook mouse/touchpad has stopped working. After 5 minutes ,the mouse won't click and I have to shut down. What's wrong?

    I have a white macbook, about 4 years old. Every time I use it, after five minutes, the mouse and touchpad stop working. You can still hear the click but it doesn't actually click anything on the screen, effectively freezing the computer. I have to just shut it down. What can i do about this?!? Thanks

    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 this exercise is to determine whether the problem is caused by third-party system modifications that load automatically at startup or login. 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. The instructions provided by Apple are as follows:
    Be sure your Mac is shut down.
    Press the power button.
    Immediately after you hear the startup tone, hold the Shift key. The Shift key should be held as soon as possible after the startup tone, but not before the tone.
    Release the Shift key when you see the gray Apple icon and the progress indicator (looks like a spinning gear).
    Note: If FileVault is enabled under Mac OS X 10.7 or later, you can’t boot in safe mode.
    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 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(s)?
    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.

  • Apple wireless mouse and keyboard stop working ... now says OS X version and bluetooth incompatible

    For no apparent reason my apple wireless mouse and keyboard stopped working. I was not upgrading or installing anything, the batteries are good, nothing was changed as far as I know. Now bluetooth discovers the paired devices, connects for about 30 seconds, the disconnects ... or stays connected but doesn't work.
    What's happenned ... I'm rushing to finish a big job ... any ideas? I've tried re-pairing but doesn't work ... says that OSX version may be incompatible with device bluetooth ... I'm using Lion so maybe there is another lion problem?

    Hello:
    Barry: What do you mean with "making devices favorites"?
    This is the method:
    Go to system preferences>bluetooth.  Highlight an item in the sidebar.  If detailed information does not appear, click on the little gear and select show more info.  Then click on the gear again and select favorite.
    And how could an hardware-related problem be (temporarily) solved rebooting the OS?
    Intermittent problems are, IMHO, most often caused by hardware.  Restarting will occasionally "fix" problems - why, I do not know.
    Barry

  • Left mouse click does not work

    I have a mid-2010 Mac Book Pro 15", 8GB, Samsung 840 500GB SSD, w/ Mountain Lion.
    About four to six months ago I started having issues where the left mouse button would stop working when I left the computer on unattended (but not asleep) for extended periods of time.
    I have both a bluetooth keyboard and magic mouse connected most of the time, but when the issue occurs the button issue extends to both the external mouse and the on-system touch pad.
    The issue started at about the same time that I took my system in to be repaired after the harddisk started failing. The system has since had the OS reloaded (twice) and the replacement harddisk has since been replaced with and SSD, so I if the original service is to blame, it is a peripheral issue (damage, firmware update, etc).
    Here is where it gets really crazy... rebooting does NOT fix the issue. Shutting down and restarting does NOT fix the issue. Hard power off (holding the power until it hard-off's the system) then restarting DOES fix the issue.
    The problem is reproducible, and since I've now demoted this laptop to being my television PC, it gets left on idle all the time (and hense the problem occurs all the time).
    To the best of my knowledge I have all the latest patches and firmware loaded.
    I suspect this is a low level firmware/hardware bug, but have no way to confirm and have had no luck with finding answers here or via the store.
    Any assistance is appreciated!!

    I can left mouse click any other program successfully. I can only left mouse click Firefox one time and then it refuses to work. I set the default mouse structure and pressed apply. It does me no good. There must be another cause for no other program has problems except for Firefox.

  • Mouse clicks don't work

    I have set up a menu with auto action buttons and for some reason mouse clicks don't work. I can click multiple times on a button without anything happening. However, navigating with arrows on the keyboard works fine.
    Is there anyway I can enable my mouse to work.

    Hi,
    Are you testing your DVD in DVDSP simulator? If som try building the disc in your hard drive and test runing the VIDEO_TS folder with DVD player to check if the issue is there too.

  • HELP - mouse click no longer working - Tiger bug?

    Hi Guys,
    I had a weird issue with Tiger (10.4.10) on my PowerBook G4 this evening. I was dragging a file to the trash, and "dropped" it onto the dock by mistake, just missing the trash. I was slightly to the left of the trashcan. I expected the icon to jump back to the desktop, as the place I had dropped it was invalid, but to my surprise, as I moved the pointer across the screen with the mouse button unclicked, a ghost version of the icon was still attached to the mouse pointer.
    I was unable to click on anything, as the OS still believed for some reason that I was dragging this icon around. I used the keyboard to reboot the laptop, and when it came back up, the mouse click was not working - I can drag around, but can't click on anything. This is with the on board trackpad. I also have a bluetooth apple mouse, which exhibits exactly the same behaviour.
    I've rebooted several times (and shutdown and removed the battery), zapped the PRAM. Nothing has helped. I've tried logging in as a different user, but the click still doesn't work with the on-board or external mouse. It's like something within the OS has been corrupted, but I don't know what I can do. I have loads of data on the laptop, so I am not rebuilding. There is something on the help pages about resetting my PowerBook PMU, but I don't think this should be required.
    This is a major, urgent issue for me, as I can't use the laptop until I figure out how to resolve this.
    Anyone - please help
    Thanks,
    Robin

    Thanks for the feedback. Since resetting the PMU fixed the problem, it's not a bug but some conflict in the original setup.
    If you want to report this to Apple, either send Feedback or send bug reports and enhancement requests to Apple via its Bug Reporter system. Join the Apple Developer Connection (ADC)—it's free and available for all Mac users and gets you a look at some development software. Since you already have an Apple username/ID, use that. Once a member, go to Apple BugReporter and file your bug report/enhancement request. The nice thing with this procedure is that you get a response and a follow-up number; thus, starting a dialog with engineering.

  • My HP Pavilion g6 has suddenly gone slow and the mouse has completely stopped working

    My computer has suddenly gone slow and the mouse has completely stopped working. The keyboard works on and off. I ran an HP PC hardware diagnostics UEFI which gave me this result:
    smart check: passed
    Long DST: Failed
    Failure ID: PLQ77T-00074B-MFPWWI-61FF03
    Can anyone please help?

    The hard drive needs to be replaced. Post back for purchase suggestions and installation instructions. 

  • Apple mouse right click function stopped working

    After 4 and a half years my Apple mouse right click function on my iMac stopped working.  However the mouse works perfectly on my other iMac.  The apple store said the problem is in the iMac.  Any ideas how to fix this?
    Thanks, jpm3577

    First log into another user account on your Mac and see if it work correctly there.  If not boot into Safe Mode, Mac OS X: Starting up in Safe Mode, and try there.  Also try another USB port on the Mac if it's a wired mouse.

  • Photoshop CS5 Clone Stamp Tool option-click just stopped working, why?

    I've been using clone stamp tool option-click (healing brush  option-click also) on Photoshop CS5 on my Mac 10.6.5 and it stopped  working suddenly on Monday.  Had just used it on Sunday.  So, I've tried  to isolate the problem.
    1. Went to Apple store and my keyboard and  mouse work fine on their inhouse systems running Photosochop CS5.   Problem still exists on home system.
    2. Adobe photoshop suggested I go back to Mac 10.6.3.  I did and problem still exits.
    3. Reset all presets in CS5.  Problem still exists.
    4.  Spent several hours with Adobe Photoshop tech on phone -- he couldn't  make it work remotely either using his keyboard.  Reloaded Photoshop  from scratch.  Problem still exists.
    Question:
    Could this be a hardware problem?  Graphic board problem? 
    Or is this a software problem aside from Mac OS and CS5?

    Hi Joan
    It sounds like you are not having fun at all : )
    >I talked with a for fee Mac guru today who says I need to wipe slate clean and install operating system from scratch since I did not use time machine.
    .....you ever notice how easy it is for a consultant to tell you what to do when they don't have to do it?
    ..... I wonder why the guru thought your system was gone if your new user account was working?
    If your new user account is working.... why not use it?  The system seems fine but something went screwy with the settings in your original account.
    hopefully someone else will chime in here with more insight before you start from scratch.

  • HP Optical Mouse Product # VK479AA stopped working

    Hi-
    Have the HP Optical Mouse Product #VK479AA and have used it for awhile but it stopped working. Thought it was the battery but changed it. Using it on my laptop which is running Windows XP and connect to it thru the USB port. I tried unplugging the usb and reconnecting it and clicking and holding the connect button on the bottom of the mouse the the one on the top of the usb thing. When i hold down the one on the bottom on the mouse it starts flashing red. Still not working. Also tried re-booting the computer. Any ideas of what i can do to fix it?
    thanks for any responses

    I have the same optical mouse Product code VK479AA, and the same problem......just stopped working. Thought it was the battery, changed battery, still have the same problem. I'm using WIN7, and device manager says the device is working properly. Tried reconnecting the device (using the Connect/binding buttons) but seems like either the mouse is not transmitting, or the USB dongle is not receiving any longer.
    Having read the forum posts, it seems HP aren't very good at customer support. I haven't seen a single official response from HP . Extremely poor considering this is an official forum!! (
    I've also had the double click issue ever since I've had the mouse, which is rather annoying at times especially whether you want to highlight something or select an area in a spreadsheet.
    Given the feedback I've seen so far, I think I'll be reluctant to purchase another HP product.

  • Mouse and keyboard stop working with Mavericks

    This has happened twice now since installing Mavericks.
    I'll be working along, and then all of a sudden, I am not able to click with my mouse and my keyboard stops working. I AM able to move the cursor around on the screen. But, I am not able to click on anything and I can't use the keyboard to force quit the finder. The only way to get unstuck is to press the power button on the front of the Mac to shut it down and then restart.
    I am using a wired Apple Keyboard and a wireless Apple Magic Mouse. My Mac is a MacPro 2 x 2.3 GHz Quad-Core Intel Xeon Mac.
    Like I said. this has never happened before. But it's happened twice since installing Mavericks.

    Everytime I restart my computer, especially for updating maverick, my keyboard and attached mouse (both apple for an Imac) stop working. When I plug in an other keyboard, I can get into my Imac again. Would this SMC apply to this problem as well?
    What should I do?
    thanks, hb

  • Mouse clicks won't work on the browser - any suggestions?

    Following an upgrade of Firefox last year, I can't get the mouse clicks to work on the browser. Doesn't matter whether it's left or right buttons. The radio buttons and links get highlighted when you hover the mouse over the links or the buttons but they won't work when clicked. They work on other browsers (Explorer and Chrome) but no longer on Firefox. I'm using it on a Sony Vaio laptop running Windows 7

    The Reset Firefox feature can fix many issues by restoring Firefox to its factory default state while saving your essential information.
    Note: ''This will cause you to lose any Extensions, Open websites, and some Preferences.''
    To Reset Firefox do the following:
    #Go to Firefox > Help > Troubleshooting Information.
    #Click the "Reset Firefox" button.
    #Firefox will close and reset. After Firefox is done, it will show a window with the information that is imported. Click Finish.
    #Firefox will open with all factory defaults applied.
    Further information can be found in the [[Reset Firefox – easily fix most problems]] article.
    Did this fix your problems? Please report back to us!

  • Middle mouse click no longer works after recent update

    I noticed after updating about 3 days ago that clicking the scroll wheel no longer acts as middle click on my MX Revolution mouse from logitech anymore. Pressing on the scroll wheel use to act as middle mouse click, now it just switches between scroll modes. I would like to have the former functionality returned as I really like to be able to open links in new tabs and paste with just one click.
    Does anyone know how I could get this functionality working again on this mouse? All other button functions work as they did prior to the update that changed my scroll wheel click behavior.
    Thanks for any help with this matter and please let me know if any other information is needed to diagnosis this problem.
    Last edited by daedalusman (2009-07-26 05:06:48)

    djszapi wrote:
    Does this mouse work with other OS/PC ?
    After a simple reboot or pacman -Syu, do you backup to roll back ? Can you mention which packages/files were updated?
    Yes the mouse works in windows, but logitech provides a configuration utility for it and so I use that set it up. In linux there is no such utility to configure the mouse. There use to be btnx and that worked great but it's no longer in the repos or AUR so I don't use that anymore. I haven't done pacman -Sc or pacman -Scc in a while so I should still have the packages to roll back, but I'm not sure what package update caused this. Here is a list of the of packages that were updated just before this started happening, from pacman.log...
    [2009-07-22 11:20] synchronizing package lists
    [2009-07-22 11:20] starting full system upgrade
    [2009-07-22 11:21] starting full system upgrade
    [2009-07-22 11:23] upgraded python (2.6.2-4 -> 2.6.2-5)
    [2009-07-22 11:23] upgraded brltty (4.0-2 -> 4.0-3)
    [2009-07-22 11:23] upgraded cairomm (1.8.0-1 -> 1.8.2-1)
    [2009-07-22 11:23] upgraded device-mapper (1.02.32-2 -> 1.02.33-1)
    [2009-07-22 11:23] upgraded devicekit-power (008-1 -> 009-1)
    [2009-07-22 11:23] upgraded dri2proto (2.0-1 -> 2.1-1)
    [2009-07-22 11:23] upgraded ptlib (2.6.2-1 -> 2.6.4-1)
    [2009-07-22 11:23] upgraded opal (3.6.2-1 -> 3.6.4-1)
    [2009-07-22 11:23] upgraded ekiga (3.2.4-1 -> 3.2.5-1)
    [2009-07-22 11:23] upgraded glibmm (2.20.0-1 -> 2.20.1-1)
    [2009-07-22 11:23] upgraded pango (1.24.4-1 -> 1.24.5-1)
    [2009-07-22 11:23] upgraded gtk2 (2.16.4-2 -> 2.16.5-1)
    [2009-07-22 11:23] upgraded libcanberra (0.12-1 -> 0.14-1)
    [2009-07-22 11:23] upgraded gnome-power-manager (2.26.2-1 -> 2.26.3-1)
    [2009-07-22 11:23] upgraded gstreamer0.10-base-plugins (0.10.23-1 -> 0.10.23-2)
    [2009-07-22 11:23] >>> Updating module dependencies. Please wait ...
    [2009-07-22 11:23] >>> MKINITCPIO SETUP
    [2009-07-22 11:23] >>> ----------------
    [2009-07-22 11:23] >>> If you use LVM2, Encrypted root or software RAID,
    [2009-07-22 11:23] >>> Ensure you enable support in /etc/mkinitcpio.conf .
    [2009-07-22 11:23] >>> More information about mkinitcpio setup can be found here:
    [2009-07-22 11:23] >>> http://wiki.archlinux.org/index.php/Mkinitcpio
    [2009-07-22 11:23]
    [2009-07-22 11:23] >>> Generating initial ramdisk, using mkinitcpio. Please wait...
    [2009-07-22 11:23] ==> Building image "default"
    [2009-07-22 11:23] ==> Running command: /sbin/mkinitcpio -k 2.6.30-ARCH -c /etc/mkinitcpio.conf -g /boot/kernel26.img
    [2009-07-22 11:23] :: Begin build
    [2009-07-22 11:23] :: Parsing hook [base]
    [2009-07-22 11:23] :: Parsing hook [udev]
    [2009-07-22 11:23] :: Parsing hook [autodetect]
    [2009-07-22 11:24] :: Parsing hook [pata]
    [2009-07-22 11:24] :: Parsing hook [scsi]
    [2009-07-22 11:24] :: Parsing hook [sata]
    [2009-07-22 11:24] :: Parsing hook [filesystems]
    [2009-07-22 11:24] :: Generating module dependencies
    [2009-07-22 11:24] :: Generating image '/boot/kernel26.img'...SUCCESS
    [2009-07-22 11:24] ==> SUCCESS
    [2009-07-22 11:24] ==> Building image "fallback"
    [2009-07-22 11:24] ==> Running command: /sbin/mkinitcpio -k 2.6.30-ARCH -c /etc/mkinitcpio.conf -g /boot/kernel26-fallback.img -S autodetect
    [2009-07-22 11:24] :: Begin build
    [2009-07-22 11:24] :: Parsing hook [base]
    [2009-07-22 11:24] :: Parsing hook [udev]
    [2009-07-22 11:24] :: Parsing hook [pata]
    [2009-07-22 11:24] :: Parsing hook [scsi]
    [2009-07-22 11:24] :: Parsing hook [sata]
    [2009-07-22 11:24] :: Parsing hook [filesystems]
    [2009-07-22 11:24] :: Generating module dependencies
    [2009-07-22 11:24] :: Generating image '/boot/kernel26-fallback.img'...SUCCESS
    [2009-07-22 11:24] ==> SUCCESS
    [2009-07-22 11:24] upgraded kernel26 (2.6.30.1-1 -> 2.6.30.2-1)
    [2009-07-22 11:24] upgraded lib32-libdrm (2.4.11-2 -> 2.4.12-1)
    [2009-07-22 11:24] upgraded libdrm (2.4.11-2 -> 2.4.12-1)
    [2009-07-22 11:24] upgraded libpng (1.2.37-1 -> 1.2.38-1)
    [2009-07-22 11:24] upgraded libtracker (0.6.6-1 -> 0.6.95-1)
    [2009-07-22 11:24] upgraded lvm2 (2.02.47-2 -> 2.02.48-1)
    [2009-07-22 11:24] upgraded mesa (7.4.4-1 -> 7.5-1)
    [2009-07-22 11:24] upgraded nautilus-cd-burner (2.24.0-1 -> 2.24.0-2)
    [2009-07-22 11:24] upgraded perl (5.10.0-5 -> 5.10.0-6)
    [2009-07-22 11:24] upgraded pycairo (1.8.4-1 -> 1.8.6-1)
    [2009-07-22 11:24] upgraded xorg-server (1.6.1.901-3 -> 1.6.2-1)
    [2009-07-22 23:38] adding new group: ntp
    [2009-07-22 23:38] adding new user: ntp
    [2009-07-22 23:38] installed openntpd (3.9p1-7)
    Hope this helps in figuring out this problem, thanks for your help.

  • My Bluetooth Mighty Mouse has totally stopped working

    I have a bluetooth Mighty Mouse that seems to have stopped working. I was using it on a trip over in Guam. Then I came back to the states and it was in my suitcase/unused for several weeks with the batteries in it. Now that we have moved into an apartment, I would like to start using it again. But when I turn it on by sliding the little slider switch on the bottom, the little green light doesn't blink any more and it doesn't seem to be recognized by my computer. I have tried it with recharged batteries and other batteries, but no luck. Does anyone have a suggestion for me? I would really like to get this thing working without having to buy a new mouse. I have noticed that there is a little white tab just above where the batteries go. When the back cover is on, it appears that the slider switch somehow pushes on this little white tab. But with the cover off, this little white tab has some play in it (up and down) and can rattle around. Could there be something under this tab that is stuck down? Any advice would be appreciate! Thanks!

    Hello ba:
    No light=no power to the device.
    If you happen to be near an Apple store, take the mouse in and have them try it on one of their systems. I do not think there would be any charge for that.
    Barry

Maybe you are looking for