I have had issues with Arduino and Ubuntu for some time, where mouse click events occur even though I don't click. These click events seem to happen mostly when I do small mouse movements e.g. within the region of a single button.
Opening the "Serial Monitor" in the Arduino IDE also causes the problem to occur, closing that window makes it go away again. So I initially thought it was a problem with the Arduino IDE (reported https://github.com/arduino/Arduino/issues/5215), but now I can reproduce it without starting the IDE at all.
This happens every time if I plug in my Arduino device to a USB port on my PC after booting up and logging in. The device in question is a Wemos D1 Mini, which appears to Ubuntu to be a USB serial port /dev/ttyUSB0. My device doesn't actually send anything out the serial port or do anything with it, although I guess that the Arduino runtime environment would probably initialise the port.
I have a nothing-special HP USB keyboard & optical mouse.
frank@computer:~$ lsusb Bus 002 Device 002: ID 8087:0024 Intel Corp. Integrated Rate Matching Hub Bus 002 Device 001: ID 1d6b:0002 Linux Foundation 2.0 root hub Bus 001 Device 003: ID 03f0:0024 Hewlett-Packard KU-0316 Keyboard Bus 001 Device 002: ID 8087:0024 Intel Corp. Integrated Rate Matching Hub Bus 001 Device 001: ID 1d6b:0002 Linux Foundation 2.0 root hub Bus 004 Device 001: ID 1d6b:0003 Linux Foundation 3.0 root hub Bus 003 Device 004: ID 1a86:7523 QinHeng Electronics HL-340 USB-Serial adapter Bus 003 Device 003: ID 0458:0137 KYE Systems Corp. (Mouse Systems) Bus 003 Device 002: ID 05e3:0660 Genesys Logic, Inc. USB 2.0 Hub Bus 003 Device 001: ID 1d6b:0002 Linux Foundation 2.0 root hub
It seems to me that there shouldn't be anything that any device can do that would interfere with the function of the mouse, so I'm now reporting this as a bug in Ubuntu 18.04.
I would love to get to the bottom of this, because the mouse-clicking makes the "Serial Monitor" window in Arduino practically unusable, and consequently makes it very difficult to debug.