OK, so this is strange.
I recently bought a HP Pavilion ab153nr laptop and installed UbuntuMate 15.10 on it. While setting everything up, I noticed that the screensaver would occasionally stop showing (ie, go back to the desktop) without me touching the computer, but I didn't worry about it. When I started using the computer, however, I noticed some additional strange behavior. Scrolling in my browser would sometimes cause the page to zoom in or out, and while typing in my IDE I would get apparently random commands.
Running xev shows that something is sending Alt_L, Control_L and Shift_R events. I ran xev overnight, and it counted 5 Shift_R KeyRelease events, 15 Alt_L events, and 25 Control_L events. Interestingly, there are no KeyPress events, though there are FocusOut, FocusIn, and KeymapNotify events. I don't know enough to know if those are relevant, however.
It's not related to my KVM switch (symptoms persisted when I disconnected it) or the laptop hardware (booting into the Windows 10 partition and leaving either the screen saver or the on-screen keyboard up for hours showed no unexpected behavior.)
Anyone have any ideas about what could be causing this? A way to better identify what process is sending these events? The laptop is supposed to be my development machine, but it's pretty much unusable with random control characters being sent every 10 minutes or so. I've put the log at http://pastebin.com/3inwfuxG if anyone wants to take a look; everything after the Scroll_Lock presses until the mouse movements at the end of the file is from when the box was left idle over night.
UPDATE 10/06: I rebooted into a Ubuntu/Mate Live stick and the problem persisted,but at a vastly reduced rate; maybe a few times a day instead of a few times an hour. I tried an Ubuntu/Unity 15.04 Live Stick, and I saw the problem ~3 times per hour. I went back to my installed system and deleted the two keyboard shortcuts I'd added, but that didn't change anything. I'm not using any keyboard remapper unless one comes enabled by default in Mate. But the comments about the focus changing got me thinking, and I watched when those occurred. It's hard to tell since the log doesn't timestamp them, but those are related to the screensaver coming on and off. The focus out happens when the screensaver starts, then there's an unpredictable length of time until the random keyboard event, and then the focus in occurs as the desktop comes back. I turned off the screensaver to confirm this and get a cleaner log, and two (or maybe three) very strange things happened: I started getting keyPress events for the mysterious keypresses; the rate of keypresses dropped significantly, down to what I saw on the Ubuntu/Mate Live Stick; and I've only seen Control_L events since then, and not Alt_L or Shift_R, though given the sharply reduced rate of occurrence, it's possible that's just a coincidence.
So on the installed system with screensaver enabled, I see multiple events per hour. On the Mate LiveStick with screensaver enabled, I see a handful of events per day. On the Unity LiveStick, which doesn't even have a screensaver, I see a smaller number of events per hour. And on the installed system with screensaver disabled, I see only a handful of events per day. There's no consistency here, so I'm missing something.
This is driving me batty. I was almost ready to call it a hardware problem despite the evidence until changing settings on the box changed the rate of incidence. I still might use cygwin to put xev on the Windows partition and leave that running overnight to see if it captures anything.