From 2f62fadabb43bdb184cef4992e5ad3ac6700c2c8 Mon Sep 17 00:00:00 2001 From: Andrew Borodin Date: Thu, 12 Aug 2010 12:58:55 +0400 Subject: [PATCH] Ticket #212: implemented keybindings for WListbox widget. Initial step: added description for A1 and C1 keys. A1 and C1 keybindings are applied to WTree, WInput and WPanel widgets. Signed-off-by: Andrew Borodin --- lib/tty/key.c | 2 ++ misc/mc.keymap.default | 12 ++++++------ misc/mc.keymap.emacs | 12 ++++++------ src/keybind.c | 9 ++++++--- 4 files changed, 20 insertions(+), 15 deletions(-) diff --git a/lib/tty/key.c b/lib/tty/key.c index 4fb1e0618..b27cbd981 100644 --- a/lib/tty/key.c +++ b/lib/tty/key.c @@ -153,6 +153,8 @@ const key_code_name_t key_name_conv_tab[] = { { KEY_F (22), "f22", N_("Function key 22"), "F22" }, { KEY_F (23), "f23", N_("Function key 23"), "F23" }, { KEY_F (24), "f24", N_("Function key 24"), "F24" }, + { KEY_A1, "a1", N_("A1 key"), "A1" }, + { KEY_C1, "c1", N_("C1 key"), "C1" }, /* Alternative label */ { ESC_CHAR, "esc", N_("Escape key"), "Esc" }, diff --git a/misc/mc.keymap.default b/misc/mc.keymap.default index cf066c5f1..374c3d285 100644 --- a/misc/mc.keymap.default +++ b/misc/mc.keymap.default @@ -293,8 +293,8 @@ PanelGotoMiddleFile = alt-r PanelSyncOtherPanel = alt-i PanelGotoTopFile = alt-g PanelSetPanelEncoding = alt-e -PanelMoveHome = alt-lt; home -PanelMoveEnd = alt-gt; end +PanelMoveHome = alt-lt; home; a1 +PanelMoveEnd = alt-gt; end; c1 PanelSelectSortOrder= PanelToggleSortOrderPrev= PanelToggleSortOrderNext= @@ -305,8 +305,8 @@ PanelSortOrderBySize= PanelSortOrderByMTime= [input] -InputBol = ctrl-a; alt-lt; home -InputEol = ctrl-e; alt-gt; end +InputBol = ctrl-a; alt-lt; home; a1 +InputEol = ctrl-e; alt-gt; end; c1 InputMoveLeft = left; alt-left InputWordLeft = ctrl-left InputBackwardChar = ctrl-b @@ -347,8 +347,8 @@ TreeMoveUp = up; ctrl-p TreeMoveDown = down; ctrl-n TreeMoveLeft = left TreeMoveRight = right -TreeMoveHome = home; alt-lt -TreeMoveEnd = end; alt-gt +TreeMoveHome = home; alt-lt; a1 +TreeMoveEnd = end; alt-gt; c1 TreeMovePgUp = pgup; alt-v TreeMovePgDn = pgdn; ctrl-v TreeOpen = enter diff --git a/misc/mc.keymap.emacs b/misc/mc.keymap.emacs index cee072cd0..b84dee8b1 100644 --- a/misc/mc.keymap.emacs +++ b/misc/mc.keymap.emacs @@ -297,8 +297,8 @@ PanelGotoMiddleFile = alt-r PanelSyncOtherPanel = alt-i PanelGotoTopFile = alt-g PanelSetPanelEncoding = alt-e -PanelMoveHome = alt-lt; home -PanelMoveEnd = alt-gt; end +PanelMoveHome = alt-lt; home; a1 +PanelMoveEnd = alt-gt; end; c1 PanelSelectSortOrder= PanelToggleSortOrderPrev= PanelToggleSortOrderNext= @@ -309,8 +309,8 @@ PanelSortOrderBySize= PanelSortOrderByMTime= [input] -InputBol = ctrl-a; alt-lt; home -InputEol = ctrl-e; alt-gt; end +InputBol = ctrl-a; alt-lt; home; a1 +InputEol = ctrl-e; alt-gt; end; c1 InputMoveLeft = left; alt-left InputWordLeft = ctrl-left InputBackwardChar = ctrl-b @@ -351,8 +351,8 @@ TreeMoveUp = up; ctrl-p TreeMoveDown = down; ctrl-n TreeMoveLeft = left TreeMoveRight = right -TreeMoveHome = home; alt-lt -TreeMoveEnd = end; alt-gt +TreeMoveHome = home; alt-lt; a1 +TreeMoveEnd = end; alt-gt; c1 TreeMovePgUp = pgup; alt-v TreeMovePgDn = pgdn; ctrl-v TreeOpen = enter diff --git a/src/keybind.c b/src/keybind.c index 25c0b9fee..e6bfb001c 100644 --- a/src/keybind.c +++ b/src/keybind.c @@ -832,8 +832,10 @@ const global_keymap_t default_tree_keymap[] = { { KEY_RIGHT, CK_TreeMoveRight, "Right" }, { KEY_HOME, CK_TreeMoveHome, "Home" }, { ALT ('<'), CK_TreeMoveHome, "M-<" }, + { KEY_A1, CK_TreeMoveHome, "A1" }, { KEY_END, CK_TreeMoveEnd , "End" }, { ALT ('>'), CK_TreeMoveEnd , "M->" }, + { KEY_C1, CK_TreeMoveEnd , "C1" }, { KEY_PPAGE, CK_TreeMovePgUp, "PgUp" }, { ALT ('v'), CK_TreeMovePgUp, "M-v" }, { KEY_NPAGE, CK_TreeMovePgDn, "PnDn" }, @@ -897,8 +899,9 @@ const global_keymap_t default_panel_keymap[] = { { KEY_LEFT, CK_PanelMoveLeft, "Left" }, { KEY_RIGHT, CK_PanelMoveRight, "Right" }, { KEY_END, CK_PanelMoveEnd, "End" }, + { KEY_C1, CK_PanelMoveEnd, "C1" }, { KEY_HOME, CK_PanelMoveHome, "Home" }, - { KEY_A1, CK_PanelMoveHome, "Home" }, + { KEY_A1, CK_PanelMoveHome, "A1" }, { KEY_NPAGE, CK_PanelNextPage, "PgDn" }, { KEY_PPAGE, CK_PanelPrevPage, "PgUp" }, { ALT ('e'), CK_PanelSetPanelEncoding, "M-e" }, @@ -991,12 +994,12 @@ const global_keymap_t default_input_keymap[] = { /* Motion */ { XCTRL ('a'), CK_InputBol, "C-a" }, { KEY_HOME, CK_InputBol, "Home" }, - { KEY_A1, CK_InputBol, "Home" }, + { KEY_A1, CK_InputBol, "A1" }, { ALT ('<'), CK_InputBol, "M-<" }, { XCTRL ('e'), CK_InputEol, "C-e" }, { KEY_END, CK_InputEol, "End" }, - { KEY_C1, CK_InputEol, "End" }, { ALT ('>'), CK_InputEol, "M->" }, + { KEY_C1, CK_InputEol, "C1" }, { KEY_LEFT, CK_InputMoveLeft, "Left" }, { KEY_M_CTRL | KEY_LEFT, CK_InputWordLeft, "C-Left" }, { KEY_RIGHT, CK_InputMoveRight, "Right" },