read-char-choice

read-char-choice is a compiled Lisp function in `subr.el'.

(read-char-choice PROMPT CHARS &optional INHIBIT-KEYBOARD-QUIT)

Read and return one of CHARS, prompting for PROMPT.
Any input that is not one of CHARS is ignored.

If optional argument INHIBIT-KEYBOARD-QUIT is non-nil, ignore
keyboard-quit events while waiting for a valid input.