lookup-key

lookup-key is a built-in function in `C source code'.

(lookup-key KEYMAP KEY &optional ACCEPT-DEFAULT)

In keymap KEYMAP, look up key sequence KEY. Return the definition.
A value of nil means undefined. See doc of `define-key'
for kinds of definitions.

A number as value means KEY is "too long";
that is, characters or symbols in it except for the last one
fail to be a valid sequence of prefix characters in KEYMAP.
The number is how many characters at the front of KEY
it takes to reach a non-prefix key.

Normally, `lookup-key' ignores bindings for t, which act as default
bindings, used when nothing else in the keymap applies; this makes it
usable as a general function for probing keymaps. However, if the
third optional argument ACCEPT-DEFAULT is non-nil, `lookup-key' will
recognize the default bindings, just as `read-key-sequence' does.