input-pending-p

input-pending-p is a built-in function in `C source code'.

(input-pending-p &optional CHECK-TIMERS)

Return t if command input is currently available with no wait.
Actually, the value is nil only if we can be sure that no input is available;
if there is a doubt, the value is t.

If CHECK-TIMERS is non-nil, timers that are ready to run will do so.