45

On Xubuntu, for a long time I've had an issue where my Left mouse button stops working for some reason. It happens pretty much everyday. Everything else seems to work.

The only way I can get my mouse to work again is to logout and login, which requires me to shutdown all my programs.

Obviously this is very annoying, I've had this issue for almost a year and I've assumed that an update would fix it but it still happens.

Is anyone else aware of this issue and possible fixes?

I'm using Xubuntu as my Desktop Environment. I'm currently on Ubuntu 16.04 LTS.

Edit:

It happened again and I used xev and evtest to see what events are recognised. xev did not respond to Left button clicks but evtest did respond to Left button clicks.

Edit (2018/01/22): Just an update. I still have the problem, but I have a short term fix. When the left mouse button stops working, I use Ctrl+Alt+T to bring up the terminal. I enter xinput in the terminal, which brings up a list of devices. I search for which device is probably the mouse (it has name like generic mouse) and I find the associated ID number. I then enter the command: xinput disable ID where ID is the ID number of the mouse. This fixes the problem until I shutdown the computer.

Also, for more information about the problem, the same mouse works for my Windows 10 installation, so I think the mouse is fine. The same problem also occurs in Kali Linux, except that Kali linux doesn't have xinput installed so I can't use my quick fix.

user668074
  • 551
  • 1
  • 4
  • 4
  • 1
    Use `evtest` as root and `xev` to find out at which level the mouse clicks disappear. Also, look into `dmesg` for possible errors. – dirkt Jun 04 '17 at 08:41
  • Ok. Next time it happens I will have a look using these commands. – user668074 Jun 04 '17 at 09:10
  • @dirkt, I ran xev and evtest. I modified he main question with the results. – user668074 Jun 04 '17 at 12:57
  • 1
    (It would have been nice to provide the actual output, just in case something weird happened. We can only debug based on information you give, so the more information you give, the better). That means something in X goes wrong. Look into `/var/log/Xorg.log` to see if there are any messages when the mouse stops working. Also run `xinput -list` and then `xinput -test 123`, where `123` is the id of your mouse. You focused the `xev` window? You can see keypresses in `xev`? Do you run any programs that could swallow up left button clicks? – dirkt Jun 04 '17 at 13:43
  • @dirkt, I'm not sure what output from `xev` or `evtest` since it just tells me that buttons have been pushed. Next time it happens I'll check the log files. I typically run Firefox, a password manager, Emacs, and a terminal window. – user668074 Jun 04 '17 at 14:41
  • 1
    I have had this problem too. It just happened, and I discovered that disabling my touchpad in the mouse preferences made the left button start working again. Also, interestingly, changing to a left-handed mouse swapped which button worked and which did not. I am not sure, but I think I might have also had this problem on this laptop when booting into Windows. – Kevin Jan 18 '18 at 15:48
  • @Kevin, Thanks for more feedback on the problem. It's 6 months later and I still have no long term fix for the problem. If you have a similar setup to me, a quick fix I found is to open a terminal (learn the keyboard shortcut!) and type `xinput`. From the list of devices provided, identify which is probably the mouse, for me it is something like "generic mouse". Then type `xinput disable 123` where 123 is the ID of the mouse device. This seems to fix the issue until I shutdown again. – user668074 Jan 22 '18 at 01:53
  • This can't be happening by accident. Somebody programmed this. Why would there be any need to change the code that allows the mouse to click? – Paul McCarthy Oct 24 '22 at 23:05

8 Answers8

63

I have a Dell Inspiron 15 7559. The left click stops working once in a while when I was using Ubuntu 16.04. After I installed Ubuntu 18.04, the left click stops working almost every time after I resume from suspend.

The best solution I found is switching to another virtual console (TTY) by Alt + Ctrl + F1. The mouse works normally after switching back with Alt + Ctrl + F7.

Jeff Schaller
  • 66,199
  • 35
  • 114
  • 250
