Reputation: 1148
I am writing a function that reads ANSI escape sequences generated by keys and returns a macro corresponding to the key entered. I have tested my function and it reads the arrow keys properly. But the function can only read arrow keys currently and I want to add the control/alternate combinations, function keys, home, insert, etc. However I cannot seem to find a list of all the ANSI escape sequences for keys. In fact I found a copy of ECMA-48 and was confused when there was no mention of escape sequences for keys. So does anyone know where I can get a list of the ANSI escape sequences that correspond to the function keys, arrow keys, etc.?
Upvotes: 1
Views: 628
Reputation:
I'm pretty sure that arrow keys are brought up somewhere in ECMA048, but frankly I always found that document pretty much impenetrable. So, instead, I'll direct you to the ctlseqs.txt
document from the XTerm source code:
http://invisible-island.net/xterm/ctlseqs/ctlseqs.txt
This document focuses more on the control sequences used to control output, but does describe input control sequences in some detail as well. Search for the heading Alt and Meta Keys
for the start of the relevant section.
Upvotes: 1