Mouse cursor jumping on the screen and clicking

Hi there,

I have a problem with mouse cursor which is jumping on the screen and clicking. This is happening sometime to time and I can not find the pattern. I suspected that this maybe related to the touchscreen. When I disable touchscreen, the cursor is doing right click. I tried to disable mouse and touch pad but it was still doing right click. Any help how I can debug it? Thanks :slight_smile:

dmidecode -t system

# dmidecode 3.2
Getting SMBIOS data from sysfs.
SMBIOS 3.0.0 present.

Handle 0x0001, DMI type 1, 27 bytes
System Information
	Manufacturer: ASUSTeK COMPUTER INC.
	Product Name: UX370UAR
	Version: 1.0       
	Serial Number: xxxxxxxxxxxxxxxxx
	UUID: xxxxxxxxxxxxxxxxxxxxxx
	Wake-up Type: Power Switch
	SKU Number:  
	Family: ZenBook Flip

Handle 0x0007, DMI type 32, 20 bytes
System Boot Information
	Status: No errors detected

Handle 0x0025, DMI type 12, 5 bytes
System Configuration Options
	Option 1: SMI:00B26C
	Option 2: DSN:                                
	Option 3: DSN:                                
	Option 4: DSN:                                

lshw -short

WARNING: you should run this program as super-user.
H/W path     Device           Class          Description
========================================================
                              system         Computer
/0                            bus            Motherboard
/0/0                          memory         15GiB System memory
/0/1                          processor      Intel(R) Core(TM) i5-8250U CPU @ 1.60GHz
/0/100                        bridge         Xeon E3-1200 v6/7th Gen Core Processor Host Bridge/DRAM Registers
/0/100/2                      display        UHD Graphics 620
/0/100/4                      generic        Xeon E3-1200 v5/E3-1500 v5/6th Gen Core Processor Thermal Subsystem
/0/100/13                     generic        Sunrise Point-LP Integrated Sensor Hub
/0/100/14                     bus            Sunrise Point-LP USB 3.0 xHCI Controller
/0/100/14.2                   generic        Sunrise Point-LP Thermal subsystem
/0/100/15                     generic        Sunrise Point-LP Serial IO I2C Controller #0
/0/100/15.1                   generic        Sunrise Point-LP Serial IO I2C Controller #1
/0/100/16                     communication  Sunrise Point-LP CSME HECI #1
/0/100/17                     storage        Sunrise Point-LP SATA Controller [AHCI mode]
/0/100/1c                     bridge         Sunrise Point-LP PCI Express Root Port #6
/0/100/1c/0  wlp1s0           network        Wireless 8260
/0/100/1e                     generic        Sunrise Point-LP Serial IO UART Controller #0
/0/100/1e.2                   generic        Sunrise Point-LP Serial IO SPI Controller #0
/0/100/1f                     bridge         Sunrise Point LPC Controller/eSPI Controller
/0/100/1f.2                   memory         Memory controller
/0/100/1f.3                   multimedia     Sunrise Point-LP HD Audio
/0/100/1f.4                   bus            Sunrise Point-LP SMBus
/0/2                          system         PnP device PNP0c02
/0/3                          system         PnP device PNP0b00
/0/4                          generic        PnP device INT3f0d
/0/5                          generic        PnP device ATK3001
/0/6                          system         PnP device PNP0c02
/0/7                          system         PnP device PNP0c02
/0/8                          system         PnP device PNP0c02
/0/9                          system         PnP device PNP0c02
/1           scsi3            storage        
/2           enx00e04cc9c494  network        Ethernet interface
WARNING: output may be incomplete or inaccurate, you should run this program as super-user.

lspci

