Changeset 3232 in MondoRescue for branches/3.2/mindi-busybox/libbb/read_key.c
- Timestamp:
- Jan 1, 2014, 12:47:38 AM (10 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
branches/3.2/mindi-busybox/libbb/read_key.c
r2725 r3232 16 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 22 static const char esccmds[] ALIGN1 = { 20 23 'O','A' |0x80,KEYCODE_UP , … … 41 44 '[','D' |0x80,KEYCODE_LEFT , 42 45 /* ESC [ 1 ; 2 x, where x = A/B/C/D: Shift-<arrow> */ 43 /* ESC [ 1 ; 3 x, where x = A/B/C/D: Alt-<arrow> */46 /* ESC [ 1 ; 3 x, where x = A/B/C/D: Alt-<arrow> - implemented below */ 44 47 /* ESC [ 1 ; 4 x, where x = A/B/C/D: Alt-Shift-<arrow> */ 45 48 /* ESC [ 1 ; 5 x, where x = A/B/C/D: Ctrl-<arrow> - implemented below */ 46 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 52 '[','H' |0x80,KEYCODE_HOME , /* xterm */ 48 /* [ESC] ESC [ [2] H - [Alt-][Shift-]Home */49 53 '[','F' |0x80,KEYCODE_END , /* xterm */ 54 /* [ESC] ESC [ [2] H - [Alt-][Shift-]Home (End similarly?) */ 55 /* '[','Z' |0x80,KEYCODE_SHIFT_TAB, */ 50 56 '[','1','~' |0x80,KEYCODE_HOME , /* vt100? linux vt? or what? */ 51 57 '[','2','~' |0x80,KEYCODE_INSERT , … … 64 70 '[','8','~' |0x80,KEYCODE_END , /* vt100? linux vt? or what? */ 65 71 #if 0 66 '[','1','1','~'|0x80,KEYCODE_FUN1 , 67 '[','1','2','~'|0x80,KEYCODE_FUN2 , 68 '[','1','3','~'|0x80,KEYCODE_FUN3 , 69 '[','1','4','~'|0x80,KEYCODE_FUN4 , 72 '[','1','1','~'|0x80,KEYCODE_FUN1 , /* old xterm, deprecated by ESC O P */ 73 '[','1','2','~'|0x80,KEYCODE_FUN2 , /* old xterm... */ 74 '[','1','3','~'|0x80,KEYCODE_FUN3 , /* old xterm... */ 75 '[','1','4','~'|0x80,KEYCODE_FUN4 , /* old xterm... */ 70 76 '[','1','5','~'|0x80,KEYCODE_FUN5 , 71 77 /* [ESC] ESC [ 1 5 [;2] ~ - [Alt-][Shift-]F5 */ … … 87 93 '[','1',';','5','C' |0x80,KEYCODE_CTRL_RIGHT, 88 94 '[','1',';','5','D' |0x80,KEYCODE_CTRL_LEFT , 95 /* '[','1',';','3','A' |0x80,KEYCODE_ALT_UP , - unused */ 96 /* '[','1',';','3','B' |0x80,KEYCODE_ALT_DOWN , - unused */ 97 '[','1',';','3','C' |0x80,KEYCODE_ALT_RIGHT, 98 '[','1',';','3','D' |0x80,KEYCODE_ALT_LEFT , 99 /* '[','3',';','3','~' |0x80,KEYCODE_ALT_DELETE, - unused */ 89 100 0 90 /* ESC [ Z - Shift-Tab */91 101 }; 92 102 … … 215 225 n++; 216 226 /* Try to decipher "ESC [ NNN ; NNN R" sequence */ 217 if ((ENABLE_FEATURE_EDITING_ASK_TERMINAL || ENABLE_FEATURE_VI_ASK_TERMINAL) 227 if ((ENABLE_FEATURE_EDITING_ASK_TERMINAL 228 || ENABLE_FEATURE_VI_ASK_TERMINAL 229 || ENABLE_FEATURE_LESS_ASK_TERMINAL 230 ) 218 231 && n >= 5 219 232 && buffer[0] == '['
Note:
See TracChangeset
for help on using the changeset viewer.