Sometimes left mouse button acting like right, and coursor moving without input

After some recent updates (beginning of last week or so) two problem appeared. I try to find solution or determine if i should rapport it as a bug. I'am by no means Linux expert, so any help with determining what we have here will be appreciated:

System

Lenovo T420
Ubuntu 14.04.1 LTS

Problem

  • Sometimes (I cannot find any pattern) left mouse button starts acting like right is supposed to, and right mouse button don't work at all.
  • Sometimes (again, I cannot find any pattern) cursor is moving slowly without my input mostly to the upper-right corner of the screen, but not always.
  • Both problems appeared when i was using generic USB mouse, but persists even when I am using only touch-pad or Logitech M185 Wireless mouse.

Workaround

Switching to another terminal (ALT+CTRL+FX) and going back to regular session (ALT+CTRL+F7) seems to fix problem for a seemingly random amount of time.


Solution 1:

Solution

Edit: Updated, as I incorrectly assumed that psmouse kernel module provides support for legacy mouses. In fact, this is touchpad support. Currently, i'am testing if update to 14.10 fixes problem with this module to get touchpad to work also ( i didn't noticed that it was not working earlier)

It appears that kernel module psmouse providing touchpad support was interfering with mouse for unidentified reason.

Unload module to restore normal mouse behavior:

gniewomir@gniewomir-ThinkPad-T420:~$ sudo modprobe -r psmouse

Prevent module from loading:

gniewomir@gniewomir-ThinkPad-T420:~$ sudo vim /etc/modprobe.d/blacklist.conf

Add line:

blacklist psmouse

Then:

gniewomir@gniewomir-ThinkPad-T420:~$ sudo update-initramfs -u

Reboot and we are done.

Solution 2:

So. I went forward and collected all the possible fixes known to work, I tested them myself having the same problem (even in December, 2017!!!!) and I can confirm they are effective workarounds:

  • remove these packages if present (i.e. in the case of an Ubuntu distro): inputattach mousetweaks (for example in the ubuntu software center)

  • type CTRL-Q, then type Alt-F1 and with the arrows select the terminal, enter to open it. The problem should be gone

  • if not, type Alt-F2 or go to the CTRL-Alt-F1 console, login as yourself and execute metacity --replace &
  • also remember the touchpad actually still works fine, and using it will possibly fix the problem (until the next time it happens, so this is simply a workaround)

  • also unloading psmouse support, which should actually be the touchpad support is reported to solve the problem altogether (caveat: you would lose the touchpad functionality, but if you're already using a mouse this might actually be a bonus): sudo modprobe -r psmouse