00:00.0 Host bridge: Intel Corporation Xeon E3-1200 v6/7th Gen Core Processor Host Bridge/DRAM Registers (rev 08)
00:02.0 VGA compatible controller: Intel Corporation UHD Graphics 620 (rev 07)
00:04.0 Signal processing controller: Intel Corporation Xeon E3-1200 v5/E3-1500 v5/6th Gen Core Processor Thermal Subsystem (rev 08)
00:13.0 Non-VGA unclassified device: Intel Corporation Sunrise Point-LP Integrated Sensor Hub (rev 21)
00:14.0 USB controller: Intel Corporation Sunrise Point-LP USB 3.0 xHCI Controller (rev 21)
00:14.2 Signal processing controller: Intel Corporation Sunrise Point-LP Thermal subsystem (rev 21)
00:15.0 Signal processing controller: Intel Corporation Sunrise Point-LP Serial IO I2C Controller #0 (rev 21)
00:15.1 Signal processing controller: Intel Corporation Sunrise Point-LP Serial IO I2C Controller #1 (rev 21)
00:16.0 Communication controller: Intel Corporation Sunrise Point-LP CSME HECI #1 (rev 21)
00:17.0 SATA controller: Intel Corporation Sunrise Point-LP SATA Controller [AHCI mode] (rev 21)
00:1c.0 PCI bridge: Intel Corporation Sunrise Point-LP PCI Express Root Port #6 (rev f1)
00:1e.0 Signal processing controller: Intel Corporation Sunrise Point-LP Serial IO UART Controller #0 (rev 21)
00:1e.2 Signal processing controller: Intel Corporation Sunrise Point-LP Serial IO SPI Controller #0 (rev 21)
00:1f.0 ISA bridge: Intel Corporation Sunrise Point LPC Controller/eSPI Controller (rev 21)
00:1f.2 Memory controller: Intel Corporation Sunrise Point-LP PMC (rev 21)
00:1f.3 Audio device: Intel Corporation Sunrise Point-LP HD Audio (rev 21)
00:1f.4 SMBus: Intel Corporation Sunrise Point-LP SMBus (rev 21)
01:00.0 Network controller: Intel Corporation Wireless 8260 (rev 3a)

If it's happening when you use your touchpad, this might help:

/usr/share/X11/xorg.conf.d/70-synaptics.conf

Option FingerLow 30
Option FingerHigh 30
2 Likes

If nothing else works, maybe it's the line of sight to your dongle, if you are using the 2.4Ghz USB adapter. I had that problem. Moved things closer and it solved it.

3 Likes

This is not the case because it's happening even without wireless mouse connected.

I also don't think that this an issue with touchpad.

I tried to reinstall xserver-xorg-input-libinput didn't help.
I tried to replace xserver-xorg-input-libinput with xserver-xorg-input-synaptics but then only working input device is wireless mouse.

To make it stop I need to restart PC or sometimes pressing touchscreen chaotically is helping :sweat_smile:

I tried to disable only touchscreen in: /usr/share/X11/xorg.conf.d/40-libinput.conf
but problem still occurs. Only behavior is bit different. The right mouse click is happening in different period of time.

The video demonstrate the problem when it's occurs. On the video it started to happening. After that I disabled touchpad and mouse. Then I turn mouse on and off again.

Can you please post the terminal output of:

xinput list-props 11

1 Like

This is an output when problem doesn't occur.

Device 'Logitech Wireless Keyboard PID:4023':
Device Enabled (187): 1
Coordinate Transformation Matrix (189): 1.000000, 0.000000, 0.000000, 0.000000, 1.000000, 0.000000, 0.000000, 0.000000, 1.000000
libinput Natural Scrolling Enabled (324): 0
libinput Natural Scrolling Enabled Default (325): 0
libinput Send Events Modes Available (309): 1, 0
libinput Send Events Mode Enabled (310): 0, 0
libinput Send Events Mode Enabled Default (311): 0, 0
Device Node (312): "/dev/input/event13"
Device Product ID (313): 1133, 16419
libinput Drag Lock Buttons (326):
libinput Horizontal Scroll Enabled (327): 1

Everything there looks good. This is most likely (No guarantee) not a driver issue then. I think touchpad is not my first suspect.
Ok, I saw in the video you are using another mouse. Looked wireless.
What is the hardware there?
Have you cleaned the USB port for the Wireless dongle?

Have you tested a different wireless mouse or a Wired Mouse? Tried a different USB port?

lsusb

1 Like

lsusb

