summaryrefslogtreecommitdiff
path: root/libbb/read_key.c
diff options
context:
space:
mode:
Diffstat (limited to 'libbb/read_key.c')
-rw-r--r--libbb/read_key.c16
1 files changed, 15 insertions, 1 deletions
diff --git a/libbb/read_key.c b/libbb/read_key.c
index d3832fa..410a999 100644
--- a/libbb/read_key.c
+++ b/libbb/read_key.c
@@ -22,7 +22,6 @@ int64_t FAST_FUNC read_key(int fd, char *buffer)
'O','B' |0x80,KEYCODE_DOWN ,
'O','C' |0x80,KEYCODE_RIGHT ,
'O','D' |0x80,KEYCODE_LEFT ,
- /* Ctrl-<arrow>: ESC [ 1 ; 5 x, where x = A/B/C/D */
'O','H' |0x80,KEYCODE_HOME ,
'O','F' |0x80,KEYCODE_END ,
#if 0
@@ -37,15 +36,26 @@ int64_t FAST_FUNC read_key(int fd, char *buffer)
'[','B' |0x80,KEYCODE_DOWN ,
'[','C' |0x80,KEYCODE_RIGHT ,
'[','D' |0x80,KEYCODE_LEFT ,
+ /* ESC [ 1 ; 2 x, where x = A/B/C/D: Shift-<arrow> */
+ /* ESC [ 1 ; 3 x, where x = A/B/C/D: Alt-<arrow> */
+ /* 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> */
'[','H' |0x80,KEYCODE_HOME , /* xterm */
/* [ESC] ESC [ [2] H - [Alt-][Shift-]Home */
'[','F' |0x80,KEYCODE_END , /* xterm */
'[','1','~' |0x80,KEYCODE_HOME , /* vt100? linux vt? or what? */
'[','2','~' |0x80,KEYCODE_INSERT ,
+ /* ESC [ 2 ; 3 ~ - Alt-Insert */
'[','3','~' |0x80,KEYCODE_DELETE ,
/* [ESC] ESC [ 3 [;2] ~ - [Alt-][Shift-]Delete */
+ /* ESC [ 3 ; 3 ~ - Alt-Delete */
+ /* ESC [ 3 ; 5 ~ - Ctrl-Delete */
'[','4','~' |0x80,KEYCODE_END , /* vt100? linux vt? or what? */
'[','5','~' |0x80,KEYCODE_PAGEUP ,
+ /* ESC [ 5 ; 3 ~ - Alt-PgUp */
+ /* ESC [ 5 ; 5 ~ - Ctrl-PgUp */
+ /* ESC [ 5 ; 7 ~ - Ctrl-Alt-PgUp */
'[','6','~' |0x80,KEYCODE_PAGEDOWN,
'[','7','~' |0x80,KEYCODE_HOME , /* vt100? linux vt? or what? */
'[','8','~' |0x80,KEYCODE_END , /* vt100? linux vt? or what? */
@@ -64,6 +74,10 @@ int64_t FAST_FUNC read_key(int fd, char *buffer)
'[','2','3','~'|0x80,KEYCODE_FUN11 ,
'[','2','4','~'|0x80,KEYCODE_FUN12 ,
#endif
+ '[','1',';','5','A' |0x80,KEYCODE_CTRL_UP ,
+ '[','1',';','5','B' |0x80,KEYCODE_CTRL_DOWN ,
+ '[','1',';','5','C' |0x80,KEYCODE_CTRL_RIGHT,
+ '[','1',';','5','D' |0x80,KEYCODE_CTRL_LEFT ,
0
};