Ok, I'm answering my own question. Using vi there are several ways to enter/edit control codes. CTRL-V worked the best for me:
CTRL-V Insert next non-digit literally. For special keys, the
terminal code is inserted. It's also possible to enter the
decimal, octal or hexadecimal value of a character
\ |i_CTRL-V_digit|.
The characters typed right after CTRL-V are not considered for
mapping. \{Vi: no decimal byte entry}
Note: When CTRL-V is mapped (e.g., to paste text) you can
often use CTRL-Q instead |i_CTRL-Q|.