Bus 002 Device 003: ID 058f:8468 Alcor Micro Corp.
Bus 002 Device 004: ID 0bda:8153 Realtek Semiconductor Corp. RTL8153 Gigabit Ethernet Adapter
Bus 002 Device 002: ID 2109:0817 VIA Labs, Inc. USB3.0 Hub
Bus 002 Device 001: ID 1d6b:0003 Linux Foundation 3.0 root hub
Bus 001 Device 004: ID 8087:0a2b Intel Corp.
Bus 001 Device 003: ID 13d3:5755 IMC Networks USB2.0 VGA UVC WebCam
Bus 001 Device 007: ID 2109:8888 VIA Labs, Inc. USB2.0 VGA UVC WebCam
Bus 001 Device 008: ID 0d8c:0014 C-Media Electronics, Inc. Audio Adapter (Unitek Y-247A)
Bus 001 Device 006: ID 05e3:0608 Genesys Logic, Inc. Hub
Bus 001 Device 005: ID 046d:c534 Logitech, Inc. Unifying Receiver
Bus 001 Device 002: ID 2109:2817 VIA Labs, Inc. USB2.0 Hub
Bus 001 Device 001: ID 1d6b:0002 Linux Foundation 2.0 root hub

I tried with different mouses but same behavior. On the video I did NOT remove the dongle from USB port (only turn off mouse by the switch on the mouse).

I noticed something. I have external screen connected into my laptop. When problem occur, I closed a laptop lid and it stopped. The external screen switched into main screen. When I open the laptop lid, the problem is back.

1 Like

We are getting somewhere thanks to your observation.
What is the output of:

sudo lshw -C video

EDIT: I asked the above because your observation narrows this to Two Likely Culprits:
GDM (Your display manager) or your Graphics Drivers.
I lean toward the Graphics Drivers as being the more likely of the two.
It is near 2am here my time, so I need to log out for the night but hopefully this may help point this thread in a direction heading toward a solution.

1 Like

Thanks a lot for your time and help :slight_smile:

This is the output

*-display
description: VGA compatible controller
product: UHD Graphics 620
vendor: Intel Corporation
physical id: 2
bus info: pci@0000:00:02.0
version: 07
width: 64 bits
clock: 33MHz
capabilities: pciexpress msi pm vga_controller bus_master cap_list rom
configuration: driver=i915 latency=0
resources: irq:126 memory:ee000000-eeffffff memory:d0000000-dfffffff ioport:f000(size=64) memory:c0000-dffff

Have you tried to switching between the USB ports? It may be a defunction USB port.

I tried. This is happening even when wireless mouse is not connected at all.

Doing a search, it appears that you are not alone in intel UHD graphics having this issue when a second monitor is detected.
Interestingly, on result gave this:

In my case this worked : I removed the back of the laptop and took out the battery which sits exactly below the touchpad. Then I put a piece of 15x7cm aluminum foil on the battery and covered it with masking tape to avoid any shortcuts.
After that I placed the battery back and closed and tightened the cover and voila: problem solved!

Source:

I believe that they meant "shorts". I would not use foil; rather, I would clean the battery terminal carefully to remove any corrosion. Probably replace the battery.

That said; this expands, rather than narrows our search. This may be due to a Graphics driver glitch, as we covered above - but now it adds a new possibility: Power Supply.

1 Like

Ah, a Faraday cage for the battery... may be that the battery charging control circuitry was oscillating at a frequency that interfered with the graphics, or specifically the cursor.

If the battery is removable, try removing it and running the machine... if the problem doesn't recur, then that's the problem.

1 Like

hmm.. This problem did occur also when second screen was not connected. Also, it's started about a month ago. Before that everything was fine.

Unfortunately, the battery is not easy removable. I have to disassembly my laptop to do it. I will disassembly my laptop tomorrow and see if I can spot something.

In my case I have 4 input devices: keyboard, touchscreen, touchpad and wireless mouse. When problem occurs, the cursor is moving and clicking. SO my thinking is: to debug this, I need to find out which input device is sending events. From somewhere the information to move/click cursor must came from. I will try to run:

xinput test-xi2 --root

when the problem occurs again.

Please, correct me if my logic is wrong.

1 Like

Your logic is not wrong. It may be that the input device is sending events.
Debugging the events would be a way of eliminating or confirming that possibility.

1 Like

I'm getting somewhere :sweat_smile:

I managed to run the command from my previous post and save logs.

sudo timeout -v --preserve-status 10 xinput test-xi2 --root > event2.log

I looks like device id=15 is sending events.

When I disable this device:

  • moving cursor with touchpad is not working but both buttons are working
  • moving cursor with touchscreen doesn't work but double tap on screen is working (right mouse click).

