When working with a self-designed TTP229 capacitative touch keypad for a project of mine, I started getting ghost keypresses. When I pressed one key, another key (or two) would be registered at the same time, or tenth of a second later. No ghost keypresses would appear on their own, however, they’d appear fairly often when I pressed a key – even appearing in the same serial data read, so a tick-based filtering (“keypress happening too quickly after the last one”) wouldn’t help.
The culprit was WiFi of the ESP32 that the keypad was connected to – at some point during debugging, I realized the problem never appeared until I turned WiFi on. Turning WiFi off in MicroPython REPL and re-testing confirmed this – the false keypresses only happened when WiFi was on (and connected AFAIU). This will likely also apply to ESP8266, TTP223 , TTP224 etc.
My solution is to keep ESP32 WiFi turned off at all times and only turning it on when I need to send data to my HTTP endpoint. Thankfully, my project is send-only and doesn’t need to poll anything over a network connection, so it works out quite nicely for me.