How to stop repeated letter/backspace entry in an input field when they key is held down?

I’m using a TMP input field and would like to override some default behaviour. Specifically, when a letter is held down, it repeats. Similarly, when backspace (or delete) is held down, it removes multiple characters.

I would like it so that if a letter is held down, that letter is only entered once. I would also like backspace to only remove one character if it is held down.

I am already implementing Input.GetKeyDown() to perform a certain task, so I believe I will need to do something similar here, but I can’t quite work out how.

Thanks.

Did you find a solution?