If you don’t know the internal code for a certain key, type
CtrlK and then the function key. For example, this
sequence followed by the up arrow key will output:
<Up>
You can learn more about this command in the documentation for both insert
and command mode. The specific ways to map a special key are given in the
documentation with the tag :map-special-keys. Additionally, you can find a
handy table with :h key-notation.