Changeset 3232 in MondoRescue for branches/3.2/mindi-busybox/libbb/read_key.c


Ignore:
Timestamp:
Jan 1, 2014, 12:47:38 AM (10 years ago)
Author:
Bruno Cornec
Message:
  • Update mindi-busybox to 1.21.1
File:
1 edited

Legend:

Unmodified
Added
Removed
  • branches/3.2/mindi-busybox/libbb/read_key.c

    r2725 r3232  
    1616    int n;
    1717
    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     */
    1922    static const char esccmds[] ALIGN1 = {
    2023        'O','A'        |0x80,KEYCODE_UP      ,
     
    4144        '[','D'        |0x80,KEYCODE_LEFT    ,
    4245        /* 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 */
    4447        /* ESC [ 1 ; 4 x, where x = A/B/C/D: Alt-Shift-<arrow> */
    4548        /* ESC [ 1 ; 5 x, where x = A/B/C/D: Ctrl-<arrow> - implemented below */
    4649        /* 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> */
    4752        '[','H'        |0x80,KEYCODE_HOME    , /* xterm */
    48         /* [ESC] ESC [ [2] H - [Alt-][Shift-]Home */
    4953        '[','F'        |0x80,KEYCODE_END     , /* xterm */
     54        /* [ESC] ESC [ [2] H - [Alt-][Shift-]Home (End similarly?) */
     55        /* '[','Z'        |0x80,KEYCODE_SHIFT_TAB, */
    5056        '[','1','~'    |0x80,KEYCODE_HOME    , /* vt100? linux vt? or what? */
    5157        '[','2','~'    |0x80,KEYCODE_INSERT  ,
     
    6470        '[','8','~'    |0x80,KEYCODE_END     , /* vt100? linux vt? or what? */
    6571#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... */
    7076        '[','1','5','~'|0x80,KEYCODE_FUN5    ,
    7177        /* [ESC] ESC [ 1 5 [;2] ~ - [Alt-][Shift-]F5 */
     
    8793        '[','1',';','5','C' |0x80,KEYCODE_CTRL_RIGHT,
    8894        '[','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 */
    89100        0
    90         /* ESC [ Z - Shift-Tab */
    91101    };
    92102
     
    215225        n++;
    216226        /* 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            )
    218231         && n >= 5
    219232         && buffer[0] == '['
Note: See TracChangeset for help on using the changeset viewer.