OK, that's by far the most promising (and most stupid) suggestion that I've seen, so I'll jump on that bandwagon. I've tried everything else, am on 10.10.2 since a while, and started having the problems again these days. First with the trackpad, then the keyboard. When everything started, one other thing around the same time I probably started doing was using Duracell NiMH rechargeable batteries. I've looked up the receipt; I've bought them May 10th, 2014. Relatively shortly after, I've bought a USB 3 hub. I noticed some keyboard lag and attributed it to the USB hub, but didn't follow up. This was about end of June. I was on business trips until early September. I experienced the issues massively after that; around the time I had upgraded to Yosemite.
So what also may have happened is that my batteries lasted long enough for not making too much problems, and since then I've those recurring problems. Yes, that would be stupid, but is the best possibility that I've left over for now. What supports that thought is that in the last days, first my trackpad and then my keyboard started their funny behavior again. At the same time, I got a battery warning first for the trackpad and then a couple days later for the keyboard. So I've pulled my Fluke and am going to measure the voltages from now on.
The newly loaded rechargeable batteries, together, bring about 2.743 V.
The fully loaded alkaline batteries I've put into my keyboard show, together, 3.219 V; Apple shows up with 100%.
The mostly fully loaded alkaline batteries I've put into my trackpad show, together, 2.908 V; Apple shows up with 92%.
The rechargeable batteries I took out of the keyboard were at 2.46 V; for the trackpad, 2.475 V.
So I'll track the voltages for a bit and see whether that theory holds. If so, I should get some funny behavior at about 2.5 V.
Thanks for the excellent suggestion!
P.S. As a somewhat related issue, a Bose QC15 headset starts refusing to work (it warns a lot earlier) at 0.94V. The NiMH batteries I use for that charge up to 1.35 V. So you'd have a working band of about 0.4V down from maximum charge. For the trackpad it would be 0.27V, and on the keyboard, it would be around 0.28V - or rather less because both were already behaving funnily for a couple days. In other words, just guesstimating, using those rechargeable batteries - and the NiMH ones are of the more expensive kind - I'd have probably around 0.2V - 0.25V I can consume of the full load until I have problems, while for Alkaline batteries, it would be 0.7V.
Time for a poll... who among us here uses rechargeable batteries?