From a4e36d079df68157dff4acfdfe03908f6da8c83f Mon Sep 17 00:00:00 2001 From: Andrew Borodin Date: Sun, 14 Jul 2019 11:16:41 +0300 Subject: [PATCH] WListbox: add Edit, View and Enter keynindings. Signed-off-by: Andrew Borodin --- lib/widget/listbox.c | 7 ++++++- misc/mc.default.keymap | 3 +++ misc/mc.emacs.keymap | 3 +++ src/keybind-defaults.c | 3 +++ 4 files changed, 15 insertions(+), 1 deletion(-) diff --git a/lib/widget/listbox.c b/lib/widget/listbox.c index f1423a9d5..baef8bae5 100644 --- a/lib/widget/listbox.c +++ b/lib/widget/listbox.c @@ -325,6 +325,11 @@ listbox_execute_cmd (WListbox * l, long command) D_ERROR, 2, _("&Yes"), _("&No")) == 0)) listbox_remove_list (l); break; + case CK_View: + case CK_Edit: + case CK_Enter: + ret = send_message (WIDGET (l)->owner, l, MSG_NOTIFY, command, NULL); + break; default: ret = MSG_NOT_HANDLED; } @@ -398,7 +403,7 @@ static void listbox_on_change (WListbox * l) { listbox_draw (l, TRUE); - send_message (WIDGET (l)->owner, l, MSG_NOTIFY, l->pos, NULL); + send_message (WIDGET (l)->owner, l, MSG_NOTIFY, 0, NULL); } /* --------------------------------------------------------------------------------------------- */ diff --git a/misc/mc.default.keymap b/misc/mc.default.keymap index ee1d3819e..20ae2abb9 100644 --- a/misc/mc.default.keymap +++ b/misc/mc.default.keymap @@ -194,6 +194,9 @@ PageUp = pgup; alt-v PageDown = pgdn; ctrl-v Delete = delete; d Clear = shift-delete; shift-d +View = f3 +Edit = f4 +Enter = enter [tree] Help = f1 diff --git a/misc/mc.emacs.keymap b/misc/mc.emacs.keymap index feccba84c..4d99cbaa4 100644 --- a/misc/mc.emacs.keymap +++ b/misc/mc.emacs.keymap @@ -194,6 +194,9 @@ PageUp = pgup; alt-v PageDown = pgdn; ctrl-v Delete = delete; d Clear = shift-delete; shift-d +View = f3 +Edit = f4 +Enter = enter [tree] Help = f1 diff --git a/src/keybind-defaults.c b/src/keybind-defaults.c index 11eb1c622..f12e9b414 100644 --- a/src/keybind-defaults.c +++ b/src/keybind-defaults.c @@ -287,6 +287,9 @@ static const global_keymap_ini_t default_listbox_keymap[] = { {"PageDown", "pgdn; ctrl-v"}, {"Delete", "delete; d"}, {"Clear", "shift-delete; shift-d"}, + {"View", "f3"}, + {"Edit", "f4"}, + {"Enter", "enter"}, {NULL, NULL} };