aboutsummaryrefslogtreecommitdiff
path: root/libbb/read_key.c
diff options
context:
space:
mode:
authorDenys Vlasenko <vda.linux@googlemail.com>2011-11-03 13:28:22 +0100
committerDenys Vlasenko <vda.linux@googlemail.com>2011-11-03 13:28:22 +0100
commit9ce09bc9cb7743f87eb3e536c81d8c303e12bc81 (patch)
treead65a2f47136af7a730b630c4e08532c02ff0fb6 /libbb/read_key.c
parent45cdf166dccb4981004bae822f52e48df05aab91 (diff)
downloadbusybox-9ce09bc9cb7743f87eb3e536c81d8c303e12bc81.tar.gz
lineedit: add support for M-b, M-f, M-d, M-Backspace
function old new delta ctrl_left - 96 +96 ctrl_right - 76 +76 static.esccmds 81 93 +12 read_line_input 3876 3885 +9 ------------------------------------------------------------------------------ (add/remove: 2/0 grow/shrink: 2/0 up/down: 193/0) Total: 193 bytes Signed-off-by: Denys Vlasenko <vda.linux@googlemail.com>
Diffstat (limited to 'libbb/read_key.c')
-rw-r--r--libbb/read_key.c11
1 files changed, 8 insertions, 3 deletions
diff --git a/libbb/read_key.c b/libbb/read_key.c
index 5dcd19c3f..8d72d2a63 100644
--- a/libbb/read_key.c
+++ b/libbb/read_key.c
@@ -40,13 +40,14 @@ int64_t FAST_FUNC read_key(int fd, char *buffer, int timeout)
'[','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 ; 3 x, where x = A/B/C/D: Alt-<arrow> - implemented below */
/* 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 */
+ /* [ESC] ESC [ [2] H - [Alt-][Shift-]Home (End similarly?) */
+ /* '[','Z' |0x80,KEYCODE_SHIFT_TAB, */
'[','1','~' |0x80,KEYCODE_HOME , /* vt100? linux vt? or what? */
'[','2','~' |0x80,KEYCODE_INSERT ,
/* ESC [ 2 ; 3 ~ - Alt-Insert */
@@ -86,8 +87,12 @@ int64_t FAST_FUNC read_key(int fd, char *buffer, int timeout)
/* '[','1',';','5','B' |0x80,KEYCODE_CTRL_DOWN , - unused */
'[','1',';','5','C' |0x80,KEYCODE_CTRL_RIGHT,
'[','1',';','5','D' |0x80,KEYCODE_CTRL_LEFT ,
+ /* '[','1',';','3','A' |0x80,KEYCODE_ALT_UP , - unused */
+ /* '[','1',';','3','B' |0x80,KEYCODE_ALT_DOWN , - unused */
+ '[','1',';','3','C' |0x80,KEYCODE_ALT_RIGHT,
+ '[','1',';','3','D' |0x80,KEYCODE_ALT_LEFT ,
+ /* '[','3',';','3','~' |0x80,KEYCODE_ALT_DELETE, - unused */
0
- /* ESC [ Z - Shift-Tab */
};
pfd.fd = fd;