aboutsummaryrefslogtreecommitdiff
path: root/libbb
diff options
context:
space:
mode:
authorDenys Vlasenko <vda.linux@googlemail.com>2012-06-11 14:40:17 +0200
committerDenys Vlasenko <vda.linux@googlemail.com>2012-06-11 14:40:17 +0200
commit0ccae4d8b379d310213a4e911670070b7030482d (patch)
treefd0ee166eadf614dea4c97127c79ca4d642fdaac /libbb
parentd3dff879f0683c2a4119f694c1b20c96ee030a26 (diff)
downloadbusybox-0ccae4d8b379d310213a4e911670070b7030482d.tar.gz
Add comments in keyboard escape sequences table
Signed-off-by: Denys Vlasenko <vda.linux@googlemail.com>
Diffstat (limited to 'libbb')
-rw-r--r--libbb/read_key.c15
1 files changed, 10 insertions, 5 deletions
diff --git a/libbb/read_key.c b/libbb/read_key.c
index 8d72d2a63..ace23defb 100644
--- a/libbb/read_key.c
+++ b/libbb/read_key.c
@@ -15,7 +15,10 @@ int64_t FAST_FUNC read_key(int fd, char *buffer, int timeout)
const char *seq;
int n;
- /* Known escape sequences for cursor and function keys */
+ /* Known escape sequences for cursor and function keys.
+ * See "Xterm Control Sequences"
+ * http://invisible-island.net/xterm/ctlseqs/ctlseqs.html
+ */
static const char esccmds[] ALIGN1 = {
'O','A' |0x80,KEYCODE_UP ,
'O','B' |0x80,KEYCODE_DOWN ,
@@ -44,6 +47,8 @@ int64_t FAST_FUNC read_key(int fd, char *buffer, int timeout)
/* ESC [ 1 ; 4 x, where x = A/B/C/D: Alt-Shift-<arrow> */
/* ESC [ 1 ; 5 x, where x = A/B/C/D: Ctrl-<arrow> - implemented below */
/* ESC [ 1 ; 6 x, where x = A/B/C/D: Ctrl-Shift-<arrow> */
+ /* ESC [ 1 ; 7 x, where x = A/B/C/D: Ctrl-Alt-<arrow> */
+ /* ESC [ 1 ; 8 x, where x = A/B/C/D: Ctrl-Alt-Shift-<arrow> */
'[','H' |0x80,KEYCODE_HOME , /* xterm */
'[','F' |0x80,KEYCODE_END , /* xterm */
/* [ESC] ESC [ [2] H - [Alt-][Shift-]Home (End similarly?) */
@@ -64,10 +69,10 @@ int64_t FAST_FUNC read_key(int fd, char *buffer, int timeout)
'[','7','~' |0x80,KEYCODE_HOME , /* vt100? linux vt? or what? */
'[','8','~' |0x80,KEYCODE_END , /* vt100? linux vt? or what? */
#if 0
- '[','1','1','~'|0x80,KEYCODE_FUN1 ,
- '[','1','2','~'|0x80,KEYCODE_FUN2 ,
- '[','1','3','~'|0x80,KEYCODE_FUN3 ,
- '[','1','4','~'|0x80,KEYCODE_FUN4 ,
+ '[','1','1','~'|0x80,KEYCODE_FUN1 , /* old xterm, deprecated by ESC O P */
+ '[','1','2','~'|0x80,KEYCODE_FUN2 , /* old xterm... */
+ '[','1','3','~'|0x80,KEYCODE_FUN3 , /* old xterm... */
+ '[','1','4','~'|0x80,KEYCODE_FUN4 , /* old xterm... */
'[','1','5','~'|0x80,KEYCODE_FUN5 ,
/* [ESC] ESC [ 1 5 [;2] ~ - [Alt-][Shift-]F5 */
'[','1','7','~'|0x80,KEYCODE_FUN6 ,