I was trying to disable this device before but then the problem symptoms changed (explained in my first post). Now, I understand that if changed because buttons are not disabled.

I will try to capture events again with device 15 disabled.

⎑ Virtual core pointer                    	id=2	[master pointer  (3)]
⎜   ↳ Virtual core XTEST pointer              	id=4	[slave  pointer  (2)]
⎜   ↳ Logitech Wireless Keyboard PID:4023     	id=11	[slave  pointer  (2)]
⎜   ↳ Logitech Wireless Mouse                 	id=12	[slave  pointer  (2)]
⎜   ↳ ELAN24CC:00 04F3:24CC                   	id=15	[slave  pointer  (2)]
⎜   ↳ ELAN1200:00 04F3:3058 Mouse             	id=17	[slave  pointer  (2)]
⎜   ↳ ELAN1200:00 04F3:3058 Touchpad          	id=18	[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)]
    ↳ Asus Wireless Radio Control             	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)]
    ↳ C-Media Electronics Inc. USB Audio Device	id=13	[slave  keyboard (3)]
    ↳ USB2.0 VGA UVC WebCam: USB2.0 V         	id=14	[slave  keyboard (3)]
    ↳ ELAN24CC:00 04F3:24CC Stylus            	id=16	[slave  keyboard (3)]
    ↳ gpio-keys                               	id=19	[slave  keyboard (3)]
    ↳ Asus WMI hotkeys                        	id=20	[slave  keyboard (3)]
    ↳ AT Translated Set 2 keyboard            	id=21	[slave  keyboard (3)]
    ↳ Logitech Wireless Keyboard PID:4023     	id=22	[slave  keyboard (3)]
EVENT type 24 (RawTouchEnd)
    device: 2 (15)
    detail: 3086
    valuators:
          0: 37492.49 (0.00)
          1: 45095.79 (0.00)

EVENT type 24 (RawTouchEnd)
    device: 2 (15)
    detail: 3064
    valuators:
          0: 37492.49 (0.00)
          1: 52859.40 (0.00)

EVENT type 22 (RawTouchBegin)
    device: 2 (15)
    detail: 3087
    valuators:
          0: 37492.49 (38794.26)
          1: 45125.03 (17910.40)

EVENT type 18 (TouchBegin)
    device: 15 (15)
    detail: 3087
    flags:
    root: 1464.55/1735.15
    event: 1464.55/1735.15
    buttons:
    modifiers: locked 0x10 latched 0 base 0 effective: 0x10
    group: locked 0 latched 0 base 0 effective: 0
    valuators:
        0: 37492.49
        1: 45125.03
    windows: root 0x7b6 event 0x7b6 child 0x200004e
EVENT type 22 (RawTouchBegin)
    device: 2 (15)
    detail: 3088
    valuators:
          0: 37492.49 (38794.26)
          1: 63664.12 (61168.27)

EVENT type 18 (TouchBegin)
    device: 15 (15)
    detail: 3088
    flags:
    root: 1464.55/2448.02
    event: 1464.55/2448.02
    buttons:
    modifiers: locked 0x10 latched 0 base 0 effective: 0x10
    group: locked 0 latched 0 base 0 effective: 0
    valuators:
        0: 37492.49
        1: 63664.12
    windows: root 0x7b6 event 0x7b6 child 0x600010
EVENT type 22 (RawTouchBegin)
    device: 2 (15)
    detail: 3089
    valuators:
          0: 37492.49 (38794.26)
          1: 56324.51 (44042.52)

EVENT type 18 (TouchBegin)
    device: 15 (15)
    detail: 3089
    flags:
    root: 1464.55/2165.80
    event: 1464.55/2165.80
    buttons:
    modifiers: locked 0x10 latched 0 base 0 effective: 0x10
    group: locked 0 latched 0 base 0 effective: 0
    valuators:
        0: 37492.49
        1: 56324.51
    windows: root 0x7b6 event 0x7b6 child 0x6034f5
EVENT type 24 (RawTouchEnd)
    device: 2 (15)
    detail: 3065
    valuators:
          0: 37492.49 (0.00)
          1: 42961.16 (0.00)

EVENT type 23 (RawTouchUpdate)
    device: 2 (15)
    detail: 3088
    valuators:
          0: 37492.49 (38794.26)
          1: 63707.98 (61270.62)

