I've done a bunch of debouncing switch inputs, keypad, keyboard, rotory switches. And wrote some test code for capcitive touch display (long time ago)
It's the kinda problem that will tend to bite you in the butt if you aren't aware of all the gotchas. Difficulty is they are application specific. But I wouldn't describe the code as particularly complicated.
Most of this stuff a crusty old neckbeard embedded programmer can do half drunk on Friday afternoon.
I can 100% tell from your comment that you've never had to work with one.
It's less science than black magic to avoid double presses or missed presses.