HD189733b
  • 731
  • 5
  • 4
  • where you able to find a permanent solution? – Waqleh Oct 21 '18 at 09:57
  • 1
    @Waqleh Unfortunately, no. This workaround is not very annoying. I'm lazy to spend more time to find a better solution. – HD189733b Nov 03 '18 at 20:55
  • 2
    This worked for me as well. I just switched to another visual console using "Ctrl + Alt + F2" and then without doing anything switched back to first console using "Ctrl + Alt + F1". Both right and left mouse clicks were not working properly and after doing this, both work fine. Thanks a ton HD189733b. – 300 Dec 11 '18 at 23:06
  • 15
    This worked for me as well. I tested by clicking the upvote button – Ben Kushigian Jul 03 '19 at 17:02
  • Alas this solution did not work for me :( – ComputerScientist Aug 23 '19 at 21:35
  • Superb! Works great – Abhi Mar 03 '20 at 11:27
  • Switching to another virtual console and back again worked for me on 20.04 LTS. I'm on Pop!_OS on an Oryx Pro 6 - same exact issue - system stops responding to the left mouse button after suspend. (I thought the value of this comment would be to showcase that the problem still exists on 20.04, and the workaround here still works). – Garland Dec 27 '21 at 14:35
  • For whatever reason, this started happening to me on Fedora 37, GNOME 43.2. Switching the TTY helped! – Person Feb 07 '23 at 15:22
  • I forgot this and found the answer to fix it for a second time. My mouse sorta stopped working after switching inputs on an external monitor away from the laptop to a second machine. The left click seemed to be going to the wrong window. I could fix it partially with alt tab, but Ctrl+alt+f1/f7 magically resets it. Ubuntu 22.04 – poleguy May 13 '23 at 06:12
16

Try this: sudo modprobe -r psmouse sudo modprobe psmouse proto=imps

Raven Kong
  • 171
  • 1
  • 3
  • 4
    He, welcome on the Unix SE! I suggest to give more details in your answers, giving only some commands to copy-paste is not very good. – peterh Jun 02 '18 at 17:58
  • 2
    This is the correct answer on how to recover from the problem (you probably need to look through Xorg.0.log to diagnose why it is happening). The first command, which can also be written as 'sudo modprobe --remove psmouse' removes the mouse driver from the kernel, and then the second command reinstates it. It's the equivalent of turning it off and then back on again. – Klaatu von Schlacker Feb 17 '19 at 18:33
  • 2
    the first command alone seams to resolve the issue – Waqleh Aug 02 '19 at 08:09
  • 1
    To me it worked only after I executed both commands *twice* (Xfce, Ubuntu 19.10). – rsenna Apr 22 '20 at 19:05
6

I just had this (mouse can move but clicks do nothing) happen.

I realized that in the background a program window had been too slow to close and Gnome had shown a popup asking "Force close" or "Wait".

In my case, the procedure below liberated my mouse:

  1. Go to that popup using ALT-TAB
  2. Select an option using TAB
  3. Press Enter
Nicolas Raoul
  • 7,945
  • 14
  • 43
  • 55
  • 1
    Mine was not a slow program, but `vscode` asking for confirmation before closing a document. – Alireza May 01 '19 at 10:37
  • Mine was not a slow program, but intellij supposidely displaying a hidden dialog box. Pressing escape to close the hidden modal dialog box solved the issue. Within OS settings -> devices -> mouse & touchpad, the mouse was clicking fine in the test tool – Guillaume Berche Nov 13 '19 at 12:42
  • 1
    Nicely done, thank you. In my case, the SweetHome3D program was causing the problem. I Alt-Tabbed to it and closed with Alt+F4, and voila! – antgel Mar 04 '20 at 07:50
2

I had the same issue in Ubuntu 17.10. I could move the cursor but none of the mouse buttons worked. I tried various solutions like auto update drivers, the metacity and compiz, but it didn't work. One solution which was mentioned was to remove nvidia drivers (My PC has 550Ti). After uninstalling that, my mouse is working fine.

Iloovatar
  • 21
  • 2
2

I just had this happen and none of the above solutions were related. It turned out to be related to a VM in VirtualBox that grabbed part of my mouse. Shutting down the VM fixed the issue.

I've had VirtualBox grab my mouse many times before, but somehow this was different and grabbed the whole mouse including movement. This time I could move my mouse around outside the VM, use Super+arrows to change desktops in the house, but the mouse buttons or wheel didn't work. Unplugging/replugging it didn't work, removing the psmouse driver didn't work and xinput disable/enable didn't work. What I found really weird is that xev didn't even register any mouse click events. Also clicking inside the problem VM didn't work either.

deltaray
  • 1,301
  • 2
  • 11
  • 19
  • I had the same problem with QEMU. Got stuck halfway through an update and never released the left mouse button for some reason. `sudo systemctl libvirt-guests` solved my problem. – BakaKuna Jul 16 '19 at 12:41
2

This worked for me. Chrisp info -> My touchpad might have been malfunctioning. Disabling the touchpad solved the problem. The following code removes touchpad from kernel module.

sudo modprobe -r psmouse
0

With me, my problem was I had two bluetooth mice, in different rooms. For some reason the logitech pebble was stopping the left click event from other mice, including the one on the laptop itself? A bit weird but easy to fix

$ bluetoothctl devices
Device 8C:91:09:55:1A:CA Lenovo 700 BT Speaker
Device FB:8C:C9:8A:3C:6D Logitech Pebble
Device C9:E0:E3:E9:44:E7 MX Ergo

then I could solve it by running

bluetoothctl disconnect C9:E0:E3:E9:44:E7
Evan Carroll
  • 28,578
  • 45
  • 164
  • 290
0

One situation where this happens regularly for me is that VirtualBox 6.1.x mouse integration suddenly stops delivering mouse input to the VM. The guest OS mouse driver is still loaded and functional, and turning mouse integration off (Input -> Mouse Integration) and using the normal mouse operation (where the VM window captures the mouse and you must release it by pressing the host key, Right Ctrl by default in Windows, to get mouse control on the host back again) works fine.

rakslice
  • 1,147
  • 2
  • 11
  • 17