EVENT type 19 (TouchUpdate)
    device: 15 (15)
    detail: 3088
    flags:
    root: 1464.55/2449.71
    event: 1464.55/2449.71
    buttons:
    modifiers: locked 0x10 latched 0 base 0 effective: 0x10
    group: locked 0 latched 0 base 0 effective: 0
    valuators:
        0: 37492.49
        1: 63707.98
    windows: root 0x7b6 event 0x7b6 child 0x600010
EVENT type 24 (RawTouchEnd)
    device: 2 (15)
    detail: 3089
    valuators:
          0: 37492.49 (0.00)
          1: 56324.51 (0.00)

EVENT type 20 (TouchEnd)
    device: 15 (15)
    detail: 3089
    flags:
    root: 1464.55/2165.80
    event: 1464.55/2165.80
    buttons:
    modifiers: locked 0x10 latched 0 base 0 effective: 0x10
    group: locked 0 latched 0 base 0 effective: 0
    valuators:
        0: 37492.49
        1: 56324.51
    windows: root 0x7b6 event 0x7b6 child 0x6034f5
EVENT type 22 (RawTouchBegin)
    device: 2 (15)
    detail: 3090
    valuators:
          0: 37492.49 (38794.26)
          1: 60710.73 (54277.04)

EVENT type 18 (TouchBegin)
    device: 15 (15)
    detail: 3090
    flags:
    root: 1464.55/2334.46
    event: 1464.55/2334.46
    buttons:
    modifiers: locked 0x10 latched 0 base 0 effective: 0x10
    group: locked 0 latched 0 base 0 effective: 0
    valuators:
        0: 37492.49
        1: 60710.73
    windows: root 0x7b6 event 0x7b6 child 0x600010
EVENT type 23 (RawTouchUpdate)
    device: 2 (15)
    detail: 3088
    valuators:
          0: 37492.49 (38794.26)
          1: 63781.09 (61441.19)

EVENT type 19 (TouchUpdate)
    device: 15 (15)
    detail: 3088
    flags:
    root: 1464.55/2452.52
    event: 1464.55/2452.52
    buttons:
    modifiers: locked 0x10 latched 0 base 0 effective: 0x10
    group: locked 0 latched 0 base 0 effective: 0
    valuators:
        0: 37492.49
        1: 63781.09
    windows: root 0x7b6 event 0x7b6 child 0x600010
EVENT type 22 (RawTouchBegin)
    device: 2 (15)
    detail: 3091
    valuators:
          0: 37492.49 (38794.26)
          1: 56412.24 (44247.21)

EVENT type 18 (TouchBegin)
    device: 15 (15)
    detail: 3091
    flags:
    root: 1464.55/2169.17
    event: 1464.55/2169.17
    buttons:
    modifiers: locked 0x10 latched 0 base 0 effective: 0x10
    group: locked 0 latched 0 base 0 effective: 0
    valuators:
        0: 37492.49
        1: 56412.24
    windows: root 0x7b6 event 0x7b6 child 0x6034f5
EVENT type 24 (RawTouchEnd)
    device: 2 (15)
    detail: 3088
    valuators:
          0: 37492.49 (0.00)
          1: 63781.09 (0.00)

EVENT type 20 (TouchEnd)
    device: 15 (15)
    detail: 3088
    flags:
    root: 1464.55/2452.52
    event: 1464.55/2452.52
    buttons:
    modifiers: locked 0x10 latched 0 base 0 effective: 0x10
    group: locked 0 latched 0 base 0 effective: 0
    valuators:
        0: 37492.49
        1: 63781.09
    windows: root 0x7b6 event 0x7b6 child 0x600010
EVENT type 22 (RawTouchBegin)
    device: 2 (15)
    detail: 3092
    valuators:
          0: 37492.49 (38794.26)
          1: 47961.45 (24528.72)

EVENT type 18 (TouchBegin)
    device: 15 (15)
    detail: 3092
    flags:
    root: 1464.55/1844.22
    event: 1464.55/1844.22
    buttons:
    modifiers: locked 0x10 latched 0 base 0 effective: 0x10
    group: locked 0 latched 0 base 0 effective: 0
    valuators:
        0: 37492.49
        1: 47961.45
    windows: root 0x7b6 event 0x7b6 child 0x200004e
