Ubuntu – Mouse & Touchpad buttons change function after suspend/hibernate

16.04mousesuspendtouchpad

I have a Lenovo Ideapad Y560 Laptop running Ubuntu 16.04. On startup both the touchpad and a USB mouse work fine.

After suspend, the mouse buttons work differently and erratically. This is true for both the touchpad buttons and the USB mouse buttons. Most notably, the left button doesn't select open windows, closes tabs in Google Chrome, but can still open applications in the Unity Desktop dock on the left side of the screen. The mouse pointer's movement is still fine with both the mouse & the touchpad.

My question: Any idea what's going on, or how to fix it?

Other information:

This laptop has an i8042 controller, which I've read has issues sometimes with Linux.

Here is the output of dmesg | grep i8042

[    1.028910] i8042: PNP: PS/2 Controller [PNP0303:PS2K,PNP0f13:PS2P] at 0x60,0x64 irq 1,12
[    1.062759] i8042: Detected active multiplexing controller, rev 1.1
[    1.076908] serio: i8042 KBD port at 0x60,0x64 irq 1
[    1.076919] serio: i8042 AUX0 port at 0x60,0x64 irq 12
[    1.076989] serio: i8042 AUX1 port at 0x60,0x64 irq 12
[    1.077044] serio: i8042 AUX2 port at 0x60,0x64 irq 12
[    1.077097] serio: i8042 AUX3 port at 0x60,0x64 irq 12
[    1.147924] input: AT Translated Set 2 keyboard as /devices/platform/i8042/serio0/input/input4
[    2.824853] input: SynPS/2 Synaptics TouchPad as /devices/platform/i8042/serio4/input/input10
[    4.455565] input: PS/2 Generic Mouse as /devices/platform/i8042/serio3/input/input16

I've tried some things that haven't worked:

  • From this post, putting an executable shell script in the /etc/pm/sleep.d/ directory that unbinds the controller when suspending and rebinds it on awakening. This didn't seem to do anything.

  • From this post and this post, adding different options to the kernel's boot options to configure i8042. I tried adding i8042.reset i8042.nopnp i8042.direct i8042.dumbkbd i8042.nomux i8042.noloop to the "GRUB_CMDLINE_LINUX_DEFAULT" attribute in the file /etc/default/grub, as well as trying each of them separately. A few of these actually worked but caused another problem: they fixed the mouse buttons after suspend, but disabled the touchpad completely. This isn't ideal, as I don't always have a USB mouse.

Output of xinput list

⎡ Virtual core pointer                      id=2    [master pointer  (3)]
⎜   ↳ Virtual core XTEST pointer                id=4    [slave  pointer  (2)]
⎜   ↳ Logitech USB Optical Mouse                id=11   [slave  pointer  (2)]
⎜   ↳ PS/2 Generic Mouse                        id=15   [slave  pointer  (2)]
⎜   ↳ SynPS/2 Synaptics TouchPad                id=16   [slave  pointer  (2)]
⎣ Virtual core keyboard                     id=3    [master keyboard (2)]
    ↳ Virtual core XTEST keyboard               id=5    [slave  keyboard (3)]
    ↳ Power Button                              id=6    [slave  keyboard (3)]
    ↳ Video Bus                                 id=7    [slave  keyboard (3)]
    ↳ Video Bus                                 id=8    [slave  keyboard (3)]
    ↳ Power Button                              id=9    [slave  keyboard (3)]
    ↳ Sleep Button                              id=10   [slave  keyboard (3)]
    ↳ Lenovo EasyCamera                         id=12   [slave  keyboard (3)]
    ↳ Ideapad extra buttons                     id=13   [slave  keyboard (3)]
    ↳ AT Translated Set 2 keyboard              id=14   [slave  keyboard (3)]

Output of synclient | grep Touchpad

TouchpadOff             = 2

In case if it's helpful:

Using sudo synclient TouchpadOff=0 successfully changes the value of TouchpadOff from 2 to 0. However, after one click of the mouse or touchpad button, it changes back to 2 immediately.

Best Answer

While trying everything again, I seem to have found a combination of kernel instructions that works. I had tried all 6 or 7 together, and each one individually, but not this particular combination of three arguments.

I added just these three:

i8042.noloop i8042.nopnp i8042.reset

to the line

GRUB_CMDLINE_LINUX_DEFAULT=""

in the file: /etc/default/grub

And then ran sudo update-grub to update grub2's configuration file.

I've suspended and re-awoke the computer several times, and it's worked every time so far. If it fails again in the future, I'll edit this question and answer.