Since upgrading to 12.04, I've randomly experienced this strange phenomenon where my mouse mostly doesn't work and keyboard mostly does. I have not been able to identify a cause for this. Sometimes it will happen minutes after I start-up, other times after the computer has been idle for a while, and other times in the middle of working on something. It lasts until I reboot the computer or restart Gnome.

The mouse won't be able to interact with any open windows, but if I do ALT+Tab, I can't keyboard nav through those, I can only click to change windows that way. Same if I press the Windows key; the keyboard remains focused in whatever window was just active but I can click things with my mouse to open new programs.

Anyone else experienced this? What might be causing it? Is there a fix?

  • 1
    I have seen such behaviour with wireless mice with low battery... try another mouse? – vonbrand Apr 11 '13 at 19:48
  • I have a wired mouse and am plugged in. :-/ – elemjay19 Apr 11 '13 at 21:49
  • 2
    Get a different mouse and try it. I think your mouse might be having an issue. Another thing to try is to change the USB port being used, this has sometimes worked. – mdpc Apr 11 '13 at 21:53
  • I'll give that a try, but I believe I have experienced this with the mouse plugged into several different USB ports. – elemjay19 Apr 11 '13 at 21:56
  • 1
    Check dmesg and /var/log/messages after the freeze happens. If you see anything interesting, update your question with that information, or paste the whole thing in a pastebin – drs Apr 21 '13 at 13:03

I have seen such behaviour with wireless mice with low battery... try another mouse?

Failing USB mice can also behave erratically, in my experience.


To help debug, you can try reading the raw mouse events from /dev/input/mice. This python script, from johnroach.info, can help interpret the raw data. I've modified it slightly below:


mouse = file('/dev/input/mice')  
while True:  
    status, dx, dy = tuple(ord(c) for c in mouse.read(3))  

    def to_signed(n):  
        return n - ((0x80 & n) << 1)  

    dx = to_signed(dx)  
    dy = to_signed(dy)  
    print "%#02x %d %d" % (status, dx, dy)

The next time your computer "freezes", run this script as root. It will print out x and y values for the change in the mouse position as input on your USB port. If these values correspond to what the pointer does on the screen, then it is likely you have a problem with your USB ports, motherboard, or a driver. If these values correspond to what the physical mouse is doing, then the problem is somewhere in the software.


Try to get a terminal by pressing Alt, Ctrl, F2 buttons together (F3 to F6 should also work). After logging in, check /var/log/messages, /var/log/dmesg etc as USB errors are logged there. It will help to find out the reason.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.