EVENT type 22 (RawTouchBegin)
    device: 2 (15)
    detail: 3093
    valuators:
          0: 37492.49 (38794.26)
          1: 52859.40 (35957.26)

EVENT type 18 (TouchBegin)
    device: 15 (15)
    detail: 3093
    flags:
    root: 1464.55/2032.56
    event: 1464.55/2032.56
    buttons:
    modifiers: locked 0x10 latched 0 base 0 effective: 0x10
    group: locked 0 latched 0 base 0 effective: 0
    valuators:
        0: 37492.49
        1: 52859.40
    windows: root 0x7b6 event 0x7b6 child 0x200006f
EVENT type 24 (RawTouchEnd)
    device: 2 (15)
    detail: 3092
    valuators:
          0: 37492.49 (0.00)
          1: 47961.45 (0.00)

EVENT type 20 (TouchEnd)
    device: 15 (15)
    detail: 3092
    flags:
    root: 1464.55/1844.22
    event: 1464.55/1844.22
    buttons:
    modifiers: locked 0x10 latched 0 base 0 effective: 0x10
    group: locked 0 latched 0 base 0 effective: 0
    valuators:
        0: 37492.49
        1: 47961.45
    windows: root 0x7b6 event 0x7b6 child 0x200004e
EVENT type 22 (RawTouchBegin)
    device: 2 (15)
    detail: 3094
    valuators:
          0: 37492.49 (38794.26)
          1: 50783.25 (31112.92)

EVENT type 18 (TouchBegin)
    device: 15 (15)
    detail: 3094
    flags:
    root: 1464.55/1952.73
    event: 1464.55/1952.73
    buttons:
    modifiers: locked 0x10 latched 0 base 0 effective: 0x10
    group: locked 0 latched 0 base 0 effective: 0
    valuators:
        0: 37492.49
        1: 50783.25
    windows: root 0x7b6 event 0x7b6 child 0x200006f
EVENT type 14 (RawKeyRelease)
    device: 3 (21)
    detail: 36
    valuators:

EVENT type 3 (KeyRelease)
    device: 21 (21)
    detail: 36
    flags: 
    root: 1768.00/1147.00
    event: 1768.00/1147.00
    buttons:
    modifiers: locked 0x10 latched 0 base 0 effective: 0x10
    group: locked 0 latched 0 base 0 effective: 0
    valuators:
    windows: root 0x7b6 event 0x7b6 child 0x2c0000a
EVENT type 24 (RawTouchEnd)
    device: 2 (15)
    detail: 3094
    valuators:
          0: 37492.49 (0.00)
          1: 50783.25 (0.00)

EVENT type 20 (TouchEnd)
    device: 15 (15)
    detail: 3094
    flags:
    root: 1464.55/1952.73
    event: 1464.55/1952.73
    buttons:
    modifiers: locked 0x10 latched 0 base 0 effective: 0x10
    group: locked 0 latched 0 base 0 effective: 0
    valuators:
        0: 37492.49
        1: 50783.25
    windows: root 0x7b6 event 0x7b6 child 0x200006f
EVENT type 22 (RawTouchBegin)
    device: 2 (15)
    detail: 3095
    valuators:
          0: 37492.49 (38794.26)
          1: 50768.63 (31078.81)

EVENT type 18 (TouchBegin)
    device: 15 (15)
    detail: 3095
    flags:
    root: 1464.55/1952.16
    event: 1464.55/1952.16
    buttons:
    modifiers: locked 0x10 latched 0 base 0 effective: 0x10
    group: locked 0 latched 0 base 0 effective: 0
    valuators:
        0: 37492.49
        1: 50768.63
    windows: root 0x7b6 event 0x7b6 child 0x200006f
EVENT type 22 (RawTouchBegin)
    device: 2 (15)
    detail: 3096
    valuators:
          0: 37492.49 (38794.26)
          1: 47976.07 (24562.83)

EVENT type 18 (TouchBegin)
    device: 15 (15)
    detail: 3096
    flags:
    root: 1464.55/1844.78
    event: 1464.55/1844.78
    buttons:
    modifiers: locked 0x10 latched 0 base 0 effective: 0x10
    group: locked 0 latched 0 base 0 effective: 0
    valuators:
        0: 37492.49
        1: 47976.07
    windows: root 0x7b6 event 0x7b6 child 0x200004e
