Ticket #3672: allow rebind TAB key to change panel.

Signed-off-by: Andrew Borodin <aborodin@vmail.ru>
This commit is contained in:
Andrew Borodin 2016-09-14 13:56:24 +03:00
parent 8a50e158c3
commit ef5f1fa3eb
6 changed files with 10 additions and 3 deletions

View File

@ -48,6 +48,7 @@ static name_keymap_t command_names[] = {
/* common */
{"InsertChar", CK_InsertChar},
{"Enter", CK_Enter},
{"ChangePanel", CK_ChangePanel},
{"Up", CK_Up},
{"Down", CK_Down},
{"Left", CK_Left},

View File

@ -39,6 +39,7 @@ enum
/* common */
CK_Enter = 1L,
CK_ChangePanel,
CK_Up,
CK_Down,
CK_Left,

View File

@ -1,4 +1,5 @@
[main]
ChangePanel = tab
Help = f1
UserMenu = f2
View = f3

View File

@ -1,4 +1,5 @@
[main]
ChangePanel = tab
Help = f1
UserMenu = f2
View = f3

View File

@ -932,6 +932,8 @@ create_panels_and_run_mc (void)
{
midnight_dlg->get_shortcut = midnight_get_shortcut;
midnight_dlg->get_title = midnight_get_title;
/* allow rebind tab */
widget_want_tab (WIDGET (midnight_dlg), TRUE);
create_panels ();
@ -1104,6 +1106,9 @@ midnight_execute_cmd (Widget * sender, long command)
switch (command)
{
case CK_ChangePanel:
change_panel ();
break;
case CK_HotListAdd:
add2hotlist_cmd ();
break;
@ -1452,9 +1457,6 @@ midnight_callback (Widget * w, Widget * sender, widget_msg_t msg, int parm, void
if (widget_get_state (WIDGET (the_menubar), WST_FOCUSED))
return MSG_NOT_HANDLED;
if (parm == '\t')
input_free_completions (cmdline);
if (parm == '\n')
{
size_t i;

View File

@ -83,6 +83,7 @@ typedef struct global_keymap_ini_t
/* midnight */
static const global_keymap_ini_t default_main_keymap[] = {
{"ChangePanel", "tab"},
{"Help", "f1"},
{"UserMenu", "f2"},
{"View", "f3"},