diff options
author | Denys Vlasenko <vda.linux@googlemail.com> | 2012-06-11 14:40:17 +0200 |
---|---|---|
committer | Denys Vlasenko <vda.linux@googlemail.com> | 2012-06-11 14:40:17 +0200 |
commit | 0ccae4d8b379d310213a4e911670070b7030482d (patch) | |
tree | fd0ee166eadf614dea4c97127c79ca4d642fdaac /libbb | |
parent | d3dff879f0683c2a4119f694c1b20c96ee030a26 (diff) | |
download | busybox-w32-0ccae4d8b379d310213a4e911670070b7030482d.tar.gz busybox-w32-0ccae4d8b379d310213a4e911670070b7030482d.tar.bz2 busybox-w32-0ccae4d8b379d310213a4e911670070b7030482d.zip |
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.c | 15 |
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) | |||
15 | const char *seq; | 15 | const char *seq; |
16 | int n; | 16 | int n; |
17 | 17 | ||
18 | /* Known escape sequences for cursor and function keys */ | 18 | /* Known escape sequences for cursor and function keys. |
19 | * See "Xterm Control Sequences" | ||
20 | * http://invisible-island.net/xterm/ctlseqs/ctlseqs.html | ||
21 | */ | ||
19 | static const char esccmds[] ALIGN1 = { | 22 | static const char esccmds[] ALIGN1 = { |
20 | 'O','A' |0x80,KEYCODE_UP , | 23 | 'O','A' |0x80,KEYCODE_UP , |
21 | 'O','B' |0x80,KEYCODE_DOWN , | 24 | 'O','B' |0x80,KEYCODE_DOWN , |
@@ -44,6 +47,8 @@ int64_t FAST_FUNC read_key(int fd, char *buffer, int timeout) | |||
44 | /* ESC [ 1 ; 4 x, where x = A/B/C/D: Alt-Shift-<arrow> */ | 47 | /* ESC [ 1 ; 4 x, where x = A/B/C/D: Alt-Shift-<arrow> */ |
45 | /* ESC [ 1 ; 5 x, where x = A/B/C/D: Ctrl-<arrow> - implemented below */ | 48 | /* ESC [ 1 ; 5 x, where x = A/B/C/D: Ctrl-<arrow> - implemented below */ |
46 | /* ESC [ 1 ; 6 x, where x = A/B/C/D: Ctrl-Shift-<arrow> */ | 49 | /* ESC [ 1 ; 6 x, where x = A/B/C/D: Ctrl-Shift-<arrow> */ |
50 | /* ESC [ 1 ; 7 x, where x = A/B/C/D: Ctrl-Alt-<arrow> */ | ||
51 | /* ESC [ 1 ; 8 x, where x = A/B/C/D: Ctrl-Alt-Shift-<arrow> */ | ||
47 | '[','H' |0x80,KEYCODE_HOME , /* xterm */ | 52 | '[','H' |0x80,KEYCODE_HOME , /* xterm */ |
48 | '[','F' |0x80,KEYCODE_END , /* xterm */ | 53 | '[','F' |0x80,KEYCODE_END , /* xterm */ |
49 | /* [ESC] ESC [ [2] H - [Alt-][Shift-]Home (End similarly?) */ | 54 | /* [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) | |||
64 | '[','7','~' |0x80,KEYCODE_HOME , /* vt100? linux vt? or what? */ | 69 | '[','7','~' |0x80,KEYCODE_HOME , /* vt100? linux vt? or what? */ |
65 | '[','8','~' |0x80,KEYCODE_END , /* vt100? linux vt? or what? */ | 70 | '[','8','~' |0x80,KEYCODE_END , /* vt100? linux vt? or what? */ |
66 | #if 0 | 71 | #if 0 |
67 | '[','1','1','~'|0x80,KEYCODE_FUN1 , | 72 | '[','1','1','~'|0x80,KEYCODE_FUN1 , /* old xterm, deprecated by ESC O P */ |
68 | '[','1','2','~'|0x80,KEYCODE_FUN2 , | 73 | '[','1','2','~'|0x80,KEYCODE_FUN2 , /* old xterm... */ |
69 | '[','1','3','~'|0x80,KEYCODE_FUN3 , | 74 | '[','1','3','~'|0x80,KEYCODE_FUN3 , /* old xterm... */ |
70 | '[','1','4','~'|0x80,KEYCODE_FUN4 , | 75 | '[','1','4','~'|0x80,KEYCODE_FUN4 , /* old xterm... */ |
71 | '[','1','5','~'|0x80,KEYCODE_FUN5 , | 76 | '[','1','5','~'|0x80,KEYCODE_FUN5 , |
72 | /* [ESC] ESC [ 1 5 [;2] ~ - [Alt-][Shift-]F5 */ | 77 | /* [ESC] ESC [ 1 5 [;2] ~ - [Alt-][Shift-]F5 */ |
73 | '[','1','7','~'|0x80,KEYCODE_FUN6 , | 78 | '[','1','7','~'|0x80,KEYCODE_FUN6 , |