EVENT type 22 (RawTouchBegin)
    device: 2 (15)
    detail: 3097
    valuators:
          0: 37492.49 (38794.26)
          1: 63488.67 (60758.89)

EVENT type 18 (TouchBegin)
    device: 15 (15)
    detail: 3097
    flags:
    root: 1464.55/2441.28
    event: 1464.55/2441.28
    buttons:
    modifiers: locked 0x10 latched 0 base 0 effective: 0x10
    group: locked 0 latched 0 base 0 effective: 0
    valuators:
        0: 37492.49
        1: 63488.67
    windows: root 0x7b6 event 0x7b6 child 0x600010
EVENT type 22 (RawTouchBegin)
    device: 2 (15)
    detail: 3098
    valuators:
          0: 37492.49 (38794.26)
          1: 58005.90 (47965.75)

When problem occurs with device 15 disabled the following events are recorded:

⎑ Virtual core pointer                    	id=2	[master pointer  (3)]
⎜   ↳ Virtual core XTEST pointer              	id=4	[slave  pointer  (2)]
⎜   ↳ Logitech Wireless Keyboard PID:4023     	id=11	[slave  pointer  (2)]
⎜   ↳ Logitech Wireless Mouse                 	id=12	[slave  pointer  (2)]
⎜   ↳ ELAN1200:00 04F3:3058 Mouse             	id=17	[slave  pointer  (2)]
⎜   ↳ ELAN1200:00 04F3:3058 Touchpad          	id=18	[slave  pointer  (2)]
⎜   ↳ ELAN24CC:00 04F3:24CC                   	id=15	[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)]
    ↳ Asus Wireless Radio Control             	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)]
    ↳ C-Media Electronics Inc. USB Audio Device	id=13	[slave  keyboard (3)]
    ↳ USB2.0 VGA UVC WebCam: USB2.0 V         	id=14	[slave  keyboard (3)]
    ↳ ELAN24CC:00 04F3:24CC Stylus            	id=16	[slave  keyboard (3)]
    ↳ gpio-keys                               	id=19	[slave  keyboard (3)]
    ↳ Asus WMI hotkeys                        	id=20	[slave  keyboard (3)]
    ↳ AT Translated Set 2 keyboard            	id=21	[slave  keyboard (3)]
    ↳ Logitech Wireless Keyboard PID:4023     	id=22	[slave  keyboard (3)]


EVENT type 6 (Motion)
    device: 12 (12)
    detail: 0
    flags: 
    root: 1416.54/974.88
    event: 1416.54/974.88
    buttons:
    modifiers: locked 0x10 latched 0 base 0 effective: 0x10
    group: locked 0 latched 0 base 0 effective: 0
    valuators:
        1: 973.88
    windows: root 0x7b6 event 0x7b6 child 0x600010
EVENT type 1 (DeviceChanged)
    device: 2 (4)
    reason: SlaveSwitch
	Reporting 3 classes:
		Class originated from: 4. Type: XIButtonClass
		Buttons supported: 10
		Button labels: "Button Left" "Button Middle" "Button Right" "Button Wheel Up" "Button Wheel Down" "Button Horiz Wheel Left" "Button Horiz Wheel Right" None None None
		Button state:
		Class originated from: 4. Type: XIValuatorClass
		Detail for Valuator 0:
		  Label: Rel X
		  Range: -1.000000 - -1.000000
		  Resolution: 0 units/m
		  Mode: relative
		Class originated from: 4. Type: XIValuatorClass
		Detail for Valuator 1:
		  Label: Rel Y
		  Range: -1.000000 - -1.000000
		  Resolution: 0 units/m
		  Mode: relative

EVENT type 15 (RawButtonPress)
    device: 2 (4)
    detail: 3
    flags: 
    valuators:

EVENT type 4 (ButtonPress)
    device: 4 (4)
    detail: 3
    flags: 
    root: 1416.54/973.88
    event: 1416.54/973.88
    buttons:
    modifiers: locked 0x10 latched 0 base 0 effective: 0x10
    group: locked 0 latched 0 base 0 effective: 0
    valuators:
    windows: root 0x7b6 event 0x7b6 child 0x600010
EVENT type 7 (Enter)
    device: 4 (4)
    windows: root 0x7b6 event 0x7b6 child 0x0
    mode: NotifyGrab (detail NotifyInferior)
    flags:  [same screen]
    buttons: 3
    modifiers: locked 0x10 latched 0 base 0 effective: 0
    group: locked 0 latched 0 base 0 effective: 0
    root x/y:  1416.00 / 973.00
    event x/y: 1416.00 / 973.00
EVENT type 16 (RawButtonRelease)
    device: 2 (4)
    detail: 3
    flags: 
    valuators:

EVENT type 5 (ButtonRelease)
    device: 4 (4)
    detail: 3
    flags: 
    root: 1416.54/973.88
    event: 1416.54/973.88
    buttons: 3
    modifiers: locked 0x10 latched 0 base 0 effective: 0x10
    group: locked 0 latched 0 base 0 effective: 0
    valuators:
    windows: root 0x7b6 event 0x7b6 child 0x600010
EVENT type 8 (Leave)
    device: 4 (4)
    windows: root 0x7b6 event 0x7b6 child 0x0
    mode: NotifyUngrab (detail NotifyInferior)
    flags:  [same screen]
    buttons:
    modifiers: locked 0x10 latched 0 base 0 effective: 0
    group: locked 0 latched 0 base 0 effective: 0
    root x/y:  1416.00 / 973.00
    event x/y: 1416.00 / 973.00
EVENT type 1 (DeviceChanged)
    device: 2 (12)
    reason: SlaveSwitch
	Reporting 7 classes:
		Class originated from: 12. Type: XIButtonClass
		Buttons supported: 20
		Button labels: "Button Left" "Button Middle" "Button Right" "Button Wheel Up" "Button Wheel Down" "Button Horiz Wheel Left" "Button Horiz Wheel Right" "Button Side" "Button Extra" "Button Forward" "Button Back" None None None None None None None None None
		Button state:
		Class originated from: 12. Type: XIValuatorClass
		Detail for Valuator 0:
		  Label: Rel X
		  Range: -1.000000 - -1.000000
		  Resolution: 0 units/m
		  Mode: relative
		Class originated from: 12. Type: XIValuatorClass
		Detail for Valuator 1:
		  Label: Rel Y
		  Range: -1.000000 - -1.000000
		  Resolution: 0 units/m
		  Mode: relative
		Class originated from: 12. Type: XIValuatorClass
		Detail for Valuator 2:
		  Label: Rel Horiz Scroll
		  Range: -1.000000 - -1.000000
		  Resolution: 0 units/m
		  Mode: relative
		Class originated from: 12. Type: XIValuatorClass
		Detail for Valuator 3:
		  Label: Rel Vert Scroll
		  Range: -1.000000 - -1.000000
		  Resolution: 0 units/m
		  Mode: relative
		Class originated from: 12. Type: XIScrollClass
		Scroll info for Valuator 2
		  type: 2 (horizontal)
		  increment: 15.000000
		  flags: 0x0
		Class originated from: 12. Type: XIScrollClass
		Scroll info for Valuator 3
		  type: 1 (vertical)
		  increment: 15.000000
		  flags: 0x0

EVENT type 17 (RawMotion)
    device: 2 (12)
    detail: 0
    flags: 
    valuators:
          0: -1.41 (-2.00)
          1: 0.70 (1.00)

EVENT type 6 (Motion)
    device: 12 (12)
    detail: 0
    flags: 
    root: 1416.14/973.58
    event: 1416.14/973.58
    buttons:
    modifiers: locked 0x10 latched 0 base 0 effective: 0x10
    group: locked 0 latched 0 base 0 effective: 0
    valuators:
        0: 1415.14
        1: 974.58
    windows: root 0x7b6 event 0x7b6 child 0xc6



I believe that they meant "shorts". I would not use foil; rather, I would clean the battery terminal carefully to remove any corrosion. Probably replace the battery.

I disassembly ma laptop and I couldn't see and corrosion. Instead I noticed that black plastic cover which surrender the battery is broken on edges. Anyway I cleaned everything with ISO alcohol but it did not help.

If the battery is removable, try removing it and running the machine... if the problem doesn't recur, then that's the problem.

Now I will try to run my PC without battery as suggested by @Mr_Magoo and see if that's gonna fix the problem.