1
1

* key.c (mc_bindings): Remove. Esc-">" and Esc-"<" are not

always the same as Home and End, at least in mcedit.
(get_key_code): Never ignore Escape outside known sequences.
* screen.c (panel_keymap): Add Esc-">" and Esc-"<".
* tree.c (tree_keymap): Likewise.
* widget.c (input_map): Likewise.
(listbox_key): Likewise.
(check_movement_keys): Likewise.
Reported by Miguel de Icaza <miguel@ximian.com>
Этот коммит содержится в:
Pavel Roskin 2003-06-14 05:19:19 +00:00
родитель 6b63507463
Коммит 944d5c430b
6 изменённых файлов: 31 добавлений и 19 удалений

Просмотреть файл

@ -1,3 +1,15 @@
2003-06-09 Pavel Roskin <proski@gnu.org>
* key.c (mc_bindings): Remove. Esc-">" and Esc-"<" are not
always the same as Home and End, at least in mcedit.
(get_key_code): Never ignore Escape outside known sequences.
* screen.c (panel_keymap): Add Esc-">" and Esc-"<".
* tree.c (tree_keymap): Likewise.
* widget.c (input_map): Likewise.
(listbox_key): Likewise.
(check_movement_keys): Likewise.
Reported by Miguel de Icaza <miguel@ximian.com>
2003-06-09 David Sterba <dave@jikos.cz>
* key.c (correct_key_code): Treat Shift-Backspace as Backspace.

Просмотреть файл

@ -203,12 +203,6 @@ typedef const struct {
int action;
} key_define_t;
static key_define_t mc_bindings [] = {
{ KEY_END, ESC_STR ">", MCKEY_NOACTION },
{ KEY_HOME, ESC_STR "<", MCKEY_NOACTION },
{ 0, 0, MCKEY_NOACTION },
};
/* Broken terminfo and termcap databases on xterminals */
static key_define_t xterm_key_defines [] = {
{ KEY_F(1), ESC_STR "OP", MCKEY_NOACTION },
@ -344,8 +338,6 @@ void init_key (void)
((!strncmp (term, "iris-ansi", 9)) || (!strncmp (term, "xterm", 5))))
define_sequences (xterm_key_defines);
define_sequences (mc_bindings);
/* load some additional keys (e.g. direct Alt-? support) */
load_xtra_key_defines();
@ -763,17 +755,15 @@ int get_key_code (int no_delay)
this = this->next;
else {
if (parent != NULL && parent->action == MCKEY_ESCAPE) {
/* This is just to save a lot of define_sequences */
if (isalpha(c)
|| (c == '\n') || (c == '\t') || (c == (31 & 'h'))
|| (c == KEY_BACKSPACE) || (c == '!') || (c == '\r')
|| c == 0177 || c == '+' || c == '-' || c == '\\'
|| c == '?')
c = ALT(c);
else if (isdigit(c))
/* Convert escape-digits to F-keys */
if (isdigit(c))
c = KEY_F (c - '0');
else if (c == ' ')
c = ESC_CHAR;
else
c = ALT(c);
pending_keys = seq_append = NULL;
this = NULL;
return correct_key_code (c);

Просмотреть файл

@ -2059,9 +2059,11 @@ static const key_map panel_keymap [] = {
{ KEY_IC, mark_file },
{ KEY_HOME, move_home },
{ KEY_A1, move_home },
{ ALT ('<'), move_home },
{ KEY_C1, move_end },
{ KEY_END, move_end },
{ KEY_A1, move_home },
{ ALT ('>'), move_end },
{ KEY_NPAGE, next_page },
{ KEY_PPAGE, prev_page },
{ KEY_NPAGE | KEY_M_CTRL, ctrl_next_page },

Просмотреть файл

@ -926,9 +926,11 @@ static const key_map tree_keymap [] = {
{ '\n', chdir_sel },
{ KEY_ENTER, chdir_sel },
{ KEY_HOME, move_home },
{ KEY_C1, move_end },
{ KEY_END, move_end },
{ KEY_A1, move_home },
{ ALT ('<'), move_home },
{ KEY_END, move_end },
{ KEY_C1, move_end },
{ ALT ('>'), move_end },
{ KEY_NPAGE, move_nextp },
{ KEY_PPAGE, move_prevp },
{ XCTRL('v'), move_nextp },

Просмотреть файл

@ -1401,9 +1401,11 @@ static const struct {
{ XCTRL('a'), beginning_of_line },
{ KEY_HOME, beginning_of_line },
{ KEY_A1, beginning_of_line },
{ ALT ('<'), beginning_of_line },
{ XCTRL('e'), end_of_line },
{ KEY_END, end_of_line },
{ KEY_C1, end_of_line },
{ ALT ('>'), end_of_line },
{ KEY_LEFT, key_left },
{ KEY_LEFT | KEY_M_CTRL, key_ctrl_left },
{ XCTRL('b'), backward_char },
@ -1926,12 +1928,14 @@ listbox_key (WListbox *l, int key)
switch (key){
case KEY_HOME:
case KEY_A1:
case ALT ('<'):
l->current = l->top = l->list;
l->pos = 0;
return 1;
case KEY_END:
case KEY_C1:
case ALT ('>'):
l->current = l->top = l->list->prev;
for (i = min (l->height - 1, l->count - 1); i; i--)
l->top = l->top->prev;

Просмотреть файл

@ -60,10 +60,12 @@ int check_movement_keys (int c, int additional, int page_size, void *data,
case KEY_HOME:
case KEY_A1:
case ALT ('<'):
(*topfn)(data, 0);
return 1;
case KEY_END:
case KEY_C1:
case ALT ('>'):
(*bottomfn)(data, 0);
return 1;
}