@mediamogul No, the joysticks have digital microswitches. I noticed an error in my reasoning: The buttons have nothing to do with the problems, as their ports are generating type 1 events. Only the joystick ports on the decoder board (four for each joystick, one per microswitch) generate type 2 events.
That said, the joysticks' microswitches are connected to the ports for axis number 0+1, whereas the ghost inputs only come from axis number 2, which nothing is connected to.
I tried to set the dead zones of axis 2 on both joysticks to its whole range of -32767 to 32767, hoping that would lead to the driver ignoring them alltogether. After that, jstest doesn't show any input from them anymore, but the screensaver still recognizes some input in irregular intervals and quits back to ES.
$ jscal -s 7,1,0,127,127,4227201,4194176,1,0,127,127,4227201,4194176,1,10,-32767,32767,2147483647,2147483647,1,0,127,127,2147483647,2147483647,1,0,127,127,2147483647,2147483647,1,0,0,0,2147483647,2147483647,1,0,0,0,2147483647,2147483647 /dev/input/js0
$ jscal -s 7,1,0,127,127,4227201,4194176,1,0,127,127,4227201,4194176,1,10,-32767,32767,2147483647,2147483647,1,0,127,127,2147483647,2147483647,1,0,127,127,2147483647,2147483647,1,0,0,0,2147483647,2147483647,1,0,0,0,2147483647,2147483647 /dev/input/js1
The part for axis 2 is 1,10,-32767,32767,2147483647,2147483647, see jscal's manpage for more information.
I got this idea after some research, from these two sites:
https://ubuntuforums.org/showthread.php?t=1079284 (a similar problem to mine)
https://blog.gimx.fr/joystick-calibration-in-gnulinux/ (it explains the working of jscal -s in some more detail)