Since when does UI button debouncing add 20-50ms latency?
Moreover, if you know what you're actually doing, debouncing doesn't actually add any latency whatsoever and response would be instantaneous.
I looked at my debouncing code for a project. I used 10 ms timer interrupt and the firmware would confirm button pressed after it's been in the same state for 3 consecutive reads. This puts debouncing delay at 20-30 ms plus some additional time if there were actual bounces. I cannot notice the delay when I use this button.
Googling "how long a button debouncing should take for a human to feel the delay" yeilds an AI answer telling that 50 ms is the average delay used in debouncing. It also says that people are able to notice the delay only at 100 ms or more. Not sure it is entirely accurate, but sounds plausible.
If you're interested, you can create a project with different debouncing delays and then run a statistical experiment. Program your chip to do debouncing with delay A or delay B randomly. Press the button 20 times, record which delay you perceived and compare it to the actual delay produced by the chip. If you can detect whether this was A or B correctly most of the time then you can perceive the difference between A and B. If you make many mistakes you can not. Repeat it with various A and B delays. Post the results.
I wouldn't program button debouncing in a way which adds any delay whatsover. It's stupid.
If a line can flip from 0 to 1, BEFORE the actual button is fully pressed (and not after), your design already has some other - very severe - issues.
The topic is musical instruments.
I can take a Bach piece or some fast synth licks and play it via MIDI instrument with total latency of 3-4ms.
And then increase audio interface buffer size such that total latency is 13-14ms.
I can instantly tell the difference, it's laggy ass.
It also says that people are able to notice the delay only at 100 ms or more.
There are people out there that are... to put bluntly... delayed up there and everywhere.
You could beat them with a steel pipe and they wouldn't notice.
That's not an argument or excuse for sloppy engineering.