--- readline5-5.1/terminal.c 2005-11-13 02:46:54.000000000 +0100 +++ readline5-5.1-mine/terminal.c 2006-06-03 17:13:04.000000000 +0200 @@ -136,7 +136,9 @@ static char *_rl_term_ku; static char *_rl_term_kd; static char *_rl_term_kr; +static char *_rl_term_percenti; /* %i shifted right */ static char *_rl_term_kl; +static char *_rl_term_sharp4; /* #4 shifted left */ /* How to initialize and reset the arrow keys, if this terminal has any. */ static char *_rl_term_ks; @@ -144,14 +146,93 @@ /* The key sequences sent by the Home and End keys, if any. */ static char *_rl_term_kh; +static char *_rl_term_K1; /* keypad home */ static char *_rl_term_kH; -static char *_rl_term_at7; /* @7 */ - -/* Delete key */ -static char *_rl_term_kD; +static char *_rl_term_sharp2; /* #2 shifted home */ +static char *_rl_term_at1; /* @1 begin */ +static char *_rl_term_and9; /* &9 shifted begin */ +static char *_rl_term_at7; /* @7 end */ +static char *_rl_term_K4; /* keypad end */ +static char *_rl_term_star7; /* *7 shifted end */ + +/* Delete keys */ +static char *_rl_term_kD; /* delete */ +static char *_rl_term_star4; /* *4 shifted delete */ +static char *_rl_term_kb; /* backspace */ +static char *_rl_term_kL; /* delete line */ +static char *_rl_term_star5; /* *5 shifted delete line */ +static char *_rl_term_kC; /* clear */ +static char *_rl_term_kE; /* clear-to-end-of-line */ +static char *_rl_term_star8; /* *8 shifted clear-to-end-of-line */ /* Insert key */ static char *_rl_term_kI; +static char *_rl_term_sharp3; /* #3 shifted insert-characteer */ + +/* Find */ +static char *_rl_term_at0; /* @0 find */ +static char *_rl_term_star0; /* *0 shifted find */ +static char *_rl_term_kN; /* next page */ +static char *_rl_term_K5; /* keypad next page */ +static char *_rl_term_kP; /* previous page */ +static char *_rl_term_K3; /* keypad previous page */ +static char *_rl_term_percent5; /* %5 next */ +static char *_rl_term_percentc; /* %c shifted next */ +static char *_rl_term_percent8; /* %8 previous */ +static char *_rl_term_percente; /* %e shifted previous */ + +/* Enter */ +static char *_rl_term_at8; /* @8 enter */ + +/* Refresh */ +static char *_rl_term_and2; /* &2 refresh */ + +/* Mark */ +static char *_rl_term_percent2; /* %2 mark */ + +/* Undo */ +static char *_rl_term_and8; /* &8 undo */ +static char *_rl_term_not3; /* !3 shifted undo */ +/* TODO: %0 redo / %g shifted redo */ + +/* Copy */ +static char *_rl_term_at5; /* @5 copy */ +static char *_rl_term_star2; /* *2 shifted copy */ + +/* TODO + * + * nowadays keyboards + * - K2 center of keypad + * - kM sent by rmir or smir in insert mode + * - k0... Fx function keys + * + * odd keyboards + * - %1 help / #1 shifted help + * - %3 message / %a shifted message + * - %4 move / %b shifted move + * - %6 open + * - %7 options / %d shifted options + * - %9 print / %f shifted print + * - &1 reference + * - &3 replace / %h shifted replace + * - &4 restart + * - &5 resume / %j shifted resume + * - &6 save / !1 shifted save + * - &7 suspend / !2 shifted suspend + * - *6 select key + * - @2 cancel / &0 shifted cancel + * - @3 close + * - @4 command / *1 shifted command + * - @6 create / *3 shifted create + * - @9 exit / *9 shifted exit + * - kA insert-line + * - kB back-tab + * - kF scroll forward / kR scroll backward + * - kS clear-to-end-of-screen + * - kT set-tab + * - ka clear-all-tabs + * - kt clear-tab + */ /* Cursor control */ static char *_rl_term_vs; /* very visible */ @@ -332,10 +413,37 @@ search algorithm to something smarter. */ static const struct _tc_string tc_strings[] = { - { "@7", &_rl_term_at7 }, + { "!3", &_rl_term_not3 }, /* shifted undo */ + { "#2", &_rl_term_sharp2 }, /* shifted home */ + { "#3", &_rl_term_sharp3 }, /* shifted insert */ + { "#4", &_rl_term_sharp4 }, /* shifted left */ + { "%2", &_rl_term_percent2 }, /* mark */ + { "%5", &_rl_term_percent5 }, /* next */ + { "%8", &_rl_term_percent8 }, /* previous */ + { "%c", &_rl_term_percentc }, /* shifted next */ + { "%e", &_rl_term_percente }, /* shifted previous */ + { "%i", &_rl_term_percenti }, /* shifted right */ + { "&2", &_rl_term_and2 }, /* refresh */ + { "&8", &_rl_term_and8 }, /* redo */ + { "&9", &_rl_term_and9 }, /* shifted begin */ + { "*0", &_rl_term_star0 }, /* shifted find */ + { "*2", &_rl_term_star2 }, /* shifted copy */ + { "*4", &_rl_term_star4 }, /* shifted delete */ + { "*5", &_rl_term_star5 }, /* shifted delete line */ + { "*7", &_rl_term_star7 }, /* shifted end */ + { "*8", &_rl_term_star8 }, /* shifted clear-to-end-of-line */ + { "@0", &_rl_term_at0 }, /* find */ + { "@1", &_rl_term_at1 }, /* begin */ + { "@5", &_rl_term_at5 }, /* copy */ + { "@7", &_rl_term_at7 }, /* end */ + { "@8", &_rl_term_at8 }, /* enter */ { "DC", &_rl_term_DC }, { "E3", &_rl_term_clrscroll }, { "IC", &_rl_term_IC }, + { "K1", &_rl_term_K1 }, /* keypad home */ + { "K3", &_rl_term_K3 }, /* keypad previous page */ + { "K4", &_rl_term_K4 }, /* keypad end */ + { "K5", &_rl_term_K5 }, /* keypad next page */ { "ce", &_rl_term_clreol }, { "cl", &_rl_term_clrpag }, { "cr", &_rl_term_cr }, @@ -342,9 +450,15 @@ { "ei", &_rl_term_ei }, { "ic", &_rl_term_ic }, { "im", &_rl_term_im }, + { "kC", &_rl_term_kC }, /* clear */ { "kD", &_rl_term_kD }, /* delete */ + { "kE", &_rl_term_kE }, /* clear to end of line */ { "kH", &_rl_term_kH }, /* home down ?? */ { "kI", &_rl_term_kI }, /* insert */ + { "kL", &_rl_term_kL }, /* delete line */ + { "kN", &_rl_term_kN }, /* next page */ + { "kP", &_rl_term_kP }, /* previous page */ + { "kb", &_rl_term_kb }, /* backspace */ { "kd", &_rl_term_kd }, { "ke", &_rl_term_ke }, /* end keypad mode */ { "kh", &_rl_term_kh }, /* home */ @@ -450,8 +564,22 @@ _rl_term_im = _rl_term_ei = _rl_term_ic = _rl_term_IC = (char *)NULL; _rl_term_up = _rl_term_dc = _rl_term_DC = _rl_visible_bell = (char *)NULL; _rl_term_ku = _rl_term_kd = _rl_term_kl = _rl_term_kr = (char *)NULL; - _rl_term_kh = _rl_term_kH = _rl_term_kI = _rl_term_kD = (char *)NULL; - _rl_term_ks = _rl_term_ke = _rl_term_at7 = (char *)NULL; + _rl_term_percenti = _rl_term_sharp4 = (char *)NULL; + _rl_term_kN = _rl_term_kP = _rl_term_K3 = _rl_term_K5 = (char *)NULL; + _rl_term_kh = _rl_term_K1 = _rl_term_kH = _rl_term_sharp2 = (char *)NULL; + _rl_term_at1 = _rl_term_and9 = (char *)NULL; + _rl_term_at7 = _rl_term_K4 = _rl_term_star7 = (char *)NULL; + _rl_term_kD = _rl_term_star4 = _rl_term_kb = (char *)NULL; + _rl_term_kL = _rl_term_star5 = (char *)NULL; + _rl_term_kC = _rl_term_star8 = _rl_term_kE = (char *)NULL; + _rl_term_kI = _rl_term_sharp3 = (char *)NULL; + _rl_term_at0 = _rl_term_star0 = (char *)NULL; + _rl_term_percent5 = _rl_term_percentc = (char *)NULL; + _rl_term_percent8 = _rl_term_percente = (char *)NULL; + _rl_term_at8 = _rl_term_and2 = _rl_term_percent2 = (char *)NULL; + _rl_term_and8 = _rl_term_not3 = (char *)NULL; + _rl_term_at5 = _rl_term_star2 = (char *)NULL; + _rl_term_ks = _rl_term_ke = (char *)NULL; _rl_term_mm = _rl_term_mo = (char *)NULL; _rl_term_ve = _rl_term_vs = (char *)NULL; _rl_term_forward_char = (char *)NULL; @@ -525,13 +653,54 @@ rl_bind_keyseq_if_unbound (_rl_term_ku, rl_get_previous_history); rl_bind_keyseq_if_unbound (_rl_term_kd, rl_get_next_history); rl_bind_keyseq_if_unbound (_rl_term_kr, rl_forward_char); + rl_bind_keyseq_if_unbound (_rl_term_percenti, rl_forward_char); /* shifted right */ rl_bind_keyseq_if_unbound (_rl_term_kl, rl_backward_char); + rl_bind_keyseq_if_unbound (_rl_term_sharp4, rl_backward_char); /* shifted left */ rl_bind_keyseq_if_unbound (_rl_term_kh, rl_beg_of_line); /* Home */ + rl_bind_keyseq_if_unbound (_rl_term_K1, rl_beg_of_line); /* keypad home */ + rl_bind_keyseq_if_unbound (_rl_term_kH, rl_beg_of_line); /* Home down */ + rl_bind_keyseq_if_unbound (_rl_term_sharp2, rl_beg_of_line); /* shifted home */ + rl_bind_keyseq_if_unbound (_rl_term_at1, rl_beg_of_line); /* begin */ + rl_bind_keyseq_if_unbound (_rl_term_and9, rl_beg_of_line); /* shifted begin */ rl_bind_keyseq_if_unbound (_rl_term_at7, rl_end_of_line); /* End */ + rl_bind_keyseq_if_unbound (_rl_term_K4, rl_end_of_line); /* keypad end */ + rl_bind_keyseq_if_unbound (_rl_term_star7, rl_end_of_line); /* shifted end */ rl_bind_keyseq_if_unbound (_rl_term_kD, rl_delete); + rl_bind_keyseq_if_unbound (_rl_term_star4, rl_rubout); /* shifted delete */ + rl_bind_keyseq_if_unbound (_rl_term_kb, rl_rubout); /* backspace */ + rl_bind_keyseq_if_unbound (_rl_term_kL, rl_kill_full_line); /* delete line */ + rl_bind_keyseq_if_unbound (_rl_term_star5, rl_kill_full_line); /* shifted delete line */ + rl_bind_keyseq_if_unbound (_rl_term_kC, rl_kill_full_line); /* clear */ + rl_bind_keyseq_if_unbound (_rl_term_kE, rl_kill_line); /* clear to end of line */ + rl_bind_keyseq_if_unbound (_rl_term_star8, rl_backward_kill_line); /* shifted clear to end of line */ + rl_bind_keyseq_if_unbound (_rl_term_kI, rl_overwrite_mode); /* Insert */ + rl_bind_keyseq_if_unbound (_rl_term_sharp3, rl_vi_insertion_mode); /* shifted insert */ + + rl_bind_keyseq_if_unbound (_rl_term_at0, rl_noninc_reverse_search); /* find */ + rl_bind_keyseq_if_unbound (_rl_term_star0, rl_noninc_forward_search); /* shifted find */ + rl_bind_keyseq_if_unbound (_rl_term_kN, rl_history_search_forward); /* next page */ + rl_bind_keyseq_if_unbound (_rl_term_K5, rl_history_search_forward); /* keypad next page */ + rl_bind_keyseq_if_unbound (_rl_term_kP, rl_history_search_backward); /* previous page */ + rl_bind_keyseq_if_unbound (_rl_term_K3, rl_history_search_backward); /* keypad previous page */ + rl_bind_keyseq_if_unbound (_rl_term_percent5, rl_forward_search_history); /* next */ + rl_bind_keyseq_if_unbound (_rl_term_percentc, rl_reverse_search_history); /* shift next */ + rl_bind_keyseq_if_unbound (_rl_term_percent8, rl_reverse_search_history); /* previous */ + rl_bind_keyseq_if_unbound (_rl_term_percente, rl_forward_search_history); /* shift previous */ + + rl_bind_keyseq_if_unbound (_rl_term_at8, rl_newline); /* enter */ + + rl_bind_keyseq_if_unbound (_rl_term_and2, rl_refresh_line); /* refresh */ + + rl_bind_keyseq_if_unbound (_rl_term_percent2, rl_set_mark); /* mark */ + + rl_bind_keyseq_if_unbound (_rl_term_and8, rl_undo_command); /* undo */ + rl_bind_keyseq_if_unbound (_rl_term_not3, rl_undo_command); /* shifted undo */ + + rl_bind_keyseq_if_unbound (_rl_term_at5, rl_copy_region_to_kill); /* copy */ + rl_bind_keyseq_if_unbound (_rl_term_star2, rl_copy_region_to_kill); /* shifted copy */ _rl_keymap = xkeymap; }