Merge branch '3075_x_enter_bind'

* 3075_x_enter_bind:
  Ticket #3075: (midnight_callback): make alt-enter, ctrl-enter, ctrl-shift-enter bindable.
This commit is contained in:
Andrew Borodin 2016-08-04 10:28:23 +03:00
commit c47f112fb8
6 changed files with 18 additions and 16 deletions

View File

@ -205,6 +205,8 @@ static name_keymap_t command_names[] = {
{"SplitLess", CK_SplitLess}, {"SplitLess", CK_SplitLess},
{"PutCurrentPath", CK_PutCurrentPath}, {"PutCurrentPath", CK_PutCurrentPath},
{"PutOtherPath", CK_PutOtherPath}, {"PutOtherPath", CK_PutOtherPath},
{"PutCurrentSelected", CK_PutCurrentSelected},
{"PutCurrentFullSelected", CK_PutCurrentFullSelected},
{"PutCurrentTagged", CK_PutCurrentTagged}, {"PutCurrentTagged", CK_PutCurrentTagged},
{"PutOtherTagged", CK_PutOtherTagged}, {"PutOtherTagged", CK_PutOtherTagged},
{"Select", CK_Select}, {"Select", CK_Select},

View File

@ -178,6 +178,8 @@ enum
CK_LinkSymbolicRelative, CK_LinkSymbolicRelative,
CK_PutCurrentPath, CK_PutCurrentPath,
CK_PutOtherPath, CK_PutOtherPath,
CK_PutCurrentSelected,
CK_PutCurrentFullSelected,
CK_PutCurrentTagged, CK_PutCurrentTagged,
CK_PutOtherTagged, CK_PutOtherTagged,
CK_Select, CK_Select,

View File

@ -32,6 +32,8 @@ SplitLess = alt-shift-left
Shell = ctrl-o Shell = ctrl-o
PutCurrentPath = alt-a PutCurrentPath = alt-a
PutOtherPath = alt-shift-a PutOtherPath = alt-shift-a
PutCurrentSelected = alt-enter; ctrl-enter
PutCurrentFullSelected = ctrl-shift-enter
ViewFiltered = alt-exclamation ViewFiltered = alt-exclamation
Select = kpplus Select = kpplus
Unselect = kpminus Unselect = kpminus

View File

@ -32,6 +32,8 @@ SplitLess = alt-shift-left
Shell = ctrl-o Shell = ctrl-o
PutCurrentPath = alt-a PutCurrentPath = alt-a
PutOtherPath = alt-shift-a PutOtherPath = alt-shift-a
PutCurrentSelected = alt-enter; ctrl-enter
PutCurrentFullSelected = ctrl-shift-enter
ViewFiltered = alt-exclamation ViewFiltered = alt-exclamation
Select = kpplus Select = kpplus
Unselect = kpminus Unselect = kpminus

View File

@ -781,7 +781,7 @@ put_other_link (void)
/** Insert the selected file name into the input line */ /** Insert the selected file name into the input line */
static void static void
put_prog_name (void) put_current_selected (void)
{ {
const char *tmp; const char *tmp;
@ -1139,6 +1139,13 @@ midnight_execute_cmd (Widget * sender, long command)
case CK_PutCurrentPath: case CK_PutCurrentPath:
midnight_put_panel_path (current_panel); midnight_put_panel_path (current_panel);
break; break;
case CK_PutCurrentSelected:
put_current_selected ();
break;
case CK_PutCurrentFullSelected:
midnight_put_panel_path (current_panel);
put_current_selected ();
break;
case CK_PutCurrentLink: case CK_PutCurrentLink:
put_current_link (); put_current_link ();
break; break;
@ -1476,21 +1483,6 @@ midnight_callback (Widget * w, Widget * sender, widget_msg_t msg, int parm, void
cmdline->point = 0; cmdline->point = 0;
} }
/* Ctrl-Enter and Alt-Enter */
if (((parm & ~(KEY_M_CTRL | KEY_M_ALT)) == '\n') && (parm & (KEY_M_CTRL | KEY_M_ALT)))
{
put_prog_name ();
return MSG_HANDLED;
}
/* Ctrl-Shift-Enter */
if (parm == (KEY_M_CTRL | KEY_M_SHIFT | '\n'))
{
midnight_put_panel_path (current_panel);
put_prog_name ();
return MSG_HANDLED;
}
if ((!mc_global.tty.alternate_plus_minus if ((!mc_global.tty.alternate_plus_minus
|| !(mc_global.tty.console_flag != '\0' || mc_global.tty.xterm_flag)) && !quote || !(mc_global.tty.console_flag != '\0' || mc_global.tty.xterm_flag)) && !quote
&& !current_panel->searching) && !current_panel->searching)

View File

@ -100,6 +100,8 @@ static const global_keymap_ini_t default_main_keymap[] = {
/* Copy useful information to the command line */ /* Copy useful information to the command line */
{"PutCurrentPath", "alt-a"}, {"PutCurrentPath", "alt-a"},
{"PutOtherPath", "alt-shift-a"}, {"PutOtherPath", "alt-shift-a"},
{"PutCurrentSelected", "alt-enter; ctrl-enter"},
{"PutCurrentFullSelected", "ctrl-shift-enter"},
{"CdQuick", "alt-c"}, {"CdQuick", "alt-c"},
/* To access the directory hotlist */ /* To access the directory hotlist */
{"HotList", "ctrl-backslash"}, {"HotList", "ctrl-backslash"},