From 68a8745f6dd7ded9437317a694225d599745e983 Mon Sep 17 00:00:00 2001 From: Andrew Borodin Date: Fri, 21 Jan 2011 10:02:12 +0300 Subject: [PATCH 1/9] Ticket #2511: simplification and unification of keybinding names. Added doc/keybind-migration.txt file to describe new keybinding names used in mc.keymap.* files in 4.8.x series. Cosmetics: reordering of keymap section declarations to provide identical order totally in the source tree. Signed-off-by: Andrew Borodin --- doc/Makefile.am | 2 +- doc/keybind-migration.txt | 59 +++ lib/keybind.c | 527 +++++++++++----------- lib/keybind.h | 623 +++++++++++++------------- misc/mc.keymap.default | 465 ++++++++++---------- misc/mc.keymap.emacs | 470 ++++++++++---------- src/keybind-defaults.c | 893 +++++++++++++++++++------------------- src/keybind-defaults.h | 66 ++- src/setup.c | 70 +-- 9 files changed, 1587 insertions(+), 1588 deletions(-) create mode 100644 doc/keybind-migration.txt diff --git a/doc/Makefile.am b/doc/Makefile.am index 440786605..cc1d60238 100644 --- a/doc/Makefile.am +++ b/doc/Makefile.am @@ -1,7 +1,7 @@ DIST_SUBDIRS = hints man hlp SUBDIRS = hints man hlp -DOCS = FAQ HACKING INSTALL INSTALL.FAST MAINTAINERS README.QNX +DOCS = FAQ HACKING INSTALL INSTALL.FAST MAINTAINERS README.QNX keybind-migration.txt EXTRA_DIST = $(DX_CONFIG) doxygen-include.am $(DOCS) include doxygen-include.am diff --git a/doc/keybind-migration.txt b/doc/keybind-migration.txt new file mode 100644 index 000000000..6590ae412 --- /dev/null +++ b/doc/keybind-migration.txt @@ -0,0 +1,59 @@ + +This file describes how keybind names used in mc.keymap.* files +are changed in 4.8.* releases. + ++---------------------------------+-------------------------+-----------------------------------------+ +| Old name | New name | Notes | ++---------------------------------+-------------------------+-----------------------------------------+ +| [main] section | ++---------------------------------+-------------------------+-----------------------------------------+ +| | | | ++---------------------------------+-------------------------+-----------------------------------------+ +| [main:xmap] section | ++---------------------------------+-------------------------+-----------------------------------------+ +| | | | ++---------------------------------+-------------------------+-----------------------------------------+ +| [panel] section | ++---------------------------------+-------------------------+-----------------------------------------+ +| | | | ++---------------------------------+-------------------------+-----------------------------------------+ +| [dialog] section | ++---------------------------------+-------------------------+-----------------------------------------+ +| | | | ++---------------------------------+-------------------------+-----------------------------------------+ +| [input] section | ++---------------------------------+-------------------------+-----------------------------------------+ +| | | | ++---------------------------------+-------------------------+-----------------------------------------+ +| [listbox] section | ++---------------------------------+-------------------------+-----------------------------------------+ +| | | | ++---------------------------------+-------------------------+-----------------------------------------+ +| [tree] section | ++---------------------------------+-------------------------+-----------------------------------------+ +| | | | ++---------------------------------+-------------------------+-----------------------------------------+ +| [help] section | ++---------------------------------+-------------------------+-----------------------------------------+ +| | | | ++---------------------------------+-------------------------+-----------------------------------------+ +| [editor] section | ++---------------------------------+-------------------------+-----------------------------------------+ +| | | | ++---------------------------------+-------------------------+-----------------------------------------+ +| [editor:xmap] section | ++---------------------------------+-------------------------+-----------------------------------------+ +| | | | ++---------------------------------+-------------------------+-----------------------------------------+ +| [viewer] section | ++---------------------------------+-------------------------+-----------------------------------------+ +| | | | ++---------------------------------+-------------------------+-----------------------------------------+ +| [viewer:hex] section | ++---------------------------------+-------------------------+-----------------------------------------+ +| | | | ++---------------------------------+-------------------------+-----------------------------------------+ +| [diffviewer] section | ++---------------------------------+-------------------------+-----------------------------------------+ +| | | | ++---------------------------------+-------------------------+-----------------------------------------+ diff --git a/lib/keybind.c b/lib/keybind.c index a4f409395..8946276dc 100644 --- a/lib/keybind.c +++ b/lib/keybind.c @@ -3,6 +3,7 @@ Written by: 2005 Vitja Makarov 2009 Ilia Maslakov + 2009, 2010 Andrew Borodin This file is part of the Midnight Commander. @@ -43,258 +44,11 @@ /*** file scope variables ************************************************************************/ static name_keymap_t command_names[] = { - {"InsertChar", CK_Insert_Char}, -#ifdef USE_INTERNAL_EDIT - {"EditNoCommand", CK_Ignore_Key}, - {"EditIgnoreKey", CK_Ignore_Key}, - {"EditBackSpace", CK_BackSpace}, - {"EditDelete", CK_Delete}, - {"EditEnter", CK_Enter}, - {"EditPageUp", CK_Page_Up}, - {"EditPageDown", CK_Page_Down}, - {"EditLeft", CK_Left}, - {"EditRight", CK_Right}, - {"EditWordLeft", CK_Word_Left}, - {"EditWordRight", CK_Word_Right}, - {"EditUp", CK_Up}, - {"EditDown", CK_Down}, - {"EditHome", CK_Home}, - {"EditEnd", CK_End}, - {"EditTab", CK_Tab}, - {"EditUndo", CK_Undo}, - {"EditRedo", CK_Redo}, - {"EditBeginningOfText", CK_Beginning_Of_Text}, - {"EditEndOfText", CK_End_Of_Text}, - {"EditScrollUp", CK_Scroll_Up}, - {"EditScrollDown", CK_Scroll_Down}, - {"EditReturn", CK_Return}, - {"EditBeginPage", CK_Begin_Page}, - {"EditEndPage", CK_End_Page}, - {"EditDeleteWordLeft", CK_Delete_Word_Left}, - {"EditDeleteWordRight", CK_Delete_Word_Right}, - {"EditParagraphUp", CK_Paragraph_Up}, - {"EditParagraphDown", CK_Paragraph_Down}, - {"EditMenu", CK_Menu}, - {"EditSave", CK_Save}, - {"EditLoad", CK_Load}, - {"EditNew", CK_New}, - {"EditSaveas", CK_Save_As}, - {"EditMark", CK_Mark}, - {"EditCopy", CK_Copy}, - {"EditMove", CK_Move}, - {"EditRemove", CK_Remove}, - {"EditMarkAll", CK_Mark_All}, - {"EditUnmark", CK_Unmark}, - {"EditMarkWord", CK_Mark_Word}, - {"EditMarkLine", CK_Mark_Line}, - {"EditSaveBlock", CK_Save_Block}, - {"EditColumnMark", CK_Column_Mark}, - {"EditFind", CK_Find}, - {"EditFindAgain", CK_Find_Again}, - {"EditReplace", CK_Replace}, - {"EditReplaceAgain", CK_Replace_Again}, - {"EditCompleteWord", CK_Complete_Word}, - -#if 0 - {"EditDebugStart", CK_Debug_Start}, - {"EditDebugStop", CK_Debug_Stop}, - {"EditDebugToggleBreak", CK_Debug_Toggle_Break}, - {"EditDebugClear", CK_Debug_Clear}, - {"EditDebugNext", CK_Debug_Next}, - {"EditDebugStep", CK_Debug_Step}, - {"EditDebugBackTrace", CK_Debug_Back_Trace}, - {"EditDebugContinue", CK_Debug_Continue}, - {"EditDebugEnterCommand", CK_Debug_Enter_Command}, - {"EditDebugUntilCurser", CK_Debug_Until_Curser}, -#endif - {"EditInsertFile", CK_Insert_File}, - {"EditQuit", CK_Quit}, - {"EditToggleInsert", CK_Toggle_Insert}, - {"EditHelp", CK_Help}, - {"EditDate", CK_Date}, - {"EditRefresh", CK_Refresh}, - {"EditGoto", CK_Goto}, - {"EditDeleteLine", CK_Delete_Line}, - {"EditDeleteToLineEnd", CK_Delete_To_Line_End}, - {"EditDeleteToLineBegin", CK_Delete_To_Line_Begin}, - {"EditManPage", CK_Man_Page}, - {"EditSort", CK_Sort}, - {"EditMail", CK_Mail}, - {"EditCancel", CK_Cancel}, - {"EditComplete", CK_Complete}, - {"EditParagraphFormat", CK_Paragraph_Format}, - {"EditUtil", CK_Util}, - {"EditTypeLoadPython", CK_Type_Load_Python}, - {"EditFindFile", CK_Find_File}, - {"EditCtags", CK_Ctags}, - {"EditMatchBracket", CK_Match_Bracket}, - {"EditTerminal", CK_Terminal}, - {"EditTerminalApp", CK_Terminal_App}, - {"EditExtCmd", CK_ExtCmd}, - {"EditUserMenu", CK_User_Menu}, - {"EditBeginRecordMacro", CK_Begin_Record_Macro}, - {"EditEndRecordMacro", CK_End_Record_Macro}, - {"EditBeginEndRepeat", CK_Begin_End_Repeat}, - {"EditDeleteMacro", CK_Delete_Macro}, - {"EditToggleBookmark", CK_Toggle_Bookmark}, - {"EditFlushBookmarks", CK_Flush_Bookmarks}, - {"EditNextBookmark", CK_Next_Bookmark}, - {"EditPrevBookmark", CK_Prev_Bookmark}, - {"EditPageUpHighlight", CK_Page_Up_Highlight}, - {"EditPageDownHighlight", CK_Page_Down_Highlight}, - {"EditLeftHighlight", CK_Left_Highlight}, - {"EditRightHighlight", CK_Right_Highlight}, - {"EditWordLeftHighlight", CK_Word_Left_Highlight}, - {"EditWordRightHighlight", CK_Word_Right_Highlight}, - {"EditUpHighlight", CK_Up_Highlight}, - {"EditDownHighlight", CK_Down_Highlight}, - {"EditHomeHighlight", CK_Home_Highlight}, - {"EditEndHighlight", CK_End_Highlight}, - {"EditBeginningOfTextHighlight", CK_Beginning_Of_Text_Highlight}, - {"EditEndOfTextHighlight", CK_End_Of_Text_Highlight}, - {"EditBeginPageHighlight", CK_Begin_Page_Highlight}, - {"EditEndPageHighlight", CK_End_Page_Highlight}, - {"EditScrollUpHighlight", CK_Scroll_Up_Highlight}, - {"EditScrollDownHighlight", CK_Scroll_Down_Highlight}, - {"EditParagraphUpHighlight", CK_Paragraph_Up_Highlight}, - {"EditParagraphDownHighlight", CK_Paragraph_Down_Highlight}, - - {"EditPageUpAltHighlight", CK_Page_Up_Alt_Highlight}, - {"EditPageDownAltHighlight", CK_Page_Down_Alt_Highlight}, - {"EditLeftAltHighlight", CK_Left_Alt_Highlight}, - {"EditRightAltHighlight", CK_Right_Alt_Highlight}, - {"EditWordLeftAltHighlight", CK_Word_Left_Alt_Highlight}, - {"EditWordRightAltHighlight", CK_Word_Right_Alt_Highlight}, - {"EditUpAltHighlight", CK_Up_Alt_Highlight}, - {"EditDownAltHighlight", CK_Down_Alt_Highlight}, - {"EditHomeAltHighlight", CK_Home_Alt_Highlight}, - {"EditEndAltHighlight", CK_End_Alt_Highlight}, - {"EditBeginningOfTextAltHighlight", CK_Beginning_Of_Text_Alt_Highlight}, - {"EditEndOfTextAltHighlight", CK_End_Of_Text_Alt_Highlight}, - {"EditBeginPageAltHighlight", CK_Begin_Page_Alt_Highlight}, - {"EditEndPageAltHighlight", CK_End_Page_Alt_Highlight}, - {"EditScrollUpAltHighlight", CK_Scroll_Up_Alt_Highlight}, - {"EditScrollDownAltHighlight", CK_Scroll_Down_Alt_Highlight}, - {"EditParagraphUpAltHighlight", CK_Paragraph_Up_Alt_Highlight}, - {"EditParagraphDownAltHighlight", CK_Paragraph_Down_Alt_Highlight}, - - {"EditShiftBlockLeft", CK_Shift_Block_Left}, - {"EditShiftBlockRight", CK_Shift_Block_Right}, - - {"EditXStore", CK_XStore}, - {"EditXCut", CK_XCut}, - {"EditXPaste", CK_XPaste}, - {"EditSelectionHistory", CK_Selection_History}, - {"EditShell", CK_Shell}, - {"EditInsertLiteral", CK_Insert_Literal}, - {"EditBeginOrEndMacro", CK_Begin_End_Macro}, - {"EditExtMode", CK_Ext_Mode}, - {"EditToggleLineState", CK_Toggle_Line_State}, - {"EditToggleTabTWS", CK_Toggle_Tab_TWS}, - {"EditToggleSyntax", CK_Toggle_Syntax}, - {"EditToggleShowMargin", CK_Toggle_Show_Margin}, - {"EditFindDefinition", CK_Find_Definition}, - {"EditLoadPrevFile", CK_Load_Prev_File}, - {"EditLoadNextFile", CK_Load_Next_File}, - {"EditOptions", CK_Edit_Options}, - {"EditSaveMode", CK_Edit_Save_Mode}, - {"EditChooseSyntax", CK_Choose_Syntax}, - {"EditAbout", CK_About}, - {"EditPipeBlock", CK_Pipe_Block (0)}, - -#if 0 - {"EditFocusNext", CK_Focus_Next}, - {"EditFocusPrev", CK_Focus_Prev}, - {"EditHeightInc", CK_Height_Inc}, - {"EditHeightDec", CK_Height_Dec}, - {"EditMake", CK_Make}, - {"EditErrorNext", CK_Error_Next}, - {"EditErrorPrev", CK_Error_Prev}, -#endif - -#if 0 - {"EditSaveDesktop", CK_Save_Desktop}, - {"EditNewWindow", CK_New_Window}, - {"EditCycle", CK_Cycle}, - {"EditSaveAndQuit", CK_Save_And_Quit}, - {"EditRunAnother", CK_Run_Another}, - {"EditCheckSaveAndQuit", CK_Check_Save_And_Quit}, - {"EditMaximize", CK_Maximize}, -#endif - -#endif /* USE_INTERNAL_EDIT */ - - /* viewer */ - {"ViewHelp", CK_ViewHelp}, - {"ViewToggleWrapMode", CK_ViewToggleWrapMode}, - {"ViewToggleHexEditMode", CK_ViewToggleHexEditMode}, - {"ViewQuit", CK_ViewQuit}, - {"ViewToggleHexMode", CK_ViewToggleHexMode}, - {"ViewGoto", CK_ViewGoto}, - {"ViewHexEditSave", CK_ViewHexEditSave}, - {"ViewSearch", CK_ViewSearch}, - {"ViewToggleMagicMode", CK_ViewToggleMagicMode}, - {"ViewToggleNroffMode", CK_ViewToggleNroffMode}, - {"ViewContinueSearch", CK_ViewContinueSearch}, - {"ViewGotoBookmark", CK_ViewGotoBookmark}, - {"ViewNewBookmark", CK_ViewNewBookmark}, - {"ViewMoveUp", CK_ViewMoveUp}, - {"ViewMoveDown", CK_ViewMoveDown}, - {"ViewMoveLeft", CK_ViewMoveLeft}, - {"ViewMoveRight", CK_ViewMoveRight}, - {"ViewMoveLeft10", CK_ViewMoveLeft10}, - {"ViewMoveRight10", CK_ViewMoveRight10}, - {"ViewMovePgDn", CK_ViewMovePgDn}, - {"ViewMovePgUp", CK_ViewMovePgUp}, - {"ViewMoveHalfPgDn", CK_ViewMoveHalfPgDn}, - {"ViewMoveHalfPgUp", CK_ViewMoveHalfPgUp}, - {"ViewMoveToBol", CK_ViewMoveToBol}, - {"ViewMoveToEol", CK_ViewMoveToEol}, - {"ViewMoveTop", CK_ViewMoveTop}, - {"ViewMoveBottom", CK_ViewMoveBottom}, - {"ViewNextFile", CK_ViewNextFile}, - {"ViewPrevFile", CK_ViewPrevFile}, - {"ViewToggleRuler", CK_ViewToggleRuler}, - {"ViewToggleHexNavMode", CK_ViewToggleHexNavMode}, - - /* help */ - {"HelpHelp", CK_HelpHelp}, - {"HelpIndex", CK_HelpIndex}, - {"HelpBack", CK_HelpBack}, - {"HelpQuit", CK_HelpQuit}, - {"HelpMoveUp", CK_HelpMoveUp}, - {"HelpMoveDown", CK_HelpMoveDown}, - {"HelpMovePgDn", CK_HelpMovePgDn}, - {"HelpMovePgUp", CK_HelpMovePgUp}, - {"HelpMoveHalfPgDn", CK_HelpMoveHalfPgDn}, - {"HelpMoveHalfPgUp", CK_HelpMoveHalfPgUp}, - {"HelpMoveTop", CK_HelpMoveTop}, - {"HelpMoveBottom", CK_HelpMoveBottom}, - {"HelpSelectLink", CK_HelpSelectLink}, - {"HelpNextLink", CK_HelpNextLink}, - {"HelpPrevLink", CK_HelpPrevLink}, - {"HelpNextNode", CK_HelpNextNode}, - {"HelpPrevNode", CK_HelpPrevNode}, - - /* tree */ - {"TreeHelp", CK_TreeHelp}, - {"TreeForget", CK_TreeForget}, - {"TreeToggleNav", CK_TreeToggleNav}, - {"TreeCopy", CK_TreeCopy}, - {"TreeMove", CK_TreeMove}, - {"TreeMake", CK_TreeMake}, - {"TreeMoveUp", CK_TreeMoveUp}, - {"TreeMoveDown", CK_TreeMoveDown}, - {"TreeMoveLeft", CK_TreeMoveLeft}, - {"TreeMoveRight", CK_TreeMoveRight}, - {"TreeMoveHome", CK_TreeMoveHome}, - {"TreeMoveEnd", CK_TreeMoveEnd}, - {"TreeMovePgUp", CK_TreeMovePgUp}, - {"TreeMovePgDn", CK_TreeMovePgDn}, - {"TreeOpen", CK_TreeOpen}, - {"TreeRescan", CK_TreeRescan}, - {"TreeStartSearch", CK_TreeStartSearch}, - {"TreeRemove", CK_TreeRemove}, + /* common */ + {"SelectCodepage", CK_SelectCodepage}, + {"ShowCommandLine", CK_ShowCommandLine}, + {"ExtMap1", CK_StartExtMap1}, + {"ExtMap2", CK_StartExtMap2}, /* main commands */ {"CmdHelp", CK_HelpCmd}, @@ -438,6 +192,15 @@ static name_keymap_t command_names[] = { {"PanelSortOrderByMTime", CK_PanelSortOrderByMTime}, {"PanelSmartGotoParentDir", CK_PanelSmartGotoParentDir}, + /* dialog */ + {"DialogOK", CK_DialogOK}, + {"DialogCancel", CK_DialogCancel}, + {"DialogPrevItem", CK_DialogPrevItem}, + {"DialogNextItem", CK_DialogNextItem}, + {"DialogHelp", CK_DialogHelp}, + {"DialogSuspend", CK_DialogSuspend}, + {"DialogRefresh", CK_DialogRefresh}, + /* input line */ {"InputBol", CK_InputBol}, {"InputEol", CK_InputEol}, @@ -481,22 +244,249 @@ static name_keymap_t command_names[] = { {"ListboxDeleteItem", CK_ListboxDeleteItem}, {"ListboxDeleteAll", CK_ListboxDeleteAll}, - /* common */ - {"ExtMap1", CK_StartExtMap1}, - {"ExtMap2", CK_StartExtMap2}, - {"ShowCommandLine", CK_ShowCommandLine}, - {"SelectCodepage", CK_SelectCodepage}, + /* help */ + {"HelpHelp", CK_HelpHelp}, + {"HelpIndex", CK_HelpIndex}, + {"HelpBack", CK_HelpBack}, + {"HelpQuit", CK_HelpQuit}, + {"HelpMoveUp", CK_HelpMoveUp}, + {"HelpMoveDown", CK_HelpMoveDown}, + {"HelpMovePgDn", CK_HelpMovePgDn}, + {"HelpMovePgUp", CK_HelpMovePgUp}, + {"HelpMoveHalfPgDn", CK_HelpMoveHalfPgDn}, + {"HelpMoveHalfPgUp", CK_HelpMoveHalfPgUp}, + {"HelpMoveTop", CK_HelpMoveTop}, + {"HelpMoveBottom", CK_HelpMoveBottom}, + {"HelpSelectLink", CK_HelpSelectLink}, + {"HelpNextLink", CK_HelpNextLink}, + {"HelpPrevLink", CK_HelpPrevLink}, + {"HelpNextNode", CK_HelpNextNode}, + {"HelpPrevNode", CK_HelpPrevNode}, - /* dialog */ - {"DialogOK", CK_DialogOK}, - {"DialogCancel", CK_DialogCancel}, - {"DialogPrevItem", CK_DialogPrevItem}, - {"DialogNextItem", CK_DialogNextItem}, - {"DialogHelp", CK_DialogHelp}, - {"DialogSuspend", CK_DialogSuspend}, - {"DialogRefresh", CK_DialogRefresh}, + /* tree */ + {"TreeHelp", CK_TreeHelp}, + {"TreeForget", CK_TreeForget}, + {"TreeToggleNav", CK_TreeToggleNav}, + {"TreeCopy", CK_TreeCopy}, + {"TreeMove", CK_TreeMove}, + {"TreeMake", CK_TreeMake}, + {"TreeMoveUp", CK_TreeMoveUp}, + {"TreeMoveDown", CK_TreeMoveDown}, + {"TreeMoveLeft", CK_TreeMoveLeft}, + {"TreeMoveRight", CK_TreeMoveRight}, + {"TreeMoveHome", CK_TreeMoveHome}, + {"TreeMoveEnd", CK_TreeMoveEnd}, + {"TreeMovePgUp", CK_TreeMovePgUp}, + {"TreeMovePgDn", CK_TreeMovePgDn}, + {"TreeOpen", CK_TreeOpen}, + {"TreeRescan", CK_TreeRescan}, + {"TreeStartSearch", CK_TreeStartSearch}, + {"TreeRemove", CK_TreeRemove}, -#ifdef USE_DIFF_VIEW +#ifdef USE_INTERNAL_EDIT + {"EditNoCommand", CK_Ignore_Key}, + {"EditIgnoreKey", CK_Ignore_Key}, + {"EditBackSpace", CK_BackSpace}, + {"EditDelete", CK_Delete}, + {"EditEnter", CK_Enter}, + {"EditPageUp", CK_Page_Up}, + {"EditPageDown", CK_Page_Down}, + {"EditLeft", CK_Left}, + {"EditRight", CK_Right}, + {"EditWordLeft", CK_Word_Left}, + {"EditWordRight", CK_Word_Right}, + {"EditUp", CK_Up}, + {"EditDown", CK_Down}, + {"EditHome", CK_Home}, + {"EditEnd", CK_End}, + {"EditTab", CK_Tab}, + {"EditUndo", CK_Undo}, + {"EditRedo", CK_Redo}, + {"EditBeginningOfText", CK_Beginning_Of_Text}, + {"EditEndOfText", CK_End_Of_Text}, + {"EditScrollUp", CK_Scroll_Up}, + {"EditScrollDown", CK_Scroll_Down}, + {"EditReturn", CK_Return}, + {"EditBeginPage", CK_Begin_Page}, + {"EditEndPage", CK_End_Page}, + {"EditDeleteWordLeft", CK_Delete_Word_Left}, + {"EditDeleteWordRight", CK_Delete_Word_Right}, + {"EditParagraphUp", CK_Paragraph_Up}, + {"EditParagraphDown", CK_Paragraph_Down}, + {"EditMenu", CK_Menu}, + {"EditSave", CK_Save}, + {"EditLoad", CK_Load}, + {"EditNew", CK_New}, + {"EditSaveas", CK_Save_As}, + {"EditMark", CK_Mark}, + {"EditCopy", CK_Copy}, + {"EditMove", CK_Move}, + {"EditRemove", CK_Remove}, + {"EditMarkAll", CK_Mark_All}, + {"EditUnmark", CK_Unmark}, + {"EditMarkWord", CK_Mark_Word}, + {"EditMarkLine", CK_Mark_Line}, + {"EditSaveBlock", CK_Save_Block}, + {"EditColumnMark", CK_Column_Mark}, + {"EditFind", CK_Find}, + {"EditFindAgain", CK_Find_Again}, + {"EditReplace", CK_Replace}, + {"EditReplaceAgain", CK_Replace_Again}, + {"EditCompleteWord", CK_Complete_Word}, +#if 0 + {"EditDebugStart", CK_Debug_Start}, + {"EditDebugStop", CK_Debug_Stop}, + {"EditDebugToggleBreak", CK_Debug_Toggle_Break}, + {"EditDebugClear", CK_Debug_Clear}, + {"EditDebugNext", CK_Debug_Next}, + {"EditDebugStep", CK_Debug_Step}, + {"EditDebugBackTrace", CK_Debug_Back_Trace}, + {"EditDebugContinue", CK_Debug_Continue}, + {"EditDebugEnterCommand", CK_Debug_Enter_Command}, + {"EditDebugUntilCurser", CK_Debug_Until_Curser}, +#endif + {"EditInsertFile", CK_Insert_File}, + {"EditQuit", CK_Quit}, + {"EditToggleInsert", CK_Toggle_Insert}, + {"EditHelp", CK_Help}, + {"EditDate", CK_Date}, + {"EditRefresh", CK_Refresh}, + {"EditGoto", CK_Goto}, + {"EditDeleteLine", CK_Delete_Line}, + {"EditDeleteToLineEnd", CK_Delete_To_Line_End}, + {"EditDeleteToLineBegin", CK_Delete_To_Line_Begin}, + {"EditManPage", CK_Man_Page}, + {"EditSort", CK_Sort}, + {"EditMail", CK_Mail}, + {"EditCancel", CK_Cancel}, + {"EditComplete", CK_Complete}, + {"EditParagraphFormat", CK_Paragraph_Format}, + {"EditUtil", CK_Util}, + {"EditTypeLoadPython", CK_Type_Load_Python}, + {"EditFindFile", CK_Find_File}, + {"EditCtags", CK_Ctags}, + {"EditMatchBracket", CK_Match_Bracket}, + {"EditTerminal", CK_Terminal}, + {"EditTerminalApp", CK_Terminal_App}, + {"EditExtCmd", CK_ExtCmd}, + {"EditUserMenu", CK_User_Menu}, + {"EditBeginRecordMacro", CK_Begin_Record_Macro}, + {"EditEndRecordMacro", CK_End_Record_Macro}, + {"EditBeginEndRepeat", CK_Begin_End_Repeat}, + {"EditDeleteMacro", CK_Delete_Macro}, + {"EditToggleBookmark", CK_Toggle_Bookmark}, + {"EditFlushBookmarks", CK_Flush_Bookmarks}, + {"EditNextBookmark", CK_Next_Bookmark}, + {"EditPrevBookmark", CK_Prev_Bookmark}, + {"EditPageUpHighlight", CK_Page_Up_Highlight}, + {"EditPageDownHighlight", CK_Page_Down_Highlight}, + {"EditLeftHighlight", CK_Left_Highlight}, + {"EditRightHighlight", CK_Right_Highlight}, + {"EditWordLeftHighlight", CK_Word_Left_Highlight}, + {"EditWordRightHighlight", CK_Word_Right_Highlight}, + {"EditUpHighlight", CK_Up_Highlight}, + {"EditDownHighlight", CK_Down_Highlight}, + {"EditHomeHighlight", CK_Home_Highlight}, + {"EditEndHighlight", CK_End_Highlight}, + {"EditBeginningOfTextHighlight", CK_Beginning_Of_Text_Highlight}, + {"EditEndOfTextHighlight", CK_End_Of_Text_Highlight}, + {"EditBeginPageHighlight", CK_Begin_Page_Highlight}, + {"EditEndPageHighlight", CK_End_Page_Highlight}, + {"EditScrollUpHighlight", CK_Scroll_Up_Highlight}, + {"EditScrollDownHighlight", CK_Scroll_Down_Highlight}, + {"EditParagraphUpHighlight", CK_Paragraph_Up_Highlight}, + {"EditParagraphDownHighlight", CK_Paragraph_Down_Highlight}, + {"EditPageUpAltHighlight", CK_Page_Up_Alt_Highlight}, + {"EditPageDownAltHighlight", CK_Page_Down_Alt_Highlight}, + {"EditLeftAltHighlight", CK_Left_Alt_Highlight}, + {"EditRightAltHighlight", CK_Right_Alt_Highlight}, + {"EditWordLeftAltHighlight", CK_Word_Left_Alt_Highlight}, + {"EditWordRightAltHighlight", CK_Word_Right_Alt_Highlight}, + {"EditUpAltHighlight", CK_Up_Alt_Highlight}, + {"EditDownAltHighlight", CK_Down_Alt_Highlight}, + {"EditHomeAltHighlight", CK_Home_Alt_Highlight}, + {"EditEndAltHighlight", CK_End_Alt_Highlight}, + {"EditBeginningOfTextAltHighlight", CK_Beginning_Of_Text_Alt_Highlight}, + {"EditEndOfTextAltHighlight", CK_End_Of_Text_Alt_Highlight}, + {"EditBeginPageAltHighlight", CK_Begin_Page_Alt_Highlight}, + {"EditEndPageAltHighlight", CK_End_Page_Alt_Highlight}, + {"EditScrollUpAltHighlight", CK_Scroll_Up_Alt_Highlight}, + {"EditScrollDownAltHighlight", CK_Scroll_Down_Alt_Highlight}, + {"EditParagraphUpAltHighlight", CK_Paragraph_Up_Alt_Highlight}, + {"EditParagraphDownAltHighlight", CK_Paragraph_Down_Alt_Highlight}, + {"EditShiftBlockLeft", CK_Shift_Block_Left}, + {"EditShiftBlockRight", CK_Shift_Block_Right}, + {"EditXStore", CK_XStore}, + {"EditXCut", CK_XCut}, + {"EditXPaste", CK_XPaste}, + {"EditSelectionHistory", CK_Selection_History}, + {"EditShell", CK_Shell}, + {"EditInsertLiteral", CK_Insert_Literal}, + {"EditBeginOrEndMacro", CK_Begin_End_Macro}, + {"EditExtMode", CK_Ext_Mode}, + {"EditToggleLineState", CK_Toggle_Line_State}, + {"EditToggleTabTWS", CK_Toggle_Tab_TWS}, + {"EditToggleSyntax", CK_Toggle_Syntax}, + {"EditToggleShowMargin", CK_Toggle_Show_Margin}, + {"EditFindDefinition", CK_Find_Definition}, + {"EditLoadPrevFile", CK_Load_Prev_File}, + {"EditLoadNextFile", CK_Load_Next_File}, + {"EditOptions", CK_Edit_Options}, + {"EditSaveMode", CK_Edit_Save_Mode}, + {"EditChooseSyntax", CK_Choose_Syntax}, + {"EditAbout", CK_About}, +#if 0 + {"EditFocusNext", CK_Focus_Next}, + {"EditFocusPrev", CK_Focus_Prev}, + {"EditHeightInc", CK_Height_Inc}, + {"EditHeightDec", CK_Height_Dec}, + {"EditMake", CK_Make}, + {"EditErrorNext", CK_Error_Next}, + {"EditErrorPrev", CK_Error_Prev}, + {"EditSaveDesktop", CK_Save_Desktop}, + {"EditNewWindow", CK_New_Window}, + {"EditCycle", CK_Cycle}, + {"EditSaveAndQuit", CK_Save_And_Quit}, + {"EditRunAnother", CK_Run_Another}, + {"EditCheckSaveAndQuit", CK_Check_Save_And_Quit}, + {"EditMaximize", CK_Maximize}, +#endif +#endif /* USE_INTERNAL_EDIT */ + + /* viewer */ + {"ViewHelp", CK_ViewHelp}, + {"ViewToggleWrapMode", CK_ViewToggleWrapMode}, + {"ViewToggleHexEditMode", CK_ViewToggleHexEditMode}, + {"ViewQuit", CK_ViewQuit}, + {"ViewToggleHexMode", CK_ViewToggleHexMode}, + {"ViewGoto", CK_ViewGoto}, + {"ViewHexEditSave", CK_ViewHexEditSave}, + {"ViewSearch", CK_ViewSearch}, + {"ViewToggleMagicMode", CK_ViewToggleMagicMode}, + {"ViewToggleNroffMode", CK_ViewToggleNroffMode}, + {"ViewContinueSearch", CK_ViewContinueSearch}, + {"ViewGotoBookmark", CK_ViewGotoBookmark}, + {"ViewNewBookmark", CK_ViewNewBookmark}, + {"ViewMoveUp", CK_ViewMoveUp}, + {"ViewMoveDown", CK_ViewMoveDown}, + {"ViewMoveLeft", CK_ViewMoveLeft}, + {"ViewMoveRight", CK_ViewMoveRight}, + {"ViewMoveLeft10", CK_ViewMoveLeft10}, + {"ViewMoveRight10", CK_ViewMoveRight10}, + {"ViewMovePgDn", CK_ViewMovePgDn}, + {"ViewMovePgUp", CK_ViewMovePgUp}, + {"ViewMoveHalfPgDn", CK_ViewMoveHalfPgDn}, + {"ViewMoveHalfPgUp", CK_ViewMoveHalfPgUp}, + {"ViewMoveToBol", CK_ViewMoveToBol}, + {"ViewMoveToEol", CK_ViewMoveToEol}, + {"ViewMoveTop", CK_ViewMoveTop}, + {"ViewMoveBottom", CK_ViewMoveBottom}, + {"ViewNextFile", CK_ViewNextFile}, + {"ViewPrevFile", CK_ViewPrevFile}, + {"ViewToggleRuler", CK_ViewToggleRuler}, + {"ViewToggleHexNavMode", CK_ViewToggleHexNavMode}, + +#ifdef USE_DIFF_VIEW /* diff viewer */ {"DiffDisplaySymbols", CK_DiffDisplaySymbols}, {"DiffDisplayNumbers", CK_DiffDisplayNumbers}, @@ -532,16 +522,15 @@ static name_keymap_t command_names[] = { {"DiffEnd", CK_DiffEnd}, {"DiffQuit", CK_DiffQuit}, {"DiffHelp", CK_DiffHelp}, - {"SelectCodepage", CK_SelectCodepage}, {"DiffMergeCurrentHunk", CK_DiffMergeCurrentHunk}, {"DiffSave", CK_DiffSave}, {"DiffOptions", CK_DiffOptions}, -#endif +#endif /* USE_DIFF_VIEW */ {NULL, CK_Ignore_Key} }; -static const size_t num_command_names = sizeof (command_names) / sizeof (command_names[0]) - 1; +static const size_t num_command_names = G_N_ELEMENTS (command_names) - 1; /*** file scope functions ************************************************************************/ /* --------------------------------------------------------------------------------------------- */ diff --git a/lib/keybind.h b/lib/keybind.h index 7a7f1b80f..09d9f144f 100644 --- a/lib/keybind.h +++ b/lib/keybind.h @@ -14,328 +14,12 @@ #define CK_Insert_Char -1 #define CK_Ignore_Key 0 -/* cursor movements */ -#define CK_BackSpace 1 -#define CK_Delete 2 -#define CK_Enter 3 -#define CK_Page_Up 4 -#define CK_Page_Down 5 -#define CK_Left 6 -#define CK_Right 7 -#define CK_Word_Left 8 -#define CK_Word_Right 9 -#define CK_Up 10 -#define CK_Down 11 -#define CK_Home 12 -#define CK_End 13 -#define CK_Tab 14 -#define CK_Undo 15 -#define CK_Redo 16 -#define CK_Beginning_Of_Text 17 -#define CK_End_Of_Text 18 -#define CK_Scroll_Up 19 -#define CK_Scroll_Down 20 -#define CK_Return 21 -#define CK_Begin_Page 22 -#define CK_End_Page 23 -#define CK_Delete_Word_Left 24 -#define CK_Delete_Word_Right 25 -#define CK_Paragraph_Up 26 -#define CK_Paragraph_Down 27 - -/* file commands */ -#define CK_Save 101 -#define CK_Load 102 -#define CK_New 103 -#define CK_Save_As 104 -#define CK_Load_Prev_File 111 -#define CK_Load_Next_File 112 -#define CK_Load_Syntax_File 121 -#define CK_Load_Menu_File 122 -#define CK_Menu 123 - -/* block commands */ -#define CK_Mark 201 -#define CK_Copy 202 -#define CK_Move 203 -#define CK_Remove 204 -#define CK_Unmark 206 -#define CK_Save_Block 207 -#define CK_Column_Mark 208 -#define CK_Shift_Block_Left 211 -#define CK_Shift_Block_Right 212 -#define CK_Mark_All 213 -#define CK_Mark_Word 214 -#define CK_Mark_Line 215 - -/* search and replace */ -#define CK_Find 301 -#define CK_Find_Again 302 -#define CK_Replace 303 -#define CK_Replace_Again 304 -#define CK_Complete_Word 305 - -#if 0 -/* debugger commands */ -#define CK_Debug_Start 350 -#define CK_Debug_Stop 351 -#define CK_Debug_Toggle_Break 352 -#define CK_Debug_Clear 353 -#define CK_Debug_Next 354 -#define CK_Debug_Step 355 -#define CK_Debug_Back_Trace 356 -#define CK_Debug_Continue 357 -#define CK_Debug_Enter_Command 358 -#define CK_Debug_Until_Curser 359 -#endif - -/* misc */ -#define CK_Insert_File 401 -#define CK_Quit 402 -#define CK_Toggle_Insert 403 -#define CK_Help 404 -#define CK_Date 405 -#define CK_Refresh 406 -#define CK_Goto 407 -#define CK_Delete_Line 408 -#define CK_Delete_To_Line_End 409 -#define CK_Delete_To_Line_Begin 410 -#define CK_Man_Page 411 -#define CK_Sort 412 -#define CK_Mail 413 -#define CK_Cancel 414 -#define CK_Complete 415 -#define CK_Paragraph_Format 416 -#define CK_Util 417 -#define CK_Type_Load_Python 418 -#define CK_Find_File 419 -#define CK_Ctags 420 -#define CK_Match_Bracket 421 -#define CK_Terminal 422 -#define CK_Terminal_App 423 -#define CK_ExtCmd 424 -#define CK_User_Menu 425 -#define CK_Find_Definition 426 -#define CK_Edit_Options 427 -#define CK_Edit_Save_Mode 428 -#define CK_Choose_Syntax 429 -#define CK_About 430 - -#if 0 -/* application control */ -#define CK_Save_Desktop 451 -#define CK_New_Window 452 -#define CK_Cycle 453 -#define CK_Save_And_Quit 455 -#define CK_Run_Another 456 -#define CK_Check_Save_And_Quit 457 -#define CK_Maximize 458 -#endif - -#define CK_Toggle_Show_Margin 460 -#define CK_Toggle_Tab_TWS 470 -#define CK_Toggle_Syntax 480 -#define CK_Toggle_Line_State 490 - -/* macro */ -#define CK_Begin_Record_Macro 501 -#define CK_End_Record_Macro 502 -#define CK_Delete_Macro 503 - -/* book mark */ -#define CK_Toggle_Bookmark 550 -#define CK_Flush_Bookmarks 551 -#define CK_Next_Bookmark 552 -#define CK_Prev_Bookmark 553 - -/* highlight commands */ -#define CK_Page_Up_Highlight 604 -#define CK_Page_Down_Highlight 605 -#define CK_Left_Highlight 606 -#define CK_Right_Highlight 607 -#define CK_Word_Left_Highlight 608 -#define CK_Word_Right_Highlight 609 -#define CK_Up_Highlight 610 -#define CK_Down_Highlight 611 -#define CK_Home_Highlight 612 -#define CK_End_Highlight 613 -#define CK_Beginning_Of_Text_Highlight 614 -#define CK_End_Of_Text_Highlight 615 -#define CK_Begin_Page_Highlight 616 -#define CK_End_Page_Highlight 617 -#define CK_Scroll_Up_Highlight 618 -#define CK_Scroll_Down_Highlight 619 -#define CK_Paragraph_Up_Highlight 620 -#define CK_Paragraph_Down_Highlight 621 - -/* alt highlight commands */ -#define CK_Page_Up_Alt_Highlight 654 -#define CK_Page_Down_Alt_Highlight 655 -#define CK_Left_Alt_Highlight 656 -#define CK_Right_Alt_Highlight 657 -#define CK_Word_Left_Alt_Highlight 658 -#define CK_Word_Right_Alt_Highlight 659 -#define CK_Up_Alt_Highlight 660 -#define CK_Down_Alt_Highlight 661 -#define CK_Home_Alt_Highlight 662 -#define CK_End_Alt_Highlight 663 -#define CK_Beginning_Of_Text_Alt_Highlight 664 -#define CK_End_Of_Text_Alt_Highlight 665 -#define CK_Begin_Page_Alt_Highlight 666 -#define CK_End_Page_Alt_Highlight 667 -#define CK_Scroll_Up_Alt_Highlight 668 -#define CK_Scroll_Down_Alt_Highlight 669 -#define CK_Paragraph_Up_Alt_Highlight 670 -#define CK_Paragraph_Down_Alt_Highlight 671 - -/* X clipboard operations */ -#define CK_XStore 701 -#define CK_XCut 702 -#define CK_XPaste 703 -#define CK_Selection_History 704 - -#define CK_Shell 801 - -/* C-x or similar */ -#define CK_Ext_Mode 820 - -#define CK_Insert_Literal 851 -#define CK_Begin_End_Macro 853 -#define CK_Begin_End_Repeat 854 -#define CK_Begin_Record_Repeat 855 -#define CK_End_Record_Repeat 856 - -/* help */ -#define CK_HelpHelp 1001 -#define CK_HelpIndex 1002 -#define CK_HelpBack 1003 -#define CK_HelpQuit 1004 -#define CK_HelpMoveUp 1005 -#define CK_HelpMoveDown 1006 -#define CK_HelpSelectLink 1007 -#define CK_HelpNextLink 1008 -#define CK_HelpPrevLink 1009 -#define CK_HelpNextNode 1010 -#define CK_HelpPrevNode 1011 -#define CK_HelpMovePgDn 1012 -#define CK_HelpMovePgUp 1013 -#define CK_HelpMoveHalfPgDn 1014 -#define CK_HelpMoveHalfPgUp 1015 -#define CK_HelpMoveTop 1016 -#define CK_HelpMoveBottom 1017 - /* common */ -#define CK_ShowCommandLine 2001 #define CK_SelectCodepage 2002 +#define CK_ShowCommandLine 2001 #define CK_StartExtMap1 2021 #define CK_StartExtMap2 2022 -/* dialog */ -#define CK_DialogOK 3001 -#define CK_DialogCancel 3002 -#define CK_DialogPrevItem 3003 -#define CK_DialogNextItem 3004 -#define CK_DialogHelp 3005 -#define CK_DialogSuspend 3006 -#define CK_DialogRefresh 3007 - -/* text fields */ -#define CK_InputBol 4001 -#define CK_InputEol 4002 -#define CK_InputMoveLeft 4003 -#define CK_InputWordLeft 4004 -#define CK_InputBackwardChar 4005 -#define CK_InputBackwardWord 4006 -#define CK_InputMoveRight 4007 -#define CK_InputWordRight 4008 -#define CK_InputForwardChar 4009 -#define CK_InputForwardWord 4010 -#define CK_InputBackwardDelete 4011 -#define CK_InputDeleteChar 4012 -#define CK_InputKillWord 4013 -#define CK_InputBackwardKillWord 4014 -#define CK_InputSetMark 4015 -#define CK_InputKillRegion 4016 -#define CK_InputKillSave 4017 -#define CK_InputYank 4018 -#define CK_InputCopyRegion 4019 -#define CK_InputKillLine 4020 -#define CK_InputHistoryPrev 4021 -#define CK_InputHistoryNext 4022 -#define CK_InputHistoryShow 4023 -#define CK_InputComplete 4024 -#define CK_InputPaste 4025 -#define CK_InputClearLine 4026 -#define CK_InputLeftHighlight 4027 -#define CK_InputRightHighlight 4028 -#define CK_InputWordLeftHighlight 4029 -#define CK_InputWordRightHighlight 4030 -#define CK_InputBolHighlight 4031 -#define CK_InputEolHighlight 4032 - -/* listbox */ -#define CK_ListboxMoveUp 4500 -#define CK_ListboxMoveDown 4501 -#define CK_ListboxMoveHome 4502 -#define CK_ListboxMoveEnd 4503 -#define CK_ListboxMovePgUp 4504 -#define CK_ListboxMovePgDn 4505 -#define CK_ListboxDeleteItem 4506 -#define CK_ListboxDeleteAll 4507 - -/* viewer */ -#define CK_ViewHelp 5001 -#define CK_ViewToggleWrapMode 5002 -#define CK_ViewToggleHexEditMode 5003 -#define CK_ViewToggleHexMode 5004 -#define CK_ViewGoto 5005 -#define CK_ViewHexEditSave 5006 -#define CK_ViewSearch 5007 -#define CK_ViewToggleMagicMode 5008 -#define CK_ViewToggleNroffMode 5009 -#define CK_ViewQuit 5010 -#define CK_ViewContinueSearch 5011 -#define CK_ViewGotoBookmark 5012 -#define CK_ViewNewBookmark 5013 -#define CK_ViewMoveUp 5014 -#define CK_ViewMoveDown 5015 -#define CK_ViewMoveLeft 5016 -#define CK_ViewMoveRight 5017 -#define CK_ViewMovePgDn 5018 -#define CK_ViewMovePgUp 5019 -#define CK_ViewMoveHalfPgDn 5020 -#define CK_ViewMoveHalfPgUp 5021 -#define CK_ViewMoveToBol 5022 -#define CK_ViewMoveToEol 5023 -#define CK_ViewNextFile 5024 -#define CK_ViewPrevFile 5025 -#define CK_ViewToggleRuler 5026 -#define CK_ViewToggleHexNavMode 5027 -#define CK_ViewMoveTop 5028 -#define CK_ViewMoveBottom 5029 -#define CK_ViewMoveLeft10 5030 -#define CK_ViewMoveRight10 5031 - -/* tree */ -#define CK_TreeHelp 6001 -#define CK_TreeForget 6003 -#define CK_TreeToggleNav 6004 -#define CK_TreeCopy 6005 -#define CK_TreeMove 6006 -#define CK_TreeMake 6007 -#define CK_TreeMoveUp 6011 -#define CK_TreeMoveDown 6012 -#define CK_TreeMoveLeft 6013 -#define CK_TreeMoveRight 6014 -#define CK_TreeMoveHome 6015 -#define CK_TreeMoveEnd 6016 -#define CK_TreeMovePgUp 6017 -#define CK_TreeMovePgDn 6018 -#define CK_TreeOpen 6019 -#define CK_TreeRescan 6020 -#define CK_TreeStartSearch 6021 -#define CK_TreeRemove 6022 - /* main commands */ #define CK_AddHotlist 7001 #define CK_ChangeListingCmd 7002 @@ -461,6 +145,310 @@ #define CK_PanelSortOrderByMTime 8042 #define CK_PanelSmartGotoParentDir 8043 +/* dialog */ +#define CK_DialogOK 3001 +#define CK_DialogCancel 3002 +#define CK_DialogPrevItem 3003 +#define CK_DialogNextItem 3004 +#define CK_DialogHelp 3005 +#define CK_DialogSuspend 3006 +#define CK_DialogRefresh 3007 + +/* input */ +#define CK_InputBol 4001 +#define CK_InputEol 4002 +#define CK_InputMoveLeft 4003 +#define CK_InputWordLeft 4004 +#define CK_InputBackwardChar 4005 +#define CK_InputBackwardWord 4006 +#define CK_InputMoveRight 4007 +#define CK_InputWordRight 4008 +#define CK_InputForwardChar 4009 +#define CK_InputForwardWord 4010 +#define CK_InputBackwardDelete 4011 +#define CK_InputDeleteChar 4012 +#define CK_InputKillWord 4013 +#define CK_InputBackwardKillWord 4014 +#define CK_InputSetMark 4015 +#define CK_InputKillRegion 4016 +#define CK_InputKillSave 4017 +#define CK_InputYank 4018 +#define CK_InputCopyRegion 4019 +#define CK_InputKillLine 4020 +#define CK_InputHistoryPrev 4021 +#define CK_InputHistoryNext 4022 +#define CK_InputHistoryShow 4023 +#define CK_InputComplete 4024 +#define CK_InputPaste 4025 +#define CK_InputClearLine 4026 +#define CK_InputLeftHighlight 4027 +#define CK_InputRightHighlight 4028 +#define CK_InputWordLeftHighlight 4029 +#define CK_InputWordRightHighlight 4030 +#define CK_InputBolHighlight 4031 +#define CK_InputEolHighlight 4032 + +/* listbox */ +#define CK_ListboxMoveUp 4500 +#define CK_ListboxMoveDown 4501 +#define CK_ListboxMoveHome 4502 +#define CK_ListboxMoveEnd 4503 +#define CK_ListboxMovePgUp 4504 +#define CK_ListboxMovePgDn 4505 +#define CK_ListboxDeleteItem 4506 +#define CK_ListboxDeleteAll 4507 + +/* help */ +#define CK_HelpHelp 1001 +#define CK_HelpIndex 1002 +#define CK_HelpBack 1003 +#define CK_HelpQuit 1004 +#define CK_HelpMoveUp 1005 +#define CK_HelpMoveDown 1006 +#define CK_HelpSelectLink 1007 +#define CK_HelpNextLink 1008 +#define CK_HelpPrevLink 1009 +#define CK_HelpNextNode 1010 +#define CK_HelpPrevNode 1011 +#define CK_HelpMovePgDn 1012 +#define CK_HelpMovePgUp 1013 +#define CK_HelpMoveHalfPgDn 1014 +#define CK_HelpMoveHalfPgUp 1015 +#define CK_HelpMoveTop 1016 +#define CK_HelpMoveBottom 1017 + +/* tree */ +#define CK_TreeHelp 6001 +#define CK_TreeForget 6003 +#define CK_TreeToggleNav 6004 +#define CK_TreeCopy 6005 +#define CK_TreeMove 6006 +#define CK_TreeMake 6007 +#define CK_TreeMoveUp 6011 +#define CK_TreeMoveDown 6012 +#define CK_TreeMoveLeft 6013 +#define CK_TreeMoveRight 6014 +#define CK_TreeMoveHome 6015 +#define CK_TreeMoveEnd 6016 +#define CK_TreeMovePgUp 6017 +#define CK_TreeMovePgDn 6018 +#define CK_TreeOpen 6019 +#define CK_TreeRescan 6020 +#define CK_TreeStartSearch 6021 +#define CK_TreeRemove 6022 + +#ifdef USE_INTERNAL_EDIT +/* cursor movements */ +#define CK_BackSpace 1 +#define CK_Delete 2 +#define CK_Enter 3 +#define CK_Page_Up 4 +#define CK_Page_Down 5 +#define CK_Left 6 +#define CK_Right 7 +#define CK_Word_Left 8 +#define CK_Word_Right 9 +#define CK_Up 10 +#define CK_Down 11 +#define CK_Home 12 +#define CK_End 13 +#define CK_Tab 14 +#define CK_Undo 15 +#define CK_Redo 16 +#define CK_Beginning_Of_Text 17 +#define CK_End_Of_Text 18 +#define CK_Scroll_Up 19 +#define CK_Scroll_Down 20 +#define CK_Return 21 +#define CK_Begin_Page 22 +#define CK_End_Page 23 +#define CK_Delete_Word_Left 24 +#define CK_Delete_Word_Right 25 +#define CK_Paragraph_Up 26 +#define CK_Paragraph_Down 27 +/* file commands */ +#define CK_Save 101 +#define CK_Load 102 +#define CK_New 103 +#define CK_Save_As 104 +#define CK_Load_Prev_File 111 +#define CK_Load_Next_File 112 +#define CK_Load_Syntax_File 121 +#define CK_Load_Menu_File 122 +#define CK_Menu 123 +/* block commands */ +#define CK_Mark 201 +#define CK_Copy 202 +#define CK_Move 203 +#define CK_Remove 204 +#define CK_Unmark 206 +#define CK_Save_Block 207 +#define CK_Column_Mark 208 +#define CK_Shift_Block_Left 211 +#define CK_Shift_Block_Right 212 +#define CK_Mark_All 213 +#define CK_Mark_Word 214 +#define CK_Mark_Line 215 + +/* search and replace */ +#define CK_Find 301 +#define CK_Find_Again 302 +#define CK_Replace 303 +#define CK_Replace_Again 304 +#define CK_Complete_Word 305 +#if 0 +/* debugger commands */ +#define CK_Debug_Start 350 +#define CK_Debug_Stop 351 +#define CK_Debug_Toggle_Break 352 +#define CK_Debug_Clear 353 +#define CK_Debug_Next 354 +#define CK_Debug_Step 355 +#define CK_Debug_Back_Trace 356 +#define CK_Debug_Continue 357 +#define CK_Debug_Enter_Command 358 +#define CK_Debug_Until_Curser 359 +#endif +#define CK_Insert_File 401 +#define CK_Quit 402 +#define CK_Toggle_Insert 403 +#define CK_Help 404 +#define CK_Date 405 +#define CK_Refresh 406 +#define CK_Goto 407 +#define CK_Delete_Line 408 +#define CK_Delete_To_Line_End 409 +#define CK_Delete_To_Line_Begin 410 +#define CK_Man_Page 411 +#define CK_Sort 412 +#define CK_Mail 413 +#define CK_Cancel 414 +#define CK_Complete 415 +#define CK_Paragraph_Format 416 +#define CK_Util 417 +#define CK_Type_Load_Python 418 +#define CK_Find_File 419 +#define CK_Ctags 420 +#define CK_Match_Bracket 421 +#define CK_Terminal 422 +#define CK_Terminal_App 423 +#define CK_ExtCmd 424 +#define CK_User_Menu 425 +#define CK_Find_Definition 426 +#define CK_Edit_Options 427 +#define CK_Edit_Save_Mode 428 +#define CK_Choose_Syntax 429 +#define CK_About 430 +#if 0 +/* application control */ +#define CK_Save_Desktop 451 +#define CK_New_Window 452 +#define CK_Cycle 453 +#define CK_Save_And_Quit 455 +#define CK_Run_Another 456 +#define CK_Check_Save_And_Quit 457 +#define CK_Maximize 458 +#endif +#define CK_Toggle_Show_Margin 460 +#define CK_Toggle_Tab_TWS 470 +#define CK_Toggle_Syntax 480 +#define CK_Toggle_Line_State 490 +/* macro */ +#define CK_Begin_Record_Macro 501 +#define CK_End_Record_Macro 502 +#define CK_Delete_Macro 503 +/* book mark */ +#define CK_Toggle_Bookmark 550 +#define CK_Flush_Bookmarks 551 +#define CK_Next_Bookmark 552 +#define CK_Prev_Bookmark 553 +/* highlight commands */ +#define CK_Page_Up_Highlight 604 +#define CK_Page_Down_Highlight 605 +#define CK_Left_Highlight 606 +#define CK_Right_Highlight 607 +#define CK_Word_Left_Highlight 608 +#define CK_Word_Right_Highlight 609 +#define CK_Up_Highlight 610 +#define CK_Down_Highlight 611 +#define CK_Home_Highlight 612 +#define CK_End_Highlight 613 +#define CK_Beginning_Of_Text_Highlight 614 +#define CK_End_Of_Text_Highlight 615 +#define CK_Begin_Page_Highlight 616 +#define CK_End_Page_Highlight 617 +#define CK_Scroll_Up_Highlight 618 +#define CK_Scroll_Down_Highlight 619 +#define CK_Paragraph_Up_Highlight 620 +#define CK_Paragraph_Down_Highlight 621 +/* alt highlight commands */ +#define CK_Page_Up_Alt_Highlight 654 +#define CK_Page_Down_Alt_Highlight 655 +#define CK_Left_Alt_Highlight 656 +#define CK_Right_Alt_Highlight 657 +#define CK_Word_Left_Alt_Highlight 658 +#define CK_Word_Right_Alt_Highlight 659 +#define CK_Up_Alt_Highlight 660 +#define CK_Down_Alt_Highlight 661 +#define CK_Home_Alt_Highlight 662 +#define CK_End_Alt_Highlight 663 +#define CK_Beginning_Of_Text_Alt_Highlight 664 +#define CK_End_Of_Text_Alt_Highlight 665 +#define CK_Begin_Page_Alt_Highlight 666 +#define CK_End_Page_Alt_Highlight 667 +#define CK_Scroll_Up_Alt_Highlight 668 +#define CK_Scroll_Down_Alt_Highlight 669 +#define CK_Paragraph_Up_Alt_Highlight 670 +#define CK_Paragraph_Down_Alt_Highlight 671 +/* X clipboard operations */ +#define CK_XStore 701 +#define CK_XCut 702 +#define CK_XPaste 703 +#define CK_Selection_History 704 +#define CK_Shell 801 +/* C-x or similar */ +#define CK_Ext_Mode 820 +#define CK_Insert_Literal 851 +#define CK_Begin_End_Macro 853 +#define CK_Begin_End_Repeat 854 +#define CK_Begin_Record_Repeat 855 +#define CK_End_Record_Repeat 856 +#endif /* USE_INTERNAL_EDIT */ + +/* viewer */ +#define CK_ViewHelp 5001 +#define CK_ViewToggleWrapMode 5002 +#define CK_ViewToggleHexEditMode 5003 +#define CK_ViewToggleHexMode 5004 +#define CK_ViewGoto 5005 +#define CK_ViewHexEditSave 5006 +#define CK_ViewSearch 5007 +#define CK_ViewToggleMagicMode 5008 +#define CK_ViewToggleNroffMode 5009 +#define CK_ViewQuit 5010 +#define CK_ViewContinueSearch 5011 +#define CK_ViewGotoBookmark 5012 +#define CK_ViewNewBookmark 5013 +#define CK_ViewMoveUp 5014 +#define CK_ViewMoveDown 5015 +#define CK_ViewMoveLeft 5016 +#define CK_ViewMoveRight 5017 +#define CK_ViewMovePgDn 5018 +#define CK_ViewMovePgUp 5019 +#define CK_ViewMoveHalfPgDn 5020 +#define CK_ViewMoveHalfPgUp 5021 +#define CK_ViewMoveToBol 5022 +#define CK_ViewMoveToEol 5023 +#define CK_ViewNextFile 5024 +#define CK_ViewPrevFile 5025 +#define CK_ViewToggleRuler 5026 +#define CK_ViewToggleHexNavMode 5027 +#define CK_ViewMoveTop 5028 +#define CK_ViewMoveBottom 5029 +#define CK_ViewMoveLeft10 5030 +#define CK_ViewMoveRight10 5031 + +#ifdef USE_DIFF_VIEW /* diff viewer */ #define CK_DiffDisplaySymbols 9001 #define CK_DiffDisplayNumbers 9002 @@ -499,6 +487,7 @@ #define CK_DiffSave 9036 #define CK_DiffContinueSearch 9037 #define CK_DiffOptions 9038 +#endif /* USE_DIFF_VIEW */ #define CK_Pipe_Block(i) (10000+(i)) #define CK_Macro(i) (20000+(i)) diff --git a/misc/mc.keymap.default b/misc/mc.keymap.default index e0f3374ab..61cea3ad5 100644 --- a/misc/mc.keymap.default +++ b/misc/mc.keymap.default @@ -1,223 +1,3 @@ -[editor] -EditXStore = ctrl-insert -EditXPaste = shift-insert -EditXCut = shift-delete - -EditDeleteLine = ctrl-y -EditDeleteToLineEnd = ctrl-k -EditDeleteToLineBegin = - -EditLeft = left -EditRight = right -EditUp = up -EditDown = down -EditEnter = enter -EditReturn = shift-enter -EditBackSpace = backspace; ctrl-h -EditDelete = delete; ctrl-d -EditPageUp = pgup -EditPageDown = pgdn -EditWordLeft = ctrl-left; ctrl-z -EditWordRight = ctrl-right; ctrl-x -EditHome = home -EditEnd = end -EditTab = tab -EditUndo = ctrl-u -EditRedo = alt-r -EditBeginningOfText = ctrl-home; alt-lt -EditEndOfText = ctrl-end; alt-gt -EditScrollUp = ctrl-up -EditScrollDown = ctrl-down -EditBeginPage = ctrl-pgup -EditEndPage = ctrl-pgdn -EditDeleteWordLeft = alt-backspace -EditDeleteWordRight = alt-d -EditParagraphUp = -EditParagraphDown = -EditSave = f2 -EditLoad = -EditNew = ctrl-n -EditSaveas = f12 -EditMark = f3 -EditCopy = f5 -EditMove = f6 -EditRemove = f8 -EditMarkAll = -EditUnmark = -EditFind = f7 -EditMarkLine = -EditMarkWord = - -EditShiftBlockLeft = -EditShiftBlockRight = - -EditPageUpHighlight = shift-pgup -EditPageDownHighlight = shift-pgdn -EditLeftHighlight = shift-left -EditRightHighlight = shift-right -EditWordLeftHighlight = ctrl-shift-left -EditWordRightHighlight = ctrl-shift-right -EditUpHighlight = shift-up -EditDownHighlight = shift-down -EditHomeHighlight = shift-home -EditEndHighlight = shift-end -EditBeginningOfTextHighlight = ctrl-shift-home -EditEndOfTextHighlight = ctrl-shift-end -EditBeginPageHighlight = ctrl-shift-pgup -EditEndPageHighlight = ctrl-shift-pgdn -EditScrollUpHighlight = ctrl-shift-up -EditScrollDownHighlight = ctrl-shift-down -EditParagraphUpHighlight = -EditParagraphDownHighlight = - -EditPageUpAltHighlight = alt-pgup -EditPageDownAltHighlight = alt-pgdn -EditLeftAltHighlight = alt-left -EditRightAltHighlight = alt-right -EditWordLeftAltHighlight = ctrl-alt-left -EditWordRightAltHighlight = ctrl-alt-right -EditUpAltHighlight = alt-up -EditDownAltHighlight = alt-down -EditHomeAltHighlight = alt-home -EditEndAltHighlight = alt-end -EditBeginningOfTextAltHighlight = ctrl-alt-home -EditEndOfTextHighlight = ctrl-alt-end -EditBeginPageHighlight = ctrl-alt-pgup -EditEndPageAltHighlight = ctrl-alt-pgdn -EditScrollUpAltHighlight = -EditScrollDownAltHighlight = -EditParagraphUpAltHighlight = -EditParagraphDownAltHighlight = - -EditSaveBlock = ctrl-f -EditColumnMark = f13 -EditFindAgain = f17 -EditReplace = f4 -EditReplaceAgain = f14 -EditCompleteWord = alt-tab -EditDebugStart = -EditDebugStop = -EditDebugToggleBreak = -EditDebugClear = -EditDebugNext = -EditDebugStep = -EditDebugBackTrace = -EditDebugContinue = -EditDebugEnterCommand = -EditDebugUntilCurser = -EditInsertFile = f15 -EditQuit = f10 -EditToggleInsert = insert -EditHelp = f1 -EditDate = -EditRefresh = ctrl-l -EditGoto = alt-l -EditManPage = -EditSort = alt-t -EditMail = alt-m -EditCancel = -EditComplete = - -EditParagraphFormat = alt-p -EditUtil = -EditTypeLoadPython = -EditFindFile = -EditCtags = -EditMatchBracket = alt-b -EditTerminal = -EditTerminalApp = -EditExtCmd = alt-u -EditUserMenu = f11 -EditSaveDesktop = -EditNewWindow = -EditCycle = -EditMenu = f9 -EditSaveAndQuit = -EditRunAnother = -EditCheckSaveAndQuit = -EditMaximize = -EditToggleBookmark = alt-k -EditFlushBookmarks = alt-o -EditNextBookmark = alt-j -EditPrevBookmark = alt-i - -EditSelectionHistory = -EditShell = ctrl-o -EditInsertLiteral = ctrl-q - -EditBeginRecordMacro = -EditEndRecordMacro = -EditBeginOrEndMacro = ctrl-r -EditExecuteMacro = ctrl-a -EditDeleteMacro = - -EditToggleLineState = alt-n -EditToggleTabTWS = alt-underline -EditToggleSyntax = ctrl-s -EditToggleShowMargin = - -EditFindDefinition = alt-enter -EditLoadPrevFile = alt-minus -EditLoadNextFile = alt-plus - -EditBeginEndRepeat = - -SelectCodepage = alt-e - -[viewer] -ViewHelp = f1 -ViewToggleWrapMode = f2 -ViewQuit = f3; f10; q; esc; ctrl-g -ViewToggleHexMode = f4 -ViewGoto = f5 -ViewSearch = f7; question; slash -ViewToggleMagicMode = f8 -ViewToggleNroffMode = f9 -ViewContinueSearch = ctrl-r; ctrl-s; f17; n -ViewMoveToBol = ctrl-a -ViewMoveToEol = ctrl-e -ViewMoveLeft = h; left -ViewMoveRight = l; right -ViewMoveLeft10 = ctrl-left -ViewMoveRight10 = ctrl-right -ViewMoveUp = k; y; insert; up; ctrl-p -ViewMoveDown = j; e; delete; down; enter; ctrl-n -ViewMovePgDn = f; space; pgdn; ctrl-v -ViewMovePgUp = b; pgup; alt-v; backspace -ViewMoveHalfPgDn = d -ViewMoveHalfPgUp = u -ViewMoveTop = home; ctrl-home; ctrl-pgup; a1; alt-lt; g -ViewMoveBottom = end; ctrl-end; ctrl-pgdn; c1; alt-gt; shift-g -ViewGotoBookmark = m -ViewNewBookmark = r -ViewNextFile = ctrl-f -ViewPrevFile = ctrl-b -SelectCodepage = alt-e -ShowCommandLine = ctrl-o -ViewToggleRuler = alt-r - -[viewer:hex] -ViewHelp = f1 -ViewToggleHexEditMode = f2 -ViewQuit = f3; f10; q; esc; ctrl-g -ViewToggleHexMode = f4 -ViewGoto = f5 -ViewHexEditSave = f6 -ViewSearch = f7; question; slash -ViewToggleMagicMode = f8 -ViewToggleNroffMode = f9 -ViewToggleHexNavMode = tab -ViewMoveToBol = ctrl-a; home -ViewMoveToEol = ctrl-e; end -ViewMoveLeft = b; left -ViewMoveRight = f; right -ViewMoveUp = k; y; up -ViewMoveDown = j; delete; down -ViewMovePgDn = pgdn; ctrl-v -ViewMovePgUp = pgup; alt-v -ViewMoveTop = home; ctrl-home; ctrl-pgup; a1; alt-lt; g -ViewMoveBottom = end; ctrl-end; ctrl-pgdn; c1; alt-gt; shift-g - [main] CmdHelp = f1 CmdUserMenu = f2 @@ -308,15 +88,27 @@ PanelGotoTopFile = alt-g PanelSetPanelEncoding = alt-e PanelMoveHome = alt-lt; home; a1 PanelMoveEnd = alt-gt; end; c1 -PanelSelectSortOrder= -PanelToggleSortOrderPrev= -PanelToggleSortOrderNext= -PanelReverseSort= -PanelSortOrderByName= -PanelSortOrderByExt= -PanelSortOrderBySize= -PanelSortOrderByMTime= -PanelSmartGotoParentDir= +PanelSelectSortOrder = +PanelToggleSortOrderPrev = +PanelToggleSortOrderNext = +PanelReverseSort = +PanelSortOrderByName = +PanelSortOrderByExt = +PanelSortOrderBySize = +PanelSortOrderByMTime = +PanelSmartGotoParentDir = + +[dialog] +DialogOK = enter +DialogCancel = f10; esc; ctrl-g +DialogPrevItem = left; up +DialogNextItem = right; down +DialogHelp = f1 +DialogSuspend = ctrl-z +DialogRefresh = ctrl-l +CmdDialogList = alt-prime +CmdDialogNext = alt-rbrace +CmdDialogPrev = alt-lbrace [input] InputBol = ctrl-a; alt-lt; home; a1 @@ -400,18 +192,211 @@ HelpPrevLink = alt-tab HelpNextNode = n HelpPrevNode = p -[dialog] -DialogOK = enter -DialogCancel = f10; esc; ctrl-g -DialogPrevItem = left; up -DialogNextItem = right; down -DialogHelp = f1 -DialogSuspend = ctrl-z -DialogRefresh = ctrl-l -CmdDialogList = alt-prime -CmdDialogNext = alt-rbrace -CmdDialogPrev = alt-lbrace +[editor] +EditXStore = ctrl-insert +EditXPaste = shift-insert +EditXCut = shift-delete +EditDeleteLine = ctrl-y +EditDeleteToLineEnd = ctrl-k +EditDeleteToLineBegin = +EditLeft = left +EditRight = right +EditUp = up +EditDown = down +EditEnter = enter +EditReturn = shift-enter +EditBackSpace = backspace; ctrl-h +EditDelete = delete; ctrl-d +EditPageUp = pgup +EditPageDown = pgdn +EditWordLeft = ctrl-left; ctrl-z +EditWordRight = ctrl-right; ctrl-x +EditHome = home +EditEnd = end +EditTab = tab +EditUndo = ctrl-u +EditRedo = alt-r +EditBeginningOfText = ctrl-home; alt-lt +EditEndOfText = ctrl-end; alt-gt +EditScrollUp = ctrl-up +EditScrollDown = ctrl-down +EditBeginPage = ctrl-pgup +EditEndPage = ctrl-pgdn +EditDeleteWordLeft = alt-backspace +EditDeleteWordRight = alt-d +EditParagraphUp = +EditParagraphDown = +EditSave = f2 +EditLoad = +EditNew = ctrl-n +EditSaveas = f12 +EditMark = f3 +EditCopy = f5 +EditMove = f6 +EditRemove = f8 +EditMarkAll = +EditUnmark = +EditFind = f7 +EditMarkLine = +EditMarkWord = +EditShiftBlockLeft = +EditShiftBlockRight = +EditPageUpHighlight = shift-pgup +EditPageDownHighlight = shift-pgdn +EditLeftHighlight = shift-left +EditRightHighlight = shift-right +EditWordLeftHighlight = ctrl-shift-left +EditWordRightHighlight = ctrl-shift-right +EditUpHighlight = shift-up +EditDownHighlight = shift-down +EditHomeHighlight = shift-home +EditEndHighlight = shift-end +EditBeginningOfTextHighlight = ctrl-shift-home +EditEndOfTextHighlight = ctrl-shift-end +EditBeginPageHighlight = ctrl-shift-pgup +EditEndPageHighlight = ctrl-shift-pgdn +EditScrollUpHighlight = ctrl-shift-up +EditScrollDownHighlight = ctrl-shift-down +EditParagraphUpHighlight = +EditParagraphDownHighlight = +EditPageUpAltHighlight = alt-pgup +EditPageDownAltHighlight = alt-pgdn +EditLeftAltHighlight = alt-left +EditRightAltHighlight = alt-right +EditWordLeftAltHighlight = ctrl-alt-left +EditWordRightAltHighlight = ctrl-alt-right +EditUpAltHighlight = alt-up +EditDownAltHighlight = alt-down +EditHomeAltHighlight = alt-home +EditEndAltHighlight = alt-end +EditBeginningOfTextAltHighlight = ctrl-alt-home +EditEndOfTextHighlight = ctrl-alt-end +EditBeginPageHighlight = ctrl-alt-pgup +EditEndPageAltHighlight = ctrl-alt-pgdn +EditScrollUpAltHighlight = +EditScrollDownAltHighlight = +EditParagraphUpAltHighlight = +EditParagraphDownAltHighlight = +EditSaveBlock = ctrl-f +EditColumnMark = f13 +EditFindAgain = f17 +EditReplace = f4 +EditReplaceAgain = f14 +EditCompleteWord = alt-tab +EditDebugStart = +EditDebugStop = +EditDebugToggleBreak = +EditDebugClear = +EditDebugNext = +EditDebugStep = +EditDebugBackTrace = +EditDebugContinue = +EditDebugEnterCommand = +EditDebugUntilCurser = +EditInsertFile = f15 +EditQuit = f10 +EditToggleInsert = insert +EditHelp = f1 +EditDate = +EditRefresh = ctrl-l +EditGoto = alt-l +EditManPage = +EditSort = alt-t +EditMail = alt-m +EditCancel = +EditComplete = +EditParagraphFormat = alt-p +EditUtil = +EditTypeLoadPython = +EditFindFile = +EditCtags = +EditMatchBracket = alt-b +EditTerminal = +EditTerminalApp = +EditExtCmd = alt-u +EditUserMenu = f11 +EditSaveDesktop = +EditNewWindow = +EditCycle = +EditMenu = f9 +EditSaveAndQuit = +EditRunAnother = +EditCheckSaveAndQuit = +EditMaximize = +EditToggleBookmark = alt-k +EditFlushBookmarks = alt-o +EditNextBookmark = alt-j +EditPrevBookmark = alt-i +EditSelectionHistory = +EditShell = ctrl-o +EditInsertLiteral = ctrl-q +EditBeginRecordMacro = +EditEndRecordMacro = +EditBeginOrEndMacro = ctrl-r +EditDeleteMacro = +EditToggleLineState = alt-n +EditToggleTabTWS = alt-underline +EditToggleSyntax = ctrl-s +EditToggleShowMargin = +EditFindDefinition = alt-enter +EditLoadPrevFile = alt-minus +EditLoadNextFile = alt-plus +EditBeginEndRepeat = +SelectCodepage = alt-e +[viewer] +ViewHelp = f1 +ViewToggleWrapMode = f2 +ViewQuit = f3; f10; q; esc; ctrl-g +ViewToggleHexMode = f4 +ViewGoto = f5 +ViewSearch = f7; question; slash +ViewToggleMagicMode = f8 +ViewToggleNroffMode = f9 +ViewContinueSearch = ctrl-r; ctrl-s; f17; n +ViewMoveToBol = ctrl-a +ViewMoveToEol = ctrl-e +ViewMoveLeft = h; left +ViewMoveRight = l; right +ViewMoveLeft10 = ctrl-left +ViewMoveRight10 = ctrl-right +ViewMoveUp = k; y; insert; up; ctrl-p +ViewMoveDown = j; e; delete; down; enter; ctrl-n +ViewMovePgDn = f; space; pgdn; ctrl-v +ViewMovePgUp = b; pgup; alt-v; backspace +ViewMoveHalfPgDn = d +ViewMoveHalfPgUp = u +ViewMoveTop = home; ctrl-home; ctrl-pgup; a1; alt-lt; g +ViewMoveBottom = end; ctrl-end; ctrl-pgdn; c1; alt-gt; shift-g +ViewGotoBookmark = m +ViewNewBookmark = r +ViewNextFile = ctrl-f +ViewPrevFile = ctrl-b +SelectCodepage = alt-e +ShowCommandLine = ctrl-o +ViewToggleRuler = alt-r + +[viewer:hex] +ViewHelp = f1 +ViewToggleHexEditMode = f2 +ViewQuit = f3; f10; q; esc; ctrl-g +ViewToggleHexMode = f4 +ViewGoto = f5 +ViewHexEditSave = f6 +ViewSearch = f7; question; slash +ViewToggleMagicMode = f8 +ViewToggleNroffMode = f9 +ViewToggleHexNavMode = tab +ViewMoveToBol = ctrl-a; home +ViewMoveToEol = ctrl-e; end +ViewMoveLeft = b; left +ViewMoveRight = f; right +ViewMoveUp = k; y; up +ViewMoveDown = j; delete; down +ViewMovePgDn = pgdn; ctrl-v +ViewMovePgUp = pgup; alt-v +ViewMoveTop = home; ctrl-home; ctrl-pgup; a1; alt-lt; g +ViewMoveBottom = end; ctrl-end; ctrl-pgdn; c1; alt-gt; shift-g [diffviewer] DiffDisplaySymbols = alt-s; s diff --git a/misc/mc.keymap.emacs b/misc/mc.keymap.emacs index 53c1d231a..d127741d6 100644 --- a/misc/mc.keymap.emacs +++ b/misc/mc.keymap.emacs @@ -1,226 +1,3 @@ -[editor] -EditXStore = alt-w -EditXPaste = ctrl-y -EditXCut = ctrl-w - -EditDeleteLine = ctrl-y -EditDeleteToLineEnd = ctrl-k -EditDeleteToLineBegin = - -EditLeft = left; ctrl-b -EditRight = right; ctrl-f -EditUp = up; ctrl-p -EditDown = down; ctrl-n -EditEnter = enter -EditReturn = shift-enter -EditBackSpace = backspace -EditDelete = delete -EditPageUp = pgup; alt-v -EditPageDown = pgdn; ctrl-v -EditWordLeft = ctrl-left; alt-b -EditWordRight = ctrl-right; alt-f -EditHome = home; ctrl-a -EditEnd = end; ctrl-e -EditTab = tab -EditUndo = ctrl-u -EditBeginningOfText = ctrl-home; alt-lt -EditEndOfText = ctrl-end; alt-gt -EditScrollUp = ctrl-up -EditScrollDown = ctrl-down -EditBeginPage = ctrl-pgup -EditEndPage = ctrl-pgdn -EditDeleteWordLeft = alt-backspace -EditDeleteWordRight = alt-d -EditParagraphUp = -EditParagraphDown = -EditSave = f2 -EditLoad = -EditSaveas = f12 -EditMark = f3; ctrl-at -EditCopy = f5 -EditMove = f6 -EditRemove = f8 -EditMarkAll = -EditUnmark = -EditFind = f7; ctrl-s -EditMarkLine = -EditMarkWord = - -EditShiftBlockLeft = -EditShiftBlockRight = - -EditPageUpHighlight = shift-pgup -EditPageDownHighlight = shift-pgdn -EditLeftHighlight = shift-left -EditRightHighlight = shift-right -EditWordLeftHighlight = ctrl-shift-left -EditWordRightHighlight = ctrl-shift-right -EditUpHighlight = shift-up -EditDownHighlight = shift-down -EditHomeHighlight = shift-home -EditEndHighlight = shift-end -EditBeginningOfTextHighlight = ctrl-shift-home -EditEndOfTextHighlight = ctrl-shift-end -EditBeginPageHighlight = ctrl-shift-pgup -EditEndPageHighlight = ctrl-shift-pgdn -EditScrollUpHighlight = ctrl-shift-up -EditScrollDownHighlight = ctrl-shift-down -EditParagraphUpHighlight = -EditParagraphDownHighlight = - -EditPageUpAltHighlight = alt-pgup -EditPageDownAltHighlight = alt-pgdn -EditLeftAltHighlight = alt-left -EditRightAltHighlight = alt-right -EditWordLeftAltHighlight = ctrl-alt-left -EditWordRightAltHighlight = ctrl-alt-right -EditUpAltHighlight = alt-up -EditDownAltHighlight = alt-down -EditHomeAltHighlight = alt-home -EditEndAltHighlight = alt-end -EditBeginningOfTextAltHighlight = ctrl-alt-home -EditEndOfTextHighlight = ctrl-alt-end -EditBeginPageHighlight = ctrl-alt-pgup -EditEndPageAltHighlight = ctrl-alt-pgdn -EditScrollUpAltHighlight = -EditScrollDownAltHighlight = -EditParagraphUpAltHighlight = -EditParagraphDownAltHighlight = - -EditSaveBlock = -EditColumnMark = f13 -EditFindAgain = f17 -EditReplace = f4 -EditReplaceAgain = f14 -EditCompleteWord = alt-tab -EditDebugStart = -EditDebugStop = -EditDebugToggleBreak = -EditDebugClear = -EditDebugNext = -EditDebugStep = -EditDebugBackTrace = -EditDebugContinue = -EditDebugEnterCommand = -EditDebugUntilCurser = -EditInsertFile = f15 -EditQuit = f10 -EditToggleInsert = insert -EditHelp = f1 -EditDate = -EditRefresh = ctrl-l -EditGoto = alt-l -EditManPage = -EditSort = alt-t -EditMail = -EditCancel = -EditComplete = - -EditParagraphFormat = alt-p -EditUtil = -EditTypeLoadPython = -EditFindFile = -EditCtags = -EditMatchBracket = -EditTerminal = -EditTerminalApp = -EditExtCmd = alt-u -EditUserMenu = f11 -EditSaveDesktop = -EditNewWindow = -EditCycle = -EditMenu = f9 -EditSaveAndQuit = -EditRunAnother = -EditCheckSaveAndQuit = -EditMaximize = -EditToggleBookmark = -EditFlushBookmarks = -EditNextBookmark = -EditPrevBookmark = - -EditSelectionHistory = -EditShell = ctrl-o -EditInsertLiteral = ctrl-q - -EditBeginRecordMacro = -EditEndRecordMacro = -EditBeginOrEndMacro = ctrl-r -EditDeleteMacro = - -EditToggleLineState = alt-n -EditToggleTabTWS = alt-underline -EditToggleSyntax = ctrl-s -EditToggleShowMargin = - -EditFindDefinition = alt-enter -EditLoadPrevFile = alt-minus -EditLoadNextFile = alt-plus - -EditBeginEndRepeat = - -SelectCodepage = alt-e - -EditExtMode = ctrl-x - -[edit:xmap] -EditNew = k -EditExecuteMacro = e - -[viewer] -ViewHelp = f1 -ViewToggleWrapMode = f2 -ViewQuit = f3; f10; q; esc; ctrl-g -ViewToggleHexMode = f4 -ViewGoto = f5 -ViewSearch = f7; question; slash -ViewToggleMagicMode = f8 -ViewToggleNroffMode = f9 -ViewContinueSearch = ctrl-r; ctrl-s; f17; n -ViewMoveToBol = ctrl-a -ViewMoveToEol = ctrl-e -ViewMoveLeft = h; left -ViewMoveRight = l; right -ViewMoveLeft10 = ctrl-left -ViewMoveRight10 = ctrl-right -ViewMoveUp = k; y; insert; up; ctrl-p -ViewMoveDown = j; e; delete; down; enter; ctrl-n -ViewMovePgDn = f; space; pgdn; ctrl-v -ViewMovePgUp = b; pgup; alt-v; backspace -ViewMoveHalfPgDn = d -ViewMoveHalfPgUp = u -ViewMoveTop = home; ctrl-home; ctrl-pgup; a1; alt-lt; g -ViewMoveBottom = end; ctrl-end; ctrl-pgdn; c1; alt-gt; shift-g -ViewGotoBookmark = m -ViewNewBookmark = r -ViewNextFile = ctrl-f -ViewPrevFile = ctrl-b -SelectCodepage = alt-e -ShowCommandLine = ctrl-o -ViewToggleRuler = alt-r - -[viewer:hex] -ViewHelp = f1 -ViewToggleHexEditMode = f2 -ViewQuit = f3; f10; q; esc; ctrl-g -ViewToggleHexMode = f4 -ViewGoto = f5 -ViewHexEditSave = f6 -ViewSearch = f7; question; slash -ViewToggleMagicMode = f8 -ViewToggleNroffMode = f9 -ViewToggleHexNavMode = tab -ViewMoveToBol = ctrl-a; home -ViewMoveToEol = ctrl-e; end -ViewMoveLeft = b; left -ViewMoveRight = f; right -ViewMoveUp = k; y; up -ViewMoveDown = j; delete; down -ViewMovePgDn = pgdn; ctrl-v -ViewMovePgUp = pgup; alt-v -ViewMoveTop = home; ctrl-home; ctrl-pgup; a1; alt-lt; g -ViewMoveBottom = end; ctrl-end; ctrl-pgdn; c1; alt-gt; shift-g - [main] CmdHelp = f1 CmdUserMenu = f2 @@ -311,15 +88,27 @@ PanelGotoTopFile = alt-g PanelSetPanelEncoding = alt-e PanelMoveHome = alt-lt; home; a1 PanelMoveEnd = alt-gt; end; c1 -PanelSelectSortOrder= -PanelToggleSortOrderPrev= -PanelToggleSortOrderNext= -PanelReverseSort= -PanelSortOrderByName= -PanelSortOrderByExt= -PanelSortOrderBySize= -PanelSortOrderByMTime= -PanelSmartGotoParentDir= +PanelSelectSortOrder = +PanelToggleSortOrderPrev = +PanelToggleSortOrderNext = +PanelReverseSort = +PanelSortOrderByName = +PanelSortOrderByExt = +PanelSortOrderBySize = +PanelSortOrderByMTime = +PanelSmartGotoParentDir = + +[dialog] +DialogOK = enter +DialogCancel = f10; esc; ctrl-g +DialogPrevItem = left; up +DialogNextItem = right; down +DialogHelp = f1 +DialogSuspend = ctrl-z +DialogRefresh = ctrl-l +CmdDialogList = alt-prime +CmdDialogNext = alt-rbrace +CmdDialogPrev = alt-lbrace [input] InputBol = ctrl-a; alt-lt; home; a1 @@ -403,18 +192,213 @@ HelpPrevLink = alt-tab HelpNextNode = n HelpPrevNode = p -[dialog] -DialogOK = enter -DialogCancel = f10; esc; ctrl-g -DialogPrevItem = left; up -DialogNextItem = right; down -DialogHelp = f1 -DialogSuspend = ctrl-z -DialogRefresh = ctrl-l -CmdDialogList = alt-prime -CmdDialogNext = alt-rbrace -CmdDialogPrev = alt-lbrace +[editor] +EditXStore = alt-w +EditXPaste = ctrl-y +EditXCut = ctrl-w +EditDeleteLine = ctrl-y +EditDeleteToLineEnd = ctrl-k +EditDeleteToLineBegin = +EditLeft = left; ctrl-b +EditRight = right; ctrl-f +EditUp = up; ctrl-p +EditDown = down; ctrl-n +EditEnter = enter +EditReturn = shift-enter +EditBackSpace = backspace +EditDelete = delete +EditPageUp = pgup; alt-v +EditPageDown = pgdn; ctrl-v +EditWordLeft = ctrl-left; alt-b +EditWordRight = ctrl-right; alt-f +EditHome = home; ctrl-a +EditEnd = end; ctrl-e +EditTab = tab +EditUndo = ctrl-u +EditBeginningOfText = ctrl-home; alt-lt +EditEndOfText = ctrl-end; alt-gt +EditScrollUp = ctrl-up +EditScrollDown = ctrl-down +EditBeginPage = ctrl-pgup +EditEndPage = ctrl-pgdn +EditDeleteWordLeft = alt-backspace +EditDeleteWordRight = alt-d +EditParagraphUp = +EditParagraphDown = +EditSave = f2 +EditLoad = +EditSaveas = f12 +EditMark = f3; ctrl-at +EditCopy = f5 +EditMove = f6 +EditRemove = f8 +EditMarkAll = +EditUnmark = +EditFind = f7; ctrl-s +EditMarkLine = +EditMarkWord = +EditShiftBlockLeft = +EditShiftBlockRight = +EditPageUpHighlight = shift-pgup +EditPageDownHighlight = shift-pgdn +EditLeftHighlight = shift-left +EditRightHighlight = shift-right +EditWordLeftHighlight = ctrl-shift-left +EditWordRightHighlight = ctrl-shift-right +EditUpHighlight = shift-up +EditDownHighlight = shift-down +EditHomeHighlight = shift-home +EditEndHighlight = shift-end +EditBeginningOfTextHighlight = ctrl-shift-home +EditEndOfTextHighlight = ctrl-shift-end +EditBeginPageHighlight = ctrl-shift-pgup +EditEndPageHighlight = ctrl-shift-pgdn +EditScrollUpHighlight = ctrl-shift-up +EditScrollDownHighlight = ctrl-shift-down +EditParagraphUpHighlight = +EditParagraphDownHighlight = +EditPageUpAltHighlight = alt-pgup +EditPageDownAltHighlight = alt-pgdn +EditLeftAltHighlight = alt-left +EditRightAltHighlight = alt-right +EditWordLeftAltHighlight = ctrl-alt-left +EditWordRightAltHighlight = ctrl-alt-right +EditUpAltHighlight = alt-up +EditDownAltHighlight = alt-down +EditHomeAltHighlight = alt-home +EditEndAltHighlight = alt-end +EditBeginningOfTextAltHighlight = ctrl-alt-home +EditEndOfTextHighlight = ctrl-alt-end +EditBeginPageHighlight = ctrl-alt-pgup +EditEndPageAltHighlight = ctrl-alt-pgdn +EditScrollUpAltHighlight = +EditScrollDownAltHighlight = +EditParagraphUpAltHighlight = +EditParagraphDownAltHighlight = +EditSaveBlock = +EditColumnMark = f13 +EditFindAgain = f17 +EditReplace = f4 +EditReplaceAgain = f14 +EditCompleteWord = alt-tab +EditDebugStart = +EditDebugStop = +EditDebugToggleBreak = +EditDebugClear = +EditDebugNext = +EditDebugStep = +EditDebugBackTrace = +EditDebugContinue = +EditDebugEnterCommand = +EditDebugUntilCurser = +EditInsertFile = f15 +EditQuit = f10 +EditToggleInsert = insert +EditHelp = f1 +EditDate = +EditRefresh = ctrl-l +EditGoto = alt-l +EditManPage = +EditSort = alt-t +EditMail = +EditCancel = +EditComplete = +EditParagraphFormat = alt-p +EditUtil = +EditTypeLoadPython = +EditFindFile = +EditCtags = +EditMatchBracket = +EditTerminal = +EditTerminalApp = +EditExtCmd = alt-u +EditUserMenu = f11 +EditSaveDesktop = +EditNewWindow = +EditCycle = +EditMenu = f9 +EditSaveAndQuit = +EditRunAnother = +EditCheckSaveAndQuit = +EditMaximize = +EditToggleBookmark = +EditFlushBookmarks = +EditNextBookmark = +EditPrevBookmark = +EditSelectionHistory = +EditShell = ctrl-o +EditInsertLiteral = ctrl-q +EditBeginRecordMacro = +EditEndRecordMacro = +EditBeginOrEndMacro = ctrl-r +EditDeleteMacro = +EditToggleLineState = alt-n +EditToggleTabTWS = alt-underline +EditToggleSyntax = ctrl-s +EditToggleShowMargin = +EditFindDefinition = alt-enter +EditLoadPrevFile = alt-minus +EditLoadNextFile = alt-plus +EditBeginEndRepeat = +SelectCodepage = alt-e +EditExtMode = ctrl-x +[editor:xmap] +EditNew = k + +[viewer] +ViewHelp = f1 +ViewToggleWrapMode = f2 +ViewQuit = f3; f10; q; esc; ctrl-g +ViewToggleHexMode = f4 +ViewGoto = f5 +ViewSearch = f7; question; slash +ViewToggleMagicMode = f8 +ViewToggleNroffMode = f9 +ViewContinueSearch = ctrl-r; ctrl-s; f17; n +ViewMoveToBol = ctrl-a +ViewMoveToEol = ctrl-e +ViewMoveLeft = h; left +ViewMoveRight = l; right +ViewMoveLeft10 = ctrl-left +ViewMoveRight10 = ctrl-right +ViewMoveUp = k; y; insert; up; ctrl-p +ViewMoveDown = j; e; delete; down; enter; ctrl-n +ViewMovePgDn = f; space; pgdn; ctrl-v +ViewMovePgUp = b; pgup; alt-v; backspace +ViewMoveHalfPgDn = d +ViewMoveHalfPgUp = u +ViewMoveTop = home; ctrl-home; ctrl-pgup; a1; alt-lt; g +ViewMoveBottom = end; ctrl-end; ctrl-pgdn; c1; alt-gt; shift-g +ViewGotoBookmark = m +ViewNewBookmark = r +ViewNextFile = ctrl-f +ViewPrevFile = ctrl-b +SelectCodepage = alt-e +ShowCommandLine = ctrl-o +ViewToggleRuler = alt-r + +[viewer:hex] +ViewHelp = f1 +ViewToggleHexEditMode = f2 +ViewQuit = f3; f10; q; esc; ctrl-g +ViewToggleHexMode = f4 +ViewGoto = f5 +ViewHexEditSave = f6 +ViewSearch = f7; question; slash +ViewToggleMagicMode = f8 +ViewToggleNroffMode = f9 +ViewToggleHexNavMode = tab +ViewMoveToBol = ctrl-a; home +ViewMoveToEol = ctrl-e; end +ViewMoveLeft = b; left +ViewMoveRight = f; right +ViewMoveUp = k; y; up +ViewMoveDown = j; delete; down +ViewMovePgDn = pgdn; ctrl-v +ViewMovePgUp = pgup; alt-v +ViewMoveTop = home; ctrl-home; ctrl-pgup; a1; alt-lt; g +ViewMoveBottom = end; ctrl-end; ctrl-pgdn; c1; alt-gt; shift-g [diffviewer] DiffDisplaySymbols = alt-s; s diff --git a/src/keybind-defaults.c b/src/keybind-defaults.c index 2b2626261..0f0734f81 100644 --- a/src/keybind-defaults.c +++ b/src/keybind-defaults.c @@ -31,42 +31,473 @@ /*** global variables ****************************************************************************/ -#ifdef USE_INTERNAL_EDIT -GArray *editor_keymap = NULL; -GArray *editor_x_keymap = NULL; - -const global_keymap_t *editor_map; -const global_keymap_t *editor_x_map; -#endif - GArray *main_keymap = NULL; GArray *main_x_keymap = NULL; -GArray *viewer_keymap = NULL; -GArray *viewer_hex_keymap = NULL; GArray *panel_keymap = NULL; +GArray *dialog_keymap = NULL; GArray *input_keymap = NULL; GArray *listbox_keymap = NULL; GArray *tree_keymap = NULL; GArray *help_keymap = NULL; -GArray *dialog_keymap = NULL; - +#ifdef USE_INTERNAL_EDIT +GArray *editor_keymap = NULL; +GArray *editor_x_keymap = NULL; +#endif +GArray *viewer_keymap = NULL; +GArray *viewer_hex_keymap = NULL; #ifdef USE_DIFF_VIEW GArray *diff_keymap = NULL; - -const global_keymap_t *diff_map; #endif const global_keymap_t *main_map; const global_keymap_t *main_x_map; const global_keymap_t *panel_map; +const global_keymap_t *dialog_map; const global_keymap_t *input_map; const global_keymap_t *listbox_map; const global_keymap_t *tree_map; const global_keymap_t *help_map; -const global_keymap_t *dialog_map; +#ifdef USE_INTERNAL_EDIT +const global_keymap_t *editor_map; +const global_keymap_t *editor_x_map; +#endif +#ifdef USE_DIFF_VIEW +const global_keymap_t *diff_map; +#endif /*** global variables ****************************************************************************/ +/* midnight */ +const global_keymap_t default_main_map[] = { + {KEY_F (1), CK_HelpCmd, "F1"}, + {KEY_F (2), CK_UserMenuCmd, "F2"}, + {KEY_F (3), CK_ViewCmd, "F3"}, + {KEY_F (4), CK_EditCmd, "F4"}, + {KEY_F (5), CK_CopyCmd, "F5"}, + {KEY_F (6), CK_RenameCmd, "F6"}, + {KEY_F (7), CK_MkdirCmd, "F7"}, + {KEY_F (8), CK_DeleteCmd, "F8"}, + {KEY_F (9), CK_MenuCmd, "F9"}, + {KEY_F (10), CK_QuitCmd, "F10"}, + {KEY_F (13), CK_ViewFileCmd, "S-F3"}, + {KEY_F (19), CK_MenuLastSelectedCmd, "S-F9"}, + {KEY_F (20), CK_QuietQuitCmd, "S-10"}, + {ALT ('h'), CK_HistoryCmd, "M-h"}, + {XCTRL ('@'), CK_SingleDirsizeCmd, "C-Space"}, + /* Copy useful information to the command line */ + {ALT ('a'), CK_CopyCurrentPathname, "M-a"}, + {ALT ('A'), CK_CopyOtherPathname, "M-A"}, + {ALT ('c'), CK_QuickCdCmd, "M-c"}, + /* To access the directory hotlist */ + {XCTRL ('\\'), CK_QuickChdirCmd, "C-\\"}, + /* Suspend */ + {XCTRL ('z'), CK_SuspendCmd, "C-z"}, + /* The filtered view command */ + {ALT ('!'), CK_FilteredViewCmd, "M-!"}, + /* Find file */ + {ALT ('?'), CK_FindCmd, "M-?"}, + /* Panel refresh */ + {XCTRL ('r'), CK_RereadCmd, "C-r"}, + /* Toggle listing between long, user defined and full formats */ + {ALT ('t'), CK_ToggleListingCmd, "M-t"}, + /* Swap panels */ + {XCTRL ('u'), CK_SwapCmd, "C-u"}, + /* View output */ + {XCTRL ('o'), CK_ShowCommandLine, "C-o"}, + {ALT ('.'), CK_ToggleShowHidden, "M-."}, + {ALT (','), CK_TogglePanelsSplit, "M-,"}, + {XCTRL ('x'), CK_StartExtMap1, "C-x"}, + /* Select/unselect group */ + {KEY_KP_ADD, CK_SelectCmd, "+"}, + {KEY_KP_SUBTRACT, CK_UnselectCmd, "-"}, + {ALT ('*'), CK_ReverseSelectionCmd, "*"}, + + {ALT ('`'), CK_DialogListCmd, "M-`"}, + {ALT ('}'), CK_DialogNextCmd, "M-}"}, + {ALT ('{'), CK_DialogPrevCmd, "M-{"}, + + {0, CK_Ignore_Key, ""} +}; + +const global_keymap_t default_main_x_map[] = { + {'d', CK_CompareDirsCmd, "d"}, +#ifdef USE_DIFF_VIEW + {XCTRL ('d'), CK_DiffViewCmd, "C-d"}, +#endif /* USE_DIFF_VIEW */ +#ifdef ENABLE_VFS + {'a', CK_ReselectVfs, "a"}, +#endif /* ENABLE_VFS */ + {'p', CK_CopyCurrentPathname, "p"}, + {XCTRL ('p'), CK_CopyOtherPathname, "C-p"}, + {'t', CK_CopyCurrentTagged, "t"}, + {XCTRL ('t'), CK_CopyOtherTagged, "C-t"}, + {'c', CK_ChmodCmd, "c"}, + {'o', CK_ChownCmd, "o"}, + {'r', CK_CopyCurrentReadlink, "r"}, + {XCTRL ('r'), CK_CopyOtherReadlink, "C-r"}, + {'l', CK_LinkCmd, "l"}, + {'s', CK_SymlinkCmd, "s"}, + {'v', CK_RelativeSymlinkCmd, "v"}, + {XCTRL ('s'), CK_EditSymlinkCmd, "C-s"}, + {'i', CK_InfoCmd, "i"}, + {'q', CK_QuickViewCmd, "q"}, + {'h', CK_AddHotlist, "h"}, + {'!', CK_ExternalPanelize, "!"}, +#ifdef WITH_BACKGROUND + {'j', CK_JobsCmd, "j"}, +#endif /* WITH_BACKGROUND */ + {0, CK_Ignore_Key, ""} +}; + +/* panel */ +const global_keymap_t default_panel_keymap[] = { + {ALT ('o'), CK_PanelChdirOtherPanel, "M-o"}, + {ALT ('l'), CK_PanelChdirToReadlink, "M-l"}, + {KEY_F (15), CK_PanelCmdCopyLocal, "S-F5"}, + {KEY_F (18), CK_PanelCmdDeleteLocal, "S-F8"}, + {KEY_ENTER, CK_PanelCmdDoEnter, "Enter"}, + {'\n', CK_PanelCmdDoEnter, "Enter"}, + {KEY_F (14), CK_PanelCmdEditNew, "S-F4"}, + {KEY_F (16), CK_PanelCmdRenameLocal, "S-F6"}, + {ALT ('*'), CK_PanelCmdReverseSelection, "M-*"}, + {KEY_KP_ADD, CK_PanelCmdSelect, "M-+"}, + {KEY_KP_SUBTRACT, CK_PanelCmdUnselect, "M--"}, + {KEY_F (13), CK_PanelCmdViewSimple, "S-F3"}, + {KEY_M_CTRL | KEY_NPAGE, CK_PanelGotoChildDir, "C-PgDn"}, + {KEY_M_CTRL | KEY_PPAGE, CK_PanelGotoParentDir, "C-PgUp"}, + {ALT ('H'), CK_PanelDirectoryHistoryList, "M-H"}, + {ALT ('u'), CK_PanelDirectoryHistoryNext, "M-u"}, + {ALT ('y'), CK_PanelDirectoryHistoryPrev, "M-y"}, + {ALT ('j'), CK_PanelGotoBottomFile, "M-j"}, + {ALT ('r'), CK_PanelGotoMiddleFile, "M-r"}, + {ALT ('g'), CK_PanelGotoTopFile, "M-g"}, + {KEY_IC, CK_PanelMarkFile, "Insert"}, + {KEY_UP, CK_PanelMoveUp, "Up"}, + {KEY_DOWN, CK_PanelMoveDown, "Down"}, + {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, "A1"}, + {KEY_NPAGE, CK_PanelNextPage, "PgDn"}, + {KEY_PPAGE, CK_PanelPrevPage, "PgUp"}, + {ALT ('e'), CK_PanelSetPanelEncoding, "M-e"}, + {XCTRL ('s'), CK_PanelStartSearch, "C-s"}, + {ALT ('s'), CK_PanelStartSearch, "M-s"}, + {ALT ('i'), CK_PanelSyncOtherPanel, "M-i"}, + {0, CK_Ignore_Key, ""} +}; + +/* dialog */ +const global_keymap_t default_dialog_keymap[] = { + {'\n', CK_DialogOK, "Enter"}, + {KEY_ENTER, CK_DialogOK, "Enter"}, + {ESC_CHAR, CK_DialogCancel, "Esc"}, + {XCTRL ('g'), CK_DialogCancel, "C-g"}, + {KEY_F (10), CK_DialogCancel, "F10"}, + {KEY_LEFT, CK_DialogPrevItem, "Left"}, + {KEY_UP, CK_DialogPrevItem, "Up"}, + {KEY_RIGHT, CK_DialogNextItem, "Right"}, + {KEY_DOWN, CK_DialogNextItem, "Down"}, + {KEY_F (1), CK_DialogHelp, "F1"}, + {XCTRL ('z'), CK_DialogSuspend, "C-z"}, + {XCTRL ('l'), CK_DialogRefresh, "C-l"}, + {0, CK_Ignore_Key, ""} +}; + +const global_keymap_t default_input_keymap[] = { + /* Motion */ + {XCTRL ('a'), CK_InputBol, "C-a"}, + {KEY_HOME, CK_InputBol, "Home"}, + {KEY_A1, CK_InputBol, "A1"}, + {ALT ('<'), CK_InputBol, "M-<"}, + {XCTRL ('e'), CK_InputEol, "C-e"}, + {KEY_END, 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"}, + {KEY_M_CTRL | KEY_RIGHT, CK_InputWordRight, "C-Right"}, + + {XCTRL ('b'), CK_InputBackwardChar, "C-b"}, + {ALT ('b'), CK_InputBackwardWord, "M-b"}, + {XCTRL ('f'), CK_InputForwardChar, "C-f"}, + {ALT ('f'), CK_InputForwardWord, "M-f"}, + + /* Editing */ + {KEY_BACKSPACE, CK_InputBackwardDelete, "BackSpace"}, + {KEY_BACKSPACE, CK_InputBackwardDelete, "C-h"}, + {KEY_DC, CK_InputDeleteChar, "Delete"}, + {KEY_DC, CK_InputDeleteChar, "C-d"}, + {ALT ('d'), CK_InputKillWord, "M-d"}, + {ALT (KEY_BACKSPACE), CK_InputBackwardKillWord, "M-BackSpace"}, + + /* Region manipulation */ + {XCTRL ('w'), CK_InputKillRegion, "C-w"}, + {ALT ('w'), CK_InputKillSave, "M-w"}, + {XCTRL ('y'), CK_InputYank, "C-y"}, + {XCTRL ('k'), CK_InputKillLine, "C-k"}, + + /* History */ + {ALT ('p'), CK_InputHistoryPrev, "M-p"}, + {ALT ('n'), CK_InputHistoryNext, "M-n"}, + {ALT ('h'), CK_InputHistoryShow, "M-h"}, + + /* Completion */ + {ALT ('\t'), CK_InputComplete, "M-tab"}, + + {0, CK_Ignore_Key, ""} +}; + +const global_keymap_t default_listbox_keymap[] = { + {KEY_UP, CK_ListboxMoveUp, "Up"}, + {XCTRL ('p'), CK_ListboxMoveUp, "C-p"}, + {KEY_DOWN, CK_ListboxMoveDown, "Down"}, + {XCTRL ('n'), CK_ListboxMoveDown, "C-n"}, + {KEY_HOME, CK_ListboxMoveHome, "Home"}, + {ALT ('<'), CK_ListboxMoveHome, "M-<"}, + {KEY_A1, CK_ListboxMoveHome, "A1"}, + {KEY_END, CK_ListboxMoveEnd, "End"}, + {ALT ('>'), CK_ListboxMoveEnd, "M->"}, + {KEY_C1, CK_ListboxMoveEnd, "C1"}, + {KEY_PPAGE, CK_ListboxMovePgUp, "PgUp"}, + {ALT ('v'), CK_ListboxMovePgUp, "M-v"}, + {KEY_NPAGE, CK_ListboxMovePgDn, "PgDn"}, + {XCTRL ('v'), CK_ListboxMovePgDn, "C-v"}, + {KEY_DC, CK_ListboxDeleteItem, "Delete"}, + {'d', CK_ListboxDeleteItem, "d"}, + {KEY_M_SHIFT | KEY_DC, CK_ListboxDeleteAll, "S-Delete"}, + {'D', CK_ListboxDeleteAll, "D"}, + {0, CK_Ignore_Key, ""} +}; + +/* tree */ +const global_keymap_t default_tree_keymap[] = { + {KEY_F (1), CK_TreeHelp, "F1"}, + {KEY_F (2), CK_TreeRescan, "F2"}, + {KEY_F (3), CK_TreeForget, "F3"}, + {KEY_F (4), CK_TreeToggleNav, "F4"}, + {KEY_F (5), CK_TreeCopy, "F5"}, + {KEY_F (6), CK_TreeMove, "F6"}, +#if 0 + {KEY_F (7), CK_TreeMake, "F7"}, +#endif + {KEY_F (8), CK_TreeRemove, "F8"}, + {KEY_UP, CK_TreeMoveUp, "Up"}, + {XCTRL ('p'), CK_TreeMoveUp, "C-p"}, + {KEY_DOWN, CK_TreeMoveDown, "Down"}, + {XCTRL ('n'), CK_TreeMoveDown, "C-n"}, + {KEY_LEFT, CK_TreeMoveLeft, "Left"}, + {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"}, + {XCTRL ('v'), CK_TreeMovePgDn, "C-v"}, + {'\n', CK_TreeOpen, "Enter"}, + {KEY_ENTER, CK_TreeOpen, "Enter"}, + {XCTRL ('r'), CK_TreeRescan, "C-r"}, + {XCTRL ('s'), CK_TreeStartSearch, "C-s"}, + {ALT ('s'), CK_TreeStartSearch, "M-s"}, + {KEY_DC, CK_TreeRemove, "Delete"}, + {0, CK_Ignore_Key, ""} +}; + +/* help */ +const global_keymap_t default_help_keymap[] = { + {KEY_F (1), CK_HelpHelp, "F1"}, + {KEY_F (2), CK_HelpIndex, "F2"}, + {KEY_F (3), CK_HelpBack, "F3"}, + {KEY_F (10), CK_HelpQuit, "F10"}, + {KEY_LEFT, CK_HelpBack, "Left"}, + {'l', CK_HelpBack, "l"}, + {KEY_DOWN, CK_HelpMoveDown, "Down"}, + {XCTRL ('n'), CK_HelpMoveDown, "C-n"}, + {KEY_UP, CK_HelpMoveUp, "Up"}, + {XCTRL ('p'), CK_HelpMoveUp, "C-p"}, + {KEY_NPAGE, CK_HelpMovePgDn, "PgDn"}, + {XCTRL ('v'), CK_HelpMovePgDn, "C-v"}, + {'f', CK_HelpMovePgDn, "f"}, + {' ', CK_HelpMovePgDn, "Space"}, + {KEY_PPAGE, CK_HelpMovePgUp, "PgUp"}, + {ALT ('v'), CK_HelpMovePgUp, "M-v"}, + {'b', CK_HelpMovePgUp, "b"}, + {KEY_BACKSPACE, CK_HelpMovePgUp, "BackSpace"}, + {'d', CK_HelpMoveHalfPgDn, "d"}, + {'u', CK_HelpMoveHalfPgUp, "u"}, + {KEY_HOME, CK_HelpMoveTop, "Home"}, + {KEY_M_CTRL | KEY_HOME, CK_HelpMoveTop, "C-Home"}, + {KEY_M_CTRL | KEY_PPAGE, CK_HelpMoveTop, "C-PgUp"}, + {KEY_A1, CK_HelpMoveTop, "A1"}, + {ALT ('<'), CK_HelpMoveTop, "M-<"}, + {'g', CK_HelpMoveTop, "g"}, + {KEY_END, CK_HelpMoveBottom, "End"}, + {KEY_M_CTRL | KEY_END, CK_HelpMoveBottom, "C-End"}, + {KEY_M_CTRL | KEY_NPAGE, CK_HelpMoveBottom, "C-PgDn"}, + {KEY_C1, CK_HelpMoveBottom, "C1"}, + {ALT ('>'), CK_HelpMoveBottom, "M->"}, + {'G', CK_HelpMoveBottom, "G"}, + {KEY_RIGHT, CK_HelpSelectLink, "Right"}, + {KEY_ENTER, CK_HelpSelectLink, "Enter"}, + {'\n', CK_HelpSelectLink, "Enter"}, + {'\t', CK_HelpNextLink, "Tab"}, + {ALT ('\t'), CK_HelpPrevLink, "M-Tab"}, + {'n', CK_HelpNextNode, "n"}, + {'p', CK_HelpPrevNode, "p"}, + {ESC_CHAR, CK_HelpQuit, "Esc"}, + {XCTRL ('g'), CK_HelpQuit, "C-g"}, + {0, CK_Ignore_Key, ""} +}; + +#ifdef USE_INTERNAL_EDIT +/* editor/editkeys.c */ +const global_keymap_t default_editor_keymap[] = { + {'\n', CK_Enter, "Enter"}, + {'\t', CK_Tab, "Tab"}, + + {KEY_F (1), CK_Help, "F1"}, + {KEY_F (2), CK_Save, "F2"}, + {KEY_F (3), CK_Mark, "F3"}, + {KEY_F (4), CK_Replace, "F4"}, + {KEY_F (5), CK_Copy, "F5"}, + {KEY_F (6), CK_Move, "F6"}, + {KEY_F (7), CK_Find, "F7"}, + {KEY_F (8), CK_Remove, "F8"}, + {KEY_F (9), CK_Menu, "F9"}, + {KEY_F (10), CK_Quit, "F10"}, + /* edit user menu */ + {KEY_F (11), CK_User_Menu, "S-F1"}, + {KEY_F (12), CK_Save_As, "S-F2"}, + {KEY_F (13), CK_Column_Mark, "S-F3"}, + {KEY_F (14), CK_Replace_Again, "S-F4"}, + {KEY_F (15), CK_Insert_File, "S-F5"}, + {KEY_F (17), CK_Find_Again, "S-F7"}, + /* C formatter */ + {KEY_F (19), CK_Pipe_Block (0), "S-F9"}, + + {ESC_CHAR, CK_Quit, "Esc"}, + {KEY_BACKSPACE, CK_BackSpace, "BackSpace"}, + {KEY_BACKSPACE, CK_BackSpace, "C-h"}, + {KEY_DC, CK_Delete, "Delete"}, + {KEY_DC, CK_Delete, "C-d"}, + {KEY_DOWN, CK_Down, "Down"}, + {KEY_END, CK_End, "End"}, + {KEY_HOME, CK_Home, "Home"}, + {KEY_IC, CK_Toggle_Insert, "Insert"}, + {KEY_LEFT, CK_Left, "Left"}, + {KEY_NPAGE, CK_Page_Down, "PgDn"}, + {KEY_PPAGE, CK_Page_Up, "PgUp"}, + {KEY_RIGHT, CK_Right, "Right"}, + {KEY_UP, CK_Up, "Up"}, + + /* Ctrl */ + {KEY_M_CTRL | (KEY_F (2)), CK_Save_As, "C-F2"}, + {KEY_M_CTRL | (KEY_F (4)), CK_Replace_Again, "C-F4"}, + {KEY_M_CTRL | (KEY_F (7)), CK_Find_Again, "C-F7"}, + {KEY_M_CTRL | KEY_BACKSPACE, CK_Undo, "C-BackSpace"}, + {KEY_M_CTRL | KEY_NPAGE, CK_End_Of_Text, "C-PgDn"}, + {KEY_M_CTRL | KEY_PPAGE, CK_Beginning_Of_Text, "C-PgUp"}, + {KEY_M_CTRL | KEY_HOME, CK_Beginning_Of_Text, "C-Home"}, + {KEY_M_CTRL | KEY_END, CK_End_Of_Text, "C-End"}, + {KEY_M_CTRL | KEY_UP, CK_Scroll_Up, "C-Up"}, + {KEY_M_CTRL | KEY_DOWN, CK_Scroll_Down, "C-Down"}, + {KEY_M_CTRL | KEY_LEFT, CK_Word_Left, "C-Left"}, + {XCTRL ('z'), CK_Word_Left, "C-z"}, + {KEY_M_CTRL | KEY_RIGHT, CK_Word_Right, "C-Right"}, + {XCTRL ('x'), CK_Word_Right, "C-x"}, + {KEY_M_CTRL | KEY_IC, CK_XStore, "C-Insert"}, + {KEY_M_CTRL | KEY_DC, CK_Remove, "C-Delete"}, + + {XCTRL ('n'), CK_New, "C-n"}, + {XCTRL ('k'), CK_Delete_To_Line_End, "C-k"}, + {XCTRL ('l'), CK_Refresh, "C-l"}, + {XCTRL ('o'), CK_Shell, "C-o"}, + {XCTRL ('s'), CK_Toggle_Syntax, "C-s"}, + {XCTRL ('u'), CK_Undo, "C-u"}, + {ALT ('r'), CK_Redo, "M-r"}, + {ALT ('e'), CK_SelectCodepage, "M-e"}, + {XCTRL ('q'), CK_Insert_Literal, "C-q"}, + {XCTRL ('r'), CK_Begin_End_Macro, "C-r"}, + {XCTRL ('r'), CK_Begin_Record_Macro, "C-r"}, + {XCTRL ('r'), CK_End_Record_Macro, "C-r"}, + {XCTRL ('f'), CK_Save_Block, "C-f"}, + /* Spell check */ + {XCTRL ('p'), CK_Pipe_Block (1), "C-p"}, + {XCTRL ('y'), CK_Delete_Line, "C-y"}, + + /* Shift */ + {KEY_M_SHIFT | KEY_NPAGE, CK_Page_Down_Highlight, "S-PgDn"}, + {KEY_M_SHIFT | KEY_PPAGE, CK_Page_Up_Highlight, "S-PgUp"}, + {KEY_M_SHIFT | KEY_LEFT, CK_Left_Highlight, "S-Left"}, + {KEY_M_SHIFT | KEY_RIGHT, CK_Right_Highlight, "S-Right"}, + {KEY_M_SHIFT | KEY_UP, CK_Up_Highlight, "S-Up"}, + {KEY_M_SHIFT | KEY_DOWN, CK_Down_Highlight, "S-Down"}, + {KEY_M_SHIFT | KEY_HOME, CK_Home_Highlight, "S-Home"}, + {KEY_M_SHIFT | KEY_END, CK_End_Highlight, "S-End"}, + {KEY_M_SHIFT | KEY_IC, CK_XPaste, "S-Insert"}, + {KEY_M_SHIFT | KEY_DC, CK_XCut, "S-Delete"}, + /* useful for pasting multiline text */ + {KEY_M_SHIFT | '\n', CK_Return, "S-Enter"}, + + /* Ctrl + Shift */ + {KEY_M_SHIFT | KEY_M_CTRL | KEY_NPAGE, CK_End_Of_Text_Highlight, "C-S-PgDn"}, + {KEY_M_SHIFT | KEY_M_CTRL | KEY_PPAGE, CK_Beginning_Of_Text_Highlight, "C-S-PgUp"}, + {KEY_M_SHIFT | KEY_M_CTRL | KEY_LEFT, CK_Word_Left_Highlight, "C-S-Left"}, + {KEY_M_SHIFT | KEY_M_CTRL | KEY_RIGHT, CK_Word_Right_Highlight, "C-S-Right"}, + {KEY_M_SHIFT | KEY_M_CTRL | KEY_UP, CK_Scroll_Up_Highlight, "C-S-Up"}, + {KEY_M_SHIFT | KEY_M_CTRL | KEY_DOWN, CK_Scroll_Down_Highlight, "C-S-Down"}, + + /* Alt */ + {KEY_M_ALT | KEY_NPAGE, CK_Page_Down_Alt_Highlight, "M-PgDn"}, + {KEY_M_ALT | KEY_PPAGE, CK_Page_Up_Alt_Highlight, "M-PgUp"}, + {KEY_M_ALT | KEY_LEFT, CK_Left_Alt_Highlight, "M-Left"}, + {KEY_M_ALT | KEY_RIGHT, CK_Right_Alt_Highlight, "M-Right"}, + {KEY_M_ALT | KEY_UP, CK_Up_Alt_Highlight, "M-Up"}, + {KEY_M_ALT | KEY_DOWN, CK_Down_Alt_Highlight, "M-Down"}, + {KEY_M_ALT | KEY_HOME, CK_Home_Highlight, "M-Home"}, + {KEY_M_ALT | KEY_END, CK_End_Alt_Highlight, "M-End"}, + + {ALT ('\n'), CK_Find_Definition, "M-Enter"}, + {ALT ('\t'), CK_Complete_Word, "M-Tab"}, + {ALT ('l'), CK_Goto, "M-l"}, + {ALT ('L'), CK_Goto, "M-L"}, + {ALT ('p'), CK_Paragraph_Format, "M-p"}, + {ALT ('t'), CK_Sort, "M-t"}, + {ALT ('u'), CK_ExtCmd, "M-u"}, + {ALT ('<'), CK_Beginning_Of_Text, "M-<"}, + {ALT ('>'), CK_End_Of_Text, "M->"}, + {ALT ('-'), CK_Load_Prev_File, "M--"}, + {ALT ('+'), CK_Load_Next_File, "M-+"}, + {ALT ('d'), CK_Delete_Word_Right, "M-d"}, + {ALT (KEY_BACKSPACE), CK_Delete_Word_Left, "M-BackSpace"}, + {ALT ('n'), CK_Toggle_Line_State, "M-n"}, + {ALT ('_'), CK_Toggle_Tab_TWS, "M-_"}, + {ALT ('k'), CK_Toggle_Bookmark, "M-k"}, + {ALT ('i'), CK_Prev_Bookmark, "M-i"}, + {ALT ('j'), CK_Next_Bookmark, "M-j"}, + {ALT ('o'), CK_Flush_Bookmarks, "M-o"}, + {ALT ('b'), CK_Match_Bracket, "M-b"}, + {ALT ('m'), CK_Mail, "M-m"}, + + {XCTRL ('x'), CK_Ext_Mode, "C-x"}, + + {0, CK_Ignore_Key, ""} +}; + +/* emacs keyboard layout emulation */ +const global_keymap_t default_editor_x_keymap[] = { + {'k', CK_New, "k"}, + {0, CK_Ignore_Key, ""} +}; +#endif /* USE_INTERNAL_EDIT */ + /* viewer/actions_cmd.c */ const global_keymap_t default_viewer_keymap[] = { {KEY_F (1), CK_ViewHelp, "F1"}, @@ -222,442 +653,10 @@ const global_keymap_t default_viewer_hex_keymap[] = { {0, CK_Ignore_Key, ""} }; -#ifdef USE_INTERNAL_EDIT -/* ../edit/editkeys.c */ -const global_keymap_t default_editor_keymap[] = { - {'\n', CK_Enter, "Enter"}, - {'\t', CK_Tab, "Tab"}, - - {KEY_F (1), CK_Help, "F1"}, - {KEY_F (2), CK_Save, "F2"}, - {KEY_F (3), CK_Mark, "F3"}, - {KEY_F (4), CK_Replace, "F4"}, - {KEY_F (5), CK_Copy, "F5"}, - {KEY_F (6), CK_Move, "F6"}, - {KEY_F (7), CK_Find, "F7"}, - {KEY_F (8), CK_Remove, "F8"}, - {KEY_F (9), CK_Menu, "F9"}, - {KEY_F (10), CK_Quit, "F10"}, - /* edit user menu */ - {KEY_F (11), CK_User_Menu, "S-F1"}, - {KEY_F (12), CK_Save_As, "S-F2"}, - {KEY_F (13), CK_Column_Mark, "S-F3"}, - {KEY_F (14), CK_Replace_Again, "S-F4"}, - {KEY_F (15), CK_Insert_File, "S-F5"}, - {KEY_F (17), CK_Find_Again, "S-F7"}, - /* C formatter */ - {KEY_F (19), CK_Pipe_Block (0), "S-F9"}, - - {ESC_CHAR, CK_Quit, "Esc"}, - {KEY_BACKSPACE, CK_BackSpace, "BackSpace"}, - {KEY_BACKSPACE, CK_BackSpace, "C-h"}, - {KEY_DC, CK_Delete, "Delete"}, - {KEY_DC, CK_Delete, "C-d"}, - {KEY_DOWN, CK_Down, "Down"}, - {KEY_END, CK_End, "End"}, - {KEY_HOME, CK_Home, "Home"}, - {KEY_IC, CK_Toggle_Insert, "Insert"}, - {KEY_LEFT, CK_Left, "Left"}, - {KEY_NPAGE, CK_Page_Down, "PgDn"}, - {KEY_PPAGE, CK_Page_Up, "PgUp"}, - {KEY_RIGHT, CK_Right, "Right"}, - {KEY_UP, CK_Up, "Up"}, - - /* Ctrl */ - {KEY_M_CTRL | (KEY_F (2)), CK_Save_As, "C-F2"}, - {KEY_M_CTRL | (KEY_F (4)), CK_Replace_Again, "C-F4"}, - {KEY_M_CTRL | (KEY_F (7)), CK_Find_Again, "C-F7"}, - {KEY_M_CTRL | KEY_BACKSPACE, CK_Undo, "C-BackSpace"}, - {KEY_M_CTRL | KEY_NPAGE, CK_End_Of_Text, "C-PgDn"}, - {KEY_M_CTRL | KEY_PPAGE, CK_Beginning_Of_Text, "C-PgUp"}, - {KEY_M_CTRL | KEY_HOME, CK_Beginning_Of_Text, "C-Home"}, - {KEY_M_CTRL | KEY_END, CK_End_Of_Text, "C-End"}, - {KEY_M_CTRL | KEY_UP, CK_Scroll_Up, "C-Up"}, - {KEY_M_CTRL | KEY_DOWN, CK_Scroll_Down, "C-Down"}, - {KEY_M_CTRL | KEY_LEFT, CK_Word_Left, "C-Left"}, - {XCTRL ('z'), CK_Word_Left, "C-z"}, - {KEY_M_CTRL | KEY_RIGHT, CK_Word_Right, "C-Right"}, - {XCTRL ('x'), CK_Word_Right, "C-x"}, - {KEY_M_CTRL | KEY_IC, CK_XStore, "C-Insert"}, - {KEY_M_CTRL | KEY_DC, CK_Remove, "C-Delete"}, - - {XCTRL ('n'), CK_New, "C-n"}, - {XCTRL ('k'), CK_Delete_To_Line_End, "C-k"}, - {XCTRL ('l'), CK_Refresh, "C-l"}, - {XCTRL ('o'), CK_Shell, "C-o"}, - {XCTRL ('s'), CK_Toggle_Syntax, "C-s"}, - {XCTRL ('u'), CK_Undo, "C-u"}, - {ALT ('r'), CK_Redo, "M-r"}, - {ALT ('e'), CK_SelectCodepage, "M-e"}, - {XCTRL ('q'), CK_Insert_Literal, "C-q"}, - {XCTRL ('r'), CK_Begin_End_Macro, "C-r"}, - {XCTRL ('r'), CK_Begin_Record_Macro, "C-r"}, - {XCTRL ('r'), CK_End_Record_Macro, "C-r"}, - {XCTRL ('f'), CK_Save_Block, "C-f"}, - /* Spell check */ - {XCTRL ('p'), CK_Pipe_Block (1), "C-p"}, - {XCTRL ('y'), CK_Delete_Line, "C-y"}, - - /* Shift */ - {KEY_M_SHIFT | KEY_NPAGE, CK_Page_Down_Highlight, "S-PgDn"}, - {KEY_M_SHIFT | KEY_PPAGE, CK_Page_Up_Highlight, "S-PgUp"}, - {KEY_M_SHIFT | KEY_LEFT, CK_Left_Highlight, "S-Left"}, - {KEY_M_SHIFT | KEY_RIGHT, CK_Right_Highlight, "S-Right"}, - {KEY_M_SHIFT | KEY_UP, CK_Up_Highlight, "S-Up"}, - {KEY_M_SHIFT | KEY_DOWN, CK_Down_Highlight, "S-Down"}, - {KEY_M_SHIFT | KEY_HOME, CK_Home_Highlight, "S-Home"}, - {KEY_M_SHIFT | KEY_END, CK_End_Highlight, "S-End"}, - {KEY_M_SHIFT | KEY_IC, CK_XPaste, "S-Insert"}, - {KEY_M_SHIFT | KEY_DC, CK_XCut, "S-Delete"}, - /* useful for pasting multiline text */ - {KEY_M_SHIFT | '\n', CK_Return, "S-Enter"}, - - /* Ctrl + Shift */ - {KEY_M_SHIFT | KEY_M_CTRL | KEY_NPAGE, CK_End_Of_Text_Highlight, "C-S-PgDn"}, - {KEY_M_SHIFT | KEY_M_CTRL | KEY_PPAGE, CK_Beginning_Of_Text_Highlight, "C-S-PgUp"}, - {KEY_M_SHIFT | KEY_M_CTRL | KEY_LEFT, CK_Word_Left_Highlight, "C-S-Left"}, - {KEY_M_SHIFT | KEY_M_CTRL | KEY_RIGHT, CK_Word_Right_Highlight, "C-S-Right"}, - {KEY_M_SHIFT | KEY_M_CTRL | KEY_UP, CK_Scroll_Up_Highlight, "C-S-Up"}, - {KEY_M_SHIFT | KEY_M_CTRL | KEY_DOWN, CK_Scroll_Down_Highlight, "C-S-Down"}, - - /* Alt */ - {KEY_M_ALT | KEY_NPAGE, CK_Page_Down_Alt_Highlight, "M-PgDn"}, - {KEY_M_ALT | KEY_PPAGE, CK_Page_Up_Alt_Highlight, "M-PgUp"}, - {KEY_M_ALT | KEY_LEFT, CK_Left_Alt_Highlight, "M-Left"}, - {KEY_M_ALT | KEY_RIGHT, CK_Right_Alt_Highlight, "M-Right"}, - {KEY_M_ALT | KEY_UP, CK_Up_Alt_Highlight, "M-Up"}, - {KEY_M_ALT | KEY_DOWN, CK_Down_Alt_Highlight, "M-Down"}, - {KEY_M_ALT | KEY_HOME, CK_Home_Highlight, "M-Home"}, - {KEY_M_ALT | KEY_END, CK_End_Alt_Highlight, "M-End"}, - - {ALT ('\n'), CK_Find_Definition, "M-Enter"}, - {ALT ('\t'), CK_Complete_Word, "M-Tab"}, - {ALT ('l'), CK_Goto, "M-l"}, - {ALT ('L'), CK_Goto, "M-L"}, - {ALT ('p'), CK_Paragraph_Format, "M-p"}, - {ALT ('t'), CK_Sort, "M-t"}, - {ALT ('u'), CK_ExtCmd, "M-u"}, - {ALT ('<'), CK_Beginning_Of_Text, "M-<"}, - {ALT ('>'), CK_End_Of_Text, "M->"}, - {ALT ('-'), CK_Load_Prev_File, "M--"}, - {ALT ('+'), CK_Load_Next_File, "M-+"}, - {ALT ('d'), CK_Delete_Word_Right, "M-d"}, - {ALT (KEY_BACKSPACE), CK_Delete_Word_Left, "M-BackSpace"}, - {ALT ('n'), CK_Toggle_Line_State, "M-n"}, - {ALT ('_'), CK_Toggle_Tab_TWS, "M-_"}, - {ALT ('k'), CK_Toggle_Bookmark, "M-k"}, - {ALT ('i'), CK_Prev_Bookmark, "M-i"}, - {ALT ('j'), CK_Next_Bookmark, "M-j"}, - {ALT ('o'), CK_Flush_Bookmarks, "M-o"}, - {ALT ('b'), CK_Match_Bracket, "M-b"}, - {ALT ('m'), CK_Mail, "M-m"}, - - {XCTRL ('x'), CK_Ext_Mode, "C-x"}, - - {0, CK_Ignore_Key, ""} -}; - -/* emacs keyboard layout emulation */ -const global_keymap_t default_editor_x_keymap[] = { - {'k', CK_New, "k"}, - {0, CK_Ignore_Key, ""} -}; -#endif /* USE_INTERNAL_EDIT */ - -/* dialog */ -const global_keymap_t default_dialog_keymap[] = { - {'\n', CK_DialogOK, "Enter"}, - {KEY_ENTER, CK_DialogOK, "Enter"}, - {ESC_CHAR, CK_DialogCancel, "Esc"}, - {XCTRL ('g'), CK_DialogCancel, "C-g"}, - {KEY_F (10), CK_DialogCancel, "F10"}, - {KEY_LEFT, CK_DialogPrevItem, "Left"}, - {KEY_UP, CK_DialogPrevItem, "Up"}, - {KEY_RIGHT, CK_DialogNextItem, "Right"}, - {KEY_DOWN, CK_DialogNextItem, "Down"}, - {KEY_F (1), CK_DialogHelp, "F1"}, - {XCTRL ('z'), CK_DialogSuspend, "C-z"}, - {XCTRL ('l'), CK_DialogRefresh, "C-l"}, - {0, CK_Ignore_Key, ""} -}; - -/* tree */ -const global_keymap_t default_tree_keymap[] = { - {KEY_F (1), CK_TreeHelp, "F1"}, - {KEY_F (2), CK_TreeRescan, "F2"}, - {KEY_F (3), CK_TreeForget, "F3"}, - {KEY_F (4), CK_TreeToggleNav, "F4"}, - {KEY_F (5), CK_TreeCopy, "F5"}, - {KEY_F (6), CK_TreeMove, "F6"}, -#if 0 - {KEY_F (7), CK_TreeMake, "F7"}, -#endif - {KEY_F (8), CK_TreeRemove, "F8"}, - {KEY_UP, CK_TreeMoveUp, "Up"}, - {XCTRL ('p'), CK_TreeMoveUp, "C-p"}, - {KEY_DOWN, CK_TreeMoveDown, "Down"}, - {XCTRL ('n'), CK_TreeMoveDown, "C-n"}, - {KEY_LEFT, CK_TreeMoveLeft, "Left"}, - {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"}, - {XCTRL ('v'), CK_TreeMovePgDn, "C-v"}, - {'\n', CK_TreeOpen, "Enter"}, - {KEY_ENTER, CK_TreeOpen, "Enter"}, - {XCTRL ('r'), CK_TreeRescan, "C-r"}, - {XCTRL ('s'), CK_TreeStartSearch, "C-s"}, - {ALT ('s'), CK_TreeStartSearch, "M-s"}, - {KEY_DC, CK_TreeRemove, "Delete"}, - {0, CK_Ignore_Key, ""} -}; - -/* help */ -const global_keymap_t default_help_keymap[] = { - {KEY_F (1), CK_HelpHelp, "F1"}, - {KEY_F (2), CK_HelpIndex, "F2"}, - {KEY_F (3), CK_HelpBack, "F3"}, - {KEY_F (10), CK_HelpQuit, "F10"}, - {KEY_LEFT, CK_HelpBack, "Left"}, - {'l', CK_HelpBack, "l"}, - {KEY_DOWN, CK_HelpMoveDown, "Down"}, - {XCTRL ('n'), CK_HelpMoveDown, "C-n"}, - {KEY_UP, CK_HelpMoveUp, "Up"}, - {XCTRL ('p'), CK_HelpMoveUp, "C-p"}, - {KEY_NPAGE, CK_HelpMovePgDn, "PgDn"}, - {XCTRL ('v'), CK_HelpMovePgDn, "C-v"}, - {'f', CK_HelpMovePgDn, "f"}, - {' ', CK_HelpMovePgDn, "Space"}, - {KEY_PPAGE, CK_HelpMovePgUp, "PgUp"}, - {ALT ('v'), CK_HelpMovePgUp, "M-v"}, - {'b', CK_HelpMovePgUp, "b"}, - {KEY_BACKSPACE, CK_HelpMovePgUp, "BackSpace"}, - {'d', CK_HelpMoveHalfPgDn, "d"}, - {'u', CK_HelpMoveHalfPgUp, "u"}, - {KEY_HOME, CK_HelpMoveTop, "Home"}, - {KEY_M_CTRL | KEY_HOME, CK_HelpMoveTop, "C-Home"}, - {KEY_M_CTRL | KEY_PPAGE, CK_HelpMoveTop, "C-PgUp"}, - {KEY_A1, CK_HelpMoveTop, "A1"}, - {ALT ('<'), CK_HelpMoveTop, "M-<"}, - {'g', CK_HelpMoveTop, "g"}, - {KEY_END, CK_HelpMoveBottom, "End"}, - {KEY_M_CTRL | KEY_END, CK_HelpMoveBottom, "C-End"}, - {KEY_M_CTRL | KEY_NPAGE, CK_HelpMoveBottom, "C-PgDn"}, - {KEY_C1, CK_HelpMoveBottom, "C1"}, - {ALT ('>'), CK_HelpMoveBottom, "M->"}, - {'G', CK_HelpMoveBottom, "G"}, - {KEY_RIGHT, CK_HelpSelectLink, "Right"}, - {KEY_ENTER, CK_HelpSelectLink, "Enter"}, - {'\n', CK_HelpSelectLink, "Enter"}, - {'\t', CK_HelpNextLink, "Tab"}, - {ALT ('\t'), CK_HelpPrevLink, "M-Tab"}, - {'n', CK_HelpNextNode, "n"}, - {'p', CK_HelpPrevNode, "p"}, - {ESC_CHAR, CK_HelpQuit, "Esc"}, - {XCTRL ('g'), CK_HelpQuit, "C-g"}, - {0, CK_Ignore_Key, ""} -}; - -/* panel */ -const global_keymap_t default_panel_keymap[] = { - {ALT ('o'), CK_PanelChdirOtherPanel, "M-o"}, - {ALT ('l'), CK_PanelChdirToReadlink, "M-l"}, - {KEY_F (15), CK_PanelCmdCopyLocal, "S-F5"}, - {KEY_F (18), CK_PanelCmdDeleteLocal, "S-F8"}, - {KEY_ENTER, CK_PanelCmdDoEnter, "Enter"}, - {'\n', CK_PanelCmdDoEnter, "Enter"}, - {KEY_F (14), CK_PanelCmdEditNew, "S-F4"}, - {KEY_F (16), CK_PanelCmdRenameLocal, "S-F6"}, - {ALT ('*'), CK_PanelCmdReverseSelection, "M-*"}, - {KEY_KP_ADD, CK_PanelCmdSelect, "M-+"}, - {KEY_KP_SUBTRACT, CK_PanelCmdUnselect, "M--"}, - {KEY_F (13), CK_PanelCmdViewSimple, "S-F3"}, - {KEY_M_CTRL | KEY_NPAGE, CK_PanelGotoChildDir, "C-PgDn"}, - {KEY_M_CTRL | KEY_PPAGE, CK_PanelGotoParentDir, "C-PgUp"}, - {ALT ('H'), CK_PanelDirectoryHistoryList, "M-H"}, - {ALT ('u'), CK_PanelDirectoryHistoryNext, "M-u"}, - {ALT ('y'), CK_PanelDirectoryHistoryPrev, "M-y"}, - {ALT ('j'), CK_PanelGotoBottomFile, "M-j"}, - {ALT ('r'), CK_PanelGotoMiddleFile, "M-r"}, - {ALT ('g'), CK_PanelGotoTopFile, "M-g"}, - {KEY_IC, CK_PanelMarkFile, "Insert"}, - {KEY_UP, CK_PanelMoveUp, "Up"}, - {KEY_DOWN, CK_PanelMoveDown, "Down"}, - {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, "A1"}, - {KEY_NPAGE, CK_PanelNextPage, "PgDn"}, - {KEY_PPAGE, CK_PanelPrevPage, "PgUp"}, - {ALT ('e'), CK_PanelSetPanelEncoding, "M-e"}, - {XCTRL ('s'), CK_PanelStartSearch, "C-s"}, - {ALT ('s'), CK_PanelStartSearch, "M-s"}, - {ALT ('i'), CK_PanelSyncOtherPanel, "M-i"}, - {0, CK_Ignore_Key, ""} -}; - -/* main.c */ -const global_keymap_t default_main_map[] = { - {KEY_F (1), CK_HelpCmd, "F1"}, - {KEY_F (2), CK_UserMenuCmd, "F2"}, - {KEY_F (3), CK_ViewCmd, "F3"}, - {KEY_F (4), CK_EditCmd, "F4"}, - {KEY_F (5), CK_CopyCmd, "F5"}, - {KEY_F (6), CK_RenameCmd, "F6"}, - {KEY_F (7), CK_MkdirCmd, "F7"}, - {KEY_F (8), CK_DeleteCmd, "F8"}, - {KEY_F (9), CK_MenuCmd, "F9"}, - {KEY_F (10), CK_QuitCmd, "F10"}, - {KEY_F (13), CK_ViewFileCmd, "S-F3"}, - {KEY_F (19), CK_MenuLastSelectedCmd, "S-F9"}, - {KEY_F (20), CK_QuietQuitCmd, "S-10"}, - {ALT ('h'), CK_HistoryCmd, "M-h"}, - {XCTRL ('@'), CK_SingleDirsizeCmd, "C-Space"}, - /* Copy useful information to the command line */ - {ALT ('a'), CK_CopyCurrentPathname, "M-a"}, - {ALT ('A'), CK_CopyOtherPathname, "M-A"}, - {ALT ('c'), CK_QuickCdCmd, "M-c"}, - /* To access the directory hotlist */ - {XCTRL ('\\'), CK_QuickChdirCmd, "C-\\"}, - /* Suspend */ - {XCTRL ('z'), CK_SuspendCmd, "C-z"}, - /* The filtered view command */ - {ALT ('!'), CK_FilteredViewCmd, "M-!"}, - /* Find file */ - {ALT ('?'), CK_FindCmd, "M-?"}, - /* Panel refresh */ - {XCTRL ('r'), CK_RereadCmd, "C-r"}, - /* Toggle listing between long, user defined and full formats */ - {ALT ('t'), CK_ToggleListingCmd, "M-t"}, - /* Swap panels */ - {XCTRL ('u'), CK_SwapCmd, "C-u"}, - /* View output */ - {XCTRL ('o'), CK_ShowCommandLine, "C-o"}, - {ALT ('.'), CK_ToggleShowHidden, "M-."}, - {ALT (','), CK_TogglePanelsSplit, "M-,"}, - {XCTRL ('x'), CK_StartExtMap1, "C-x"}, - /* Select/unselect group */ - {KEY_KP_ADD, CK_SelectCmd, "+"}, - {KEY_KP_SUBTRACT, CK_UnselectCmd, "-"}, - {ALT ('*'), CK_ReverseSelectionCmd, "*"}, - - {ALT ('`'), CK_DialogListCmd, "M-`"}, - {ALT ('}'), CK_DialogNextCmd, "M-}"}, - {ALT ('{'), CK_DialogPrevCmd, "M-{"}, - - {0, CK_Ignore_Key, ""} -}; - -const global_keymap_t default_main_x_map[] = { - {'d', CK_CompareDirsCmd, "d"}, -#ifdef USE_DIFF_VIEW - {XCTRL ('d'), CK_DiffViewCmd, "C-d"}, -#endif /* USE_DIFF_VIEW */ -#ifdef ENABLE_VFS - {'a', CK_ReselectVfs, "a"}, -#endif /* ENABLE_VFS */ - {'p', CK_CopyCurrentPathname, "p"}, - {XCTRL ('p'), CK_CopyOtherPathname, "C-p"}, - {'t', CK_CopyCurrentTagged, "t"}, - {XCTRL ('t'), CK_CopyOtherTagged, "C-t"}, - {'c', CK_ChmodCmd, "c"}, - {'o', CK_ChownCmd, "o"}, - {'r', CK_CopyCurrentReadlink, "r"}, - {XCTRL ('r'), CK_CopyOtherReadlink, "C-r"}, - {'l', CK_LinkCmd, "l"}, - {'s', CK_SymlinkCmd, "s"}, - {'v', CK_RelativeSymlinkCmd, "v"}, - {XCTRL ('s'), CK_EditSymlinkCmd, "C-s"}, - {'i', CK_InfoCmd, "i"}, - {'q', CK_QuickViewCmd, "q"}, - {'h', CK_AddHotlist, "h"}, - {'!', CK_ExternalPanelize, "!"}, -#ifdef WITH_BACKGROUND - {'j', CK_JobsCmd, "j"}, -#endif /* WITH_BACKGROUND */ - {0, CK_Ignore_Key, ""} -}; - -const global_keymap_t default_input_keymap[] = { - /* Motion */ - {XCTRL ('a'), CK_InputBol, "C-a"}, - {KEY_HOME, CK_InputBol, "Home"}, - {KEY_A1, CK_InputBol, "A1"}, - {ALT ('<'), CK_InputBol, "M-<"}, - {XCTRL ('e'), CK_InputEol, "C-e"}, - {KEY_END, 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"}, - {KEY_M_CTRL | KEY_RIGHT, CK_InputWordRight, "C-Right"}, - - {XCTRL ('b'), CK_InputBackwardChar, "C-b"}, - {ALT ('b'), CK_InputBackwardWord, "M-b"}, - {XCTRL ('f'), CK_InputForwardChar, "C-f"}, - {ALT ('f'), CK_InputForwardWord, "M-f"}, - - /* Editing */ - {KEY_BACKSPACE, CK_InputBackwardDelete, "BackSpace"}, - {KEY_BACKSPACE, CK_InputBackwardDelete, "C-h"}, - {KEY_DC, CK_InputDeleteChar, "Delete"}, - {KEY_DC, CK_InputDeleteChar, "C-d"}, - {ALT ('d'), CK_InputKillWord, "M-d"}, - {ALT (KEY_BACKSPACE), CK_InputBackwardKillWord, "M-BackSpace"}, - - /* Region manipulation */ - {XCTRL ('w'), CK_InputKillRegion, "C-w"}, - {ALT ('w'), CK_InputKillSave, "M-w"}, - {XCTRL ('y'), CK_InputYank, "C-y"}, - {XCTRL ('k'), CK_InputKillLine, "C-k"}, - - /* History */ - {ALT ('p'), CK_InputHistoryPrev, "M-p"}, - {ALT ('n'), CK_InputHistoryNext, "M-n"}, - {ALT ('h'), CK_InputHistoryShow, "M-h"}, - - /* Completion */ - {ALT ('\t'), CK_InputComplete, "M-tab"}, - - {0, CK_Ignore_Key, ""} -}; - -const global_keymap_t default_listbox_keymap[] = { - {KEY_UP, CK_ListboxMoveUp, "Up"}, - {XCTRL ('p'), CK_ListboxMoveUp, "C-p"}, - {KEY_DOWN, CK_ListboxMoveDown, "Down"}, - {XCTRL ('n'), CK_ListboxMoveDown, "C-n"}, - {KEY_HOME, CK_ListboxMoveHome, "Home"}, - {ALT ('<'), CK_ListboxMoveHome, "M-<"}, - {KEY_A1, CK_ListboxMoveHome, "A1"}, - {KEY_END, CK_ListboxMoveEnd, "End"}, - {ALT ('>'), CK_ListboxMoveEnd, "M->"}, - {KEY_C1, CK_ListboxMoveEnd, "C1"}, - {KEY_PPAGE, CK_ListboxMovePgUp, "PgUp"}, - {ALT ('v'), CK_ListboxMovePgUp, "M-v"}, - {KEY_NPAGE, CK_ListboxMovePgDn, "PgDn"}, - {XCTRL ('v'), CK_ListboxMovePgDn, "C-v"}, - {KEY_DC, CK_ListboxDeleteItem, "Delete"}, - {'d', CK_ListboxDeleteItem, "d"}, - {KEY_M_SHIFT | KEY_DC, CK_ListboxDeleteAll, "S-Delete"}, - {'D', CK_ListboxDeleteAll, "D"}, - - {0, CK_Ignore_Key, ""} -}; #ifdef USE_DIFF_VIEW /* diff viewer */ const global_keymap_t default_diff_keymap[] = { - {'s', CK_DiffDisplaySymbols, "s"}, {'l', CK_DiffDisplayNumbers, "l"}, {'f', CK_DiffFull, "f"}, diff --git a/src/keybind-defaults.h b/src/keybind-defaults.h index be7e79610..45a5a17de 100644 --- a/src/keybind-defaults.h +++ b/src/keybind-defaults.h @@ -12,70 +12,64 @@ /*** global variables defined in .c file *********************************************************/ -#ifdef USE_INTERNAL_EDIT -extern GArray *editor_keymap; -extern GArray *editor_x_keymap; - -extern const global_keymap_t *editor_map; -extern const global_keymap_t *editor_x_map; -#endif - -extern GArray *viewer_keymap; -extern GArray *viewer_hex_keymap; extern GArray *main_keymap; extern GArray *main_x_keymap; extern GArray *panel_keymap; +extern GArray *dialog_keymap; extern GArray *input_keymap; extern GArray *listbox_keymap; extern GArray *tree_keymap; extern GArray *help_keymap; -extern GArray *dialog_keymap; +#ifdef USE_INTERNAL_EDIT +extern GArray *editor_keymap; +extern GArray *editor_x_keymap; +#endif +extern GArray *viewer_keymap; +extern GArray *viewer_hex_keymap; #ifdef USE_DIFF_VIEW extern GArray *diff_keymap; #endif + extern const global_keymap_t *main_map; extern const global_keymap_t *main_x_map; extern const global_keymap_t *panel_map; +extern const global_keymap_t *dialog_map; extern const global_keymap_t *input_map; extern const global_keymap_t *listbox_map; extern const global_keymap_t *tree_map; extern const global_keymap_t *help_map; -extern const global_keymap_t *dialog_map; +#ifdef USE_INTERNAL_EDIT +extern const global_keymap_t *editor_map; +extern const global_keymap_t *editor_x_map; +#endif #ifdef USE_DIFF_VIEW extern const global_keymap_t *diff_map; #endif -/* viewer/actions_cmd.c */ -extern const global_keymap_t default_viewer_keymap[]; -extern const global_keymap_t default_viewer_hex_keymap[]; +/* main.c */ +extern const global_keymap_t default_main_map[]; +extern const global_keymap_t default_main_x_map[]; +/* screen.c */ +extern const global_keymap_t default_panel_keymap[]; +/* dialog.c */ +extern const global_keymap_t default_dialog_keymap[]; +/* widget.c */ +extern const global_keymap_t default_input_keymap[]; +extern const global_keymap_t default_listbox_keymap[]; +/* tree.c */ +extern const global_keymap_t default_tree_keymap[]; +/* help.c */ +extern const global_keymap_t default_help_keymap[]; #ifdef USE_INTERNAL_EDIT /* ../edit/editkey.c */ extern const global_keymap_t default_editor_keymap[]; extern const global_keymap_t default_editor_x_keymap[]; #endif - -/* screen.c */ -extern const global_keymap_t default_panel_keymap[]; - -/* widget.c */ -extern const global_keymap_t default_input_keymap[]; -extern const global_keymap_t default_listbox_keymap[]; - -/* main.c */ -extern const global_keymap_t default_main_map[]; -extern const global_keymap_t default_main_x_map[]; - -/* tree.c */ -extern const global_keymap_t default_tree_keymap[]; - -/* help.c */ -extern const global_keymap_t default_help_keymap[]; - -/* dialog.c */ -extern const global_keymap_t default_dialog_keymap[]; - +/* viewer/actions_cmd.c */ +extern const global_keymap_t default_viewer_keymap[]; +extern const global_keymap_t default_viewer_hex_keymap[]; #ifdef USE_DIFF_VIEW /* ydiff.c */ extern const global_keymap_t default_diff_keymap[]; diff --git a/src/setup.c b/src/setup.c index 88803370b..d396a458b 100644 --- a/src/setup.c +++ b/src/setup.c @@ -1167,18 +1167,6 @@ load_keymap_defs (void) if (mc_global_keymap != NULL) { -#ifdef USE_INTERNAL_EDIT - editor_keymap = g_array_new (TRUE, FALSE, sizeof (global_keymap_t)); - load_keymap_from_section ("editor", editor_keymap, mc_global_keymap); - editor_x_keymap = g_array_new (TRUE, FALSE, sizeof (global_keymap_t)); - load_keymap_from_section ("editor:xmap", editor_x_keymap, mc_global_keymap); -#endif - - viewer_keymap = g_array_new (TRUE, FALSE, sizeof (global_keymap_t)); - load_keymap_from_section ("viewer", viewer_keymap, mc_global_keymap); - viewer_hex_keymap = g_array_new (TRUE, FALSE, sizeof (global_keymap_t)); - load_keymap_from_section ("viewer:hex", viewer_hex_keymap, mc_global_keymap); - main_keymap = g_array_new (TRUE, FALSE, sizeof (global_keymap_t)); load_keymap_from_section ("main", main_keymap, mc_global_keymap); main_x_keymap = g_array_new (TRUE, FALSE, sizeof (global_keymap_t)); @@ -1187,6 +1175,9 @@ load_keymap_defs (void) panel_keymap = g_array_new (TRUE, FALSE, sizeof (global_keymap_t)); load_keymap_from_section ("panel", panel_keymap, mc_global_keymap); + dialog_keymap = g_array_new (TRUE, FALSE, sizeof (global_keymap_t)); + load_keymap_from_section ("dialog", dialog_keymap, mc_global_keymap); + input_keymap = g_array_new (TRUE, FALSE, sizeof (global_keymap_t)); load_keymap_from_section ("input", input_keymap, mc_global_keymap); @@ -1199,13 +1190,23 @@ load_keymap_defs (void) help_keymap = g_array_new (TRUE, FALSE, sizeof (global_keymap_t)); load_keymap_from_section ("help", help_keymap, mc_global_keymap); - dialog_keymap = g_array_new (TRUE, FALSE, sizeof (global_keymap_t)); - load_keymap_from_section ("dialog", dialog_keymap, mc_global_keymap); +#ifdef USE_INTERNAL_EDIT + editor_keymap = g_array_new (TRUE, FALSE, sizeof (global_keymap_t)); + load_keymap_from_section ("editor", editor_keymap, mc_global_keymap); + editor_x_keymap = g_array_new (TRUE, FALSE, sizeof (global_keymap_t)); + load_keymap_from_section ("editor:xmap", editor_x_keymap, mc_global_keymap); +#endif + + viewer_keymap = g_array_new (TRUE, FALSE, sizeof (global_keymap_t)); + load_keymap_from_section ("viewer", viewer_keymap, mc_global_keymap); + viewer_hex_keymap = g_array_new (TRUE, FALSE, sizeof (global_keymap_t)); + load_keymap_from_section ("viewer:hex", viewer_hex_keymap, mc_global_keymap); #ifdef USE_DIFF_VIEW diff_keymap = g_array_new (TRUE, FALSE, sizeof (global_keymap_t)); load_keymap_from_section ("diffviewer", diff_keymap, mc_global_keymap); #endif + mc_config_deinit (mc_global_keymap); } @@ -1221,6 +1222,10 @@ load_keymap_defs (void) if (panel_keymap && panel_keymap->len > 0) panel_map = (global_keymap_t *) panel_keymap->data; + dialog_map = default_dialog_keymap; + if (dialog_keymap && dialog_keymap->len > 0) + dialog_map = (global_keymap_t *) dialog_keymap->data; + input_map = default_input_keymap; if (input_keymap && input_keymap->len > 0) input_map = (global_keymap_t *) input_keymap->data; @@ -1237,16 +1242,11 @@ load_keymap_defs (void) if (help_keymap && help_keymap->len > 0) help_map = (global_keymap_t *) help_keymap->data; - dialog_map = default_dialog_keymap; - if (dialog_keymap && dialog_keymap->len > 0) - dialog_map = (global_keymap_t *) dialog_keymap->data; - #ifdef USE_DIFF_VIEW diff_map = default_diff_keymap; if (diff_keymap && diff_keymap->len > 0) diff_map = (global_keymap_t *) diff_keymap->data; #endif - } /* --------------------------------------------------------------------------------------------- */ @@ -1254,6 +1254,22 @@ load_keymap_defs (void) void free_keymap_defs (void) { + if (main_keymap != NULL) + g_array_free (main_keymap, TRUE); + if (main_x_keymap != NULL) + g_array_free (main_x_keymap, TRUE); + if (panel_keymap != NULL) + g_array_free (panel_keymap, TRUE); + if (dialog_keymap != NULL) + g_array_free (dialog_keymap, TRUE); + if (input_keymap != NULL) + g_array_free (input_keymap, TRUE); + if (listbox_keymap != NULL) + g_array_free (listbox_keymap, TRUE); + if (tree_keymap != NULL) + g_array_free (tree_keymap, TRUE); + if (help_keymap != NULL) + g_array_free (help_keymap, TRUE); #ifdef USE_INTERNAL_EDIT if (editor_keymap != NULL) g_array_free (editor_keymap, TRUE); @@ -1264,22 +1280,6 @@ free_keymap_defs (void) g_array_free (viewer_keymap, TRUE); if (viewer_hex_keymap != NULL) g_array_free (viewer_hex_keymap, TRUE); - if (main_keymap != NULL) - g_array_free (main_keymap, TRUE); - if (main_x_keymap != NULL) - g_array_free (main_x_keymap, TRUE); - if (panel_keymap != NULL) - g_array_free (panel_keymap, TRUE); - if (input_keymap != NULL) - g_array_free (input_keymap, TRUE); - if (listbox_keymap != NULL) - g_array_free (listbox_keymap, TRUE); - if (tree_keymap != NULL) - g_array_free (tree_keymap, TRUE); - if (help_keymap != NULL) - g_array_free (help_keymap, TRUE); - if (dialog_keymap != NULL) - g_array_free (dialog_keymap, TRUE); #ifdef USE_DIFF_VIEW if (diff_keymap != NULL) g_array_free (diff_keymap, TRUE); From 50de02cfe4e9e024db0bdb532045ba63980169b5 Mon Sep 17 00:00:00 2001 From: Andrew Borodin Date: Fri, 21 Jan 2011 11:47:27 +0300 Subject: [PATCH 2/9] Unification of keybinding names. Most of keybind names are changed to unify that names. Details see in doc/keybind-migration.txt file. Signed-off-by: Andrew Borodin --- doc/keybind-migration.txt | 453 +++++++++++++++++- lib/keybind.c | 698 ++++++++++------------------ lib/keybind.h | 688 ++++++++++----------------- lib/widget/dialog.c | 24 +- lib/widget/input.c | 98 ++-- lib/widget/listbox.c | 16 +- misc/mc.keymap.default | 812 ++++++++++++++++---------------- misc/mc.keymap.emacs | 813 ++++++++++++++++---------------- src/diffviewer/ydiff.c | 74 +-- src/editor/edit.c | 329 +++++++------ src/editor/editcmd.c | 14 +- src/editor/editmenu.c | 87 ++-- src/editor/editwidget.c | 2 +- src/filemanager/cmd.c | 51 +- src/filemanager/cmd.h | 13 +- src/filemanager/hotlist.c | 2 +- src/filemanager/hotlist.h | 2 +- src/filemanager/midnight.c | 355 +++++++------- src/filemanager/panel.c | 100 ++-- src/filemanager/tree.c | 36 +- src/help.c | 34 +- src/keybind-defaults.c | 920 +++++++++++++++++++------------------ src/viewer/actions_cmd.c | 80 ++-- src/viewer/lib.c | 2 - 24 files changed, 2848 insertions(+), 2855 deletions(-) diff --git a/doc/keybind-migration.txt b/doc/keybind-migration.txt index 6590ae412..2cda08ce1 100644 --- a/doc/keybind-migration.txt +++ b/doc/keybind-migration.txt @@ -1,4 +1,3 @@ - This file describes how keybind names used in mc.keymap.* files are changed in 4.8.* releases. @@ -7,53 +6,479 @@ are changed in 4.8.* releases. +---------------------------------+-------------------------+-----------------------------------------+ | [main] section | +---------------------------------+-------------------------+-----------------------------------------+ -| | | | +| CmdCopy | Copy | | +| CmdRename | Move | | +| CmdDelete | Delete | | +| CmdMkdir | MakeDir | | +| ShowCommandLine | Shell | | +| CmdMenu | Menu | | +| CmdMenuLastSelected | MenuLastSelected | | +| CmdUserMenu | UserMenu | | +| CmdEditMcMenu | EditUserMenu | | +| CmdHelp | Help | | +| CmdHistory | History | | +| CmdEdit | Edit | | +| CmdEditForceInternal | EditForceInternal | | +| CmdView | View | | +| CmdViewFile | ViewFile | | +| CmdFilteredView | ViewFiltered | | +| CmdFind | Find | | +| CmdReread | Reread | | +| CmdSingleDirsize | DirSize | | +| CmdDialogList | ScreenList | | +| CmdSuspend | Suspend | | +| CmdCopyCurrentPathname | PutCurrentPath | | +| CmdCopyOtherPathname | PutOtherPath | | +| CmdSelect | Select | | +| CmdUnselect | Unselect | | +| CmdReverseSelection | SelectInvert | | +| CmdQuickChdir | HotList | | +| CmdSwapPanel | Swap | | +| CmdListing | PanelListing | | +| CmdToggleListing | PanelListingSwitch | | +| CmdChangeListing | PanelListingChange | | +| CmdToggleShowHidden | ShowHidden | | +| CmdTogglePanelsSplit | SplitVertHoriz | | +| CmdQuickCd | CdQuick | | +| CmdConfigureBox | Options | | +| CmdLayout | OptionsLayout | | +| CmdPanelOptions | OptionsPanel | | +| CmdConfirmBox | OptionsConfirm | | +| CmdDisplayBitsBox | OptionsDisplayBits | | +| CmdConfigureVfs | OptionsVfs | | +| CmdSaveSetup | SaveSetup | | +| CmdEditExtFile | EditExtensionsFile | | +| CmdEditFhlFile | EditFileHighlightFile | | +| CmdFilter | Filter | | +| CmdFishlink | ConnectFish | | +| CmdFtplink | ConnectFtp | | +| CmdSmblink | ConnectSmb | | +| CmdUndelete | Undelete | | +| CmdQuit | Quit | | +| CmdQuietQuit | QuitQuiet | | +| ExtMap1 | ExtendedKeyMap | | +| CmdEditUserMenu | | Unused. Removed | +---------------------------------+-------------------------+-----------------------------------------+ | [main:xmap] section | +---------------------------------+-------------------------+-----------------------------------------+ -| | | | +| CmdChmod | ChangeMode | | +| CmdChown | ChangeOwn | | +| CmdCompareDirs | CompareDirs | | +| CmdDiffView | CompareFiles | | +| CmdInfo | PanelInfo | | +| CmdQuickView | PanelQuickView | | +| CmdLink | Link | | +| CmdSymlink | LinkSymbolic | | +| CmdRelativeSymlink | LinkSymbolicRelative | | +| CmdEditSymlink | LinkSymbolicEdit | | +| CmdExternalPanelize | ExternalPanelize | | +| CmdReselectVfs | VfsList | | +| CmdJobs | Jobs | | +| CmdAddHotlist | HotListAdd | | +| CmdCopyCurrentPathname | PutCurrentPath | | +| CmdCopyOtherPathname | PutOtherPath | | +| CmdCopyCurrentTagged | PutCurrentTagged | | +| CmdCopyOtherTagged | PutOtherTagged | | +| CmdCopyCurrentReadlink | PutCurrentLink | | +| CmdCopyOtherReadlink | PutOtherLink | | +---------------------------------+-------------------------+-----------------------------------------+ | [panel] section | +---------------------------------+-------------------------+-----------------------------------------+ -| | | | +| PanelMoveUp | Up | | +| PanelMoveDown | Down | | +| PanelMoveLeft | Left | | +| PanelMoveRight | Right | | +| PanelPrevPage | PageUp | | +| PanelNextPage | PageDown | | +| PanelMoveHome | Top | | +| PanelMoveEnd | Bottom | | +| PanelGotoTopFile | TopOnScreen | | +| PanelGotoMiddleFile | MiddleOnScreen | | +| PanelGotoBottomFile | BottomOnScreen | | +| PanelCopyLocal | CopySingle | | +| PanelRenameLocal | MoveSingle | | +| PanelDeleteLocal | DeleteSingle | | +| PanelStartSearch | Search | | +| PanelSetPanelEncoding | SelectCodepage | | +| PanelDirectoryHistoryList | History | | +| PanelDirectoryHistoryNext | HistoryNext | | +| PanelDirectoryHistoryPrev | HistoryPrev | | +| PanelEditNew | EditNew | | +| PanelViewSimple | ViewRaw | | +| PanelSelect | Select | | +| PanelUnselect | Unselect | | +| PanelReverseSelection | SelectInvert | | +| PanelSyncOtherPanel | PanelOtherSync | | +| PanelChdirOtherPanel | PanelOtherCd | | +| PanelChdirToReadlink | PanelOtherCdLink | | +| PanelGotoChildDir | CdChild | | +| PanelGotoParentDir | CdParent | | +| PanelSmartGotoParentDir | CdParentSmart | | +| PanelMarkFile | Mark | | +| PanelMarkDown | MarkDown | | +| PanelMarkUp | MarkUp | | +| PanelDoEnter | Enter | | +| PanelSelectSortOrder | Sort | | +| PanelReverseSort | SortReverse | | +| PanelToggleSortOrderPrev | SortPrev | | +| PanelToggleSortOrderNext | SortNext | | +| PanelSortOrderByName | SortByName | | +| PanelSortOrderByExt | SortByExt | | +| PanelSortOrderBySize | SortBySize | | +| PanelSortOrderByMTime | SortByMTime | | +---------------------------------+-------------------------+-----------------------------------------+ | [dialog] section | +---------------------------------+-------------------------+-----------------------------------------+ -| | | | +| DialogOK | Ok | | +| DialogCancel | Cancel | | +| DialogPrevItem | Up, Left | Left should not be used | +| DialogNextItem | Down, Right | Right should not be used | +| DialogHelp | Help | | +| DialogRefresh | Refresh | | +| DialogSuspend | Suspend | | +| CmdDialogList | ScreenList | | +| CmdDialogNext | ScreenNext | | +| CmdDialogPrev | ScreenPrev | | +---------------------------------+-------------------------+-----------------------------------------+ | [input] section | +---------------------------------+-------------------------+-----------------------------------------+ -| | | | +| InputBol | Home | | +| InputEol | End | | +| InputMoveLeft | Left | | +| InputMoveRight | Right | | +| InputBackwardChar | | Removed. 'Left' is used instead | +| InputForwardChar | | Removed. 'Right' is used instead | +| InputWordLeft | WordLeft | | +| InputBackwardWord | | Removed. 'WordLeft' is used instead | +| InputWordRight | WordRight | | +| InputForwardWord | | Removed. 'WordRight' is used instead | +| InputDeleteChar | Delete | | +| InputBackwardDelete | Backspace | | +| InputBackwardKillWord | DeleteToWordBegin | | +| InputKillWord | DeleteToWordEnd | | +| InputKillLine | DeleteToEnd | | +| InputKillRegion | Remove | | +| InputClearLine | Clear | | +| InputComplete | Complete | | +| InputSetMark | Mark | | +| InputLeftHighlight | MarkLeft | | +| InputRightHighlight | MarkRight | | +| InputWordLeftHighlight | MarkToWordBegin | | +| InputWordRightHighlight | MarkToWordEnd | | +| InputBolHighlight | MarkToHome | | +| InputEolHighlight | MarkToEnd | | +| InputHistoryPrev | HistoryPrev | | +| InputHistoryNext | HistoryNext | | +| InputHistoryShow | History | | +| InputXCut | Cut | | +| InputXStore | Store | | +| InputXPaste | Paste | | +| InputYank | Yank | | +---------------------------------+-------------------------+-----------------------------------------+ | [listbox] section | +---------------------------------+-------------------------+-----------------------------------------+ -| | | | +| ListboxMoveUp | Up | | +| ListboxMoveDown | Down | | +| ListboxMovePgUp | PageUp | | +| ListboxMovePgDn | PageDown | | +| ListboxMoveHome | Top | | +| ListboxMoveEnd | Bottom | | +| ListboxDeleteItem | Delete | | +| ListboxDeleteAll | Clear | | +---------------------------------+-------------------------+-----------------------------------------+ | [tree] section | +---------------------------------+-------------------------+-----------------------------------------+ -| | | | +| TreeMoveUp | Up | | +| TreeMoveDown | Down | | +| TreeMoveLeft | Left | | +| TreeMoveRight | Right | | +| TreeMovePgUp | PageUp | | +| TreeMovePgDn | PageDown | | +| TreeMoveHome | Top | | +| TreeMoveEnd | Bottom | | +| TreeCopy | Copy | | +| TreeMove | Move | | +| TreeRemove | Delete | | +| TreeHelp | Help | | +| TreeStartSearch | Search | | +| TreeRescan | Reread | | +| TreeToggleNav | ToggleNavigation | | +| TreeForget | Forget | | +| TreeOpen | Enter | | +---------------------------------+-------------------------+-----------------------------------------+ | [help] section | +---------------------------------+-------------------------+-----------------------------------------+ -| | | | +| HelpIndex | Index | | +| HelpBack | Back | | +| HelpMoveUp | Up | | +| HelpMoveDown | Down | | +| HelpMovePgUp | PageUp | | +| HelpMovePgDn | PageDown | | +| HelpMoveHalfPgUp | HalfPageUp | | +| HelpMoveHalfPgDn | HalfPageDown | | +| HelpMoveTop | Top | | +| HelpMoveBottom | Bottom | | +| HelpSelectLink | Enter | | +| HelpNextLink | LinkNext | | +| HelpPrevLink | LinkPrev | | +| HelpNextNode | NodeNext | | +| HelpPrevNode | NodePrev | | +| HelpHelp | Help | | +| HelpQuit | Quit | | +---------------------------------+-------------------------+-----------------------------------------+ | [editor] section | +---------------------------------+-------------------------+-----------------------------------------+ -| | | | +| EditEnter | Enter | | +| EditUp | Up | | +| EditDown | Down | | +| EditLeft | Left | | +| EditRight | Right | | +| EditHome | Home | | +| EditEnd | End | | +| EditPageUp | PageUp | | +| EditPageDown | PageDown | | +| EditBeginningOfText | Top | | +| EditEndOfText | Bottom | | +| EditBeginPage | TopOnScreen | | +| EditEndPage | BottomOnScreen | | +| EditParagraphUp | ParagraphUp | | +| EditParagraphDown | ParagraphDown | | +| EditParagraphFormat | ParagraphFormat | | +| EditRemove | Remove | | +| EditDelete | Delete | | +| EditBackSpace | BackSpace | | +| EditWordLeft | WordLeft | | +| EditWordRight | WordRight | | +| EditDeleteWordLeft | DeleteToWordBegin | | +| EditDeleteWordRight | DeleteToWordEnd | | +| EditDeleteLine | DeleteLine | | +| EditDeleteToLineBegin | DeleteToHome | | +| EditDeleteToLineEnd | DeleteToEnd | | +| EditReturn | Return | | +| EditTab | Tab | | +| EditToggleInsert | InsertOverwrite | | +| EditUndo | Undo | | +| EditRedo | Redo | | +| EditInsertLiteral | InsertLiteral | | +| EditMenu | Menu | | +| EditUserMenu | UserMenu | | +| | EditUserMenu | Added to edit the user menu of editor | +| EditSelectionHistory | History | | +| EditHelp | Help | | +| EditFind | Search | | +| EditFindAgain | SearchContinue | | +| EditReplace | Replace | | +| EditReplaceAgain | ReplaceContinue | | +| EditCompleteWord | | Removed. 'Complete' is used instead | +| EditComplete | Complete | | +| EditLoad | EditFile | | +| EditInsertFile | InsertFile | | +| EditSave | Save | | +| EditSaveas | SaveAs | | +| EditSaveBlock | BlockSave | | +| EditShiftBlockLeft | BlockShiftLeft | | +| EditShiftBlockRight | BlockShiftRight | | +| EditMark | Mark | | +| EditColumnMark | MarkColumn | | +| EditMarkAll | MarkAll | | +| EditLeftHighlight | MarkLeft | | +| EditRightHighlight | MarkRight | | +| EditUpHighlight | MarkUp | | +| EditDownHighlight | MarkDown | | +| EditPageUpHighlight | MarkPageUp | | +| EditPageDownHighlight | MarkPageDown | | +| EditParagraphUpHighlight | MarkParagraphUp | | +| EditParagraphDownHighlight | MarkParagraphDown | | +| EditWordLeftHighlight | MarkToWordBegin | | +| EditWordRightHighlight | MarkToWordEnd | | +| EditHomeHighlight | MarkToHome | | +| EditEndHighlight | MarkToEnd | | +| EditBeginningOfTextHighlight | MarkToFileBegin | | +| EditEndOfTextHighlight | MarkToFileEnd | | +| EditBeginPageHighlight | MarkToPageBegin | | +| EditEndPageHighlight | MarkToPageEnd | | +| EditScrollUpHighlight | MarkScrollUp | | +| EditScrollDownHighlight | MarkScrollDown | | +| EditLeftAltHighlight | MarkColumnLeft | | +| EditRightAltHighlight | MarkColumnRight | | +| EditUpAltHighlight | MarkColumnUp | | +| EditDownAltHighlight | MarkColumnDown | | +| EditPageUpAltHighlight | MarkColumnPageUp | | +| EditPageDownAltHighlight | MarkColumnPageDown | | +| EditParagraphUpAltHighlight | MarkColumnParagraphUp | | +| EditParagraphDownAltHighlight | MarkColumnParagraphDown | | +| EditScrollUpAltHighlight | MarkColumnScrollUp | | +| EditScrollDownAltHighlight | MarkColumnScrollDown | | +| EditUnmark | Unmark | | +| EditCopy | Copy | | +| EditMove | Move | | +| EditScrollUp | ScrollUp | | +| EditScrollDown | ScrollDown | | +| EditGoto | Goto | | +| EditToggleLineState | ShowNumbers | | +| EditToggleTabTWS | ShowTabTws | | +| EditToggleShowMargin | ShowMargin | | +| EditToggleSyntax | SyntaxOnOff | | +| EditChooseSyntax | SyntaxChoose | | +| EditToggleBookmark | Bookmark | | +| EditNextBookmark | BookmarkNext | | +| EditPrevBookmark | BookmarkPrev | | +| EditFlushBookmarks | BookmarkFlush | | +| EditFindDefinition | Find | | +| EditLoadNextFile | FileNext | | +| EditLoadPrevFile | FilePrev | | +| EditXCut | Cut | | +| EditXStore | Store | | +| EditXPaste | Paste | | +| EditShell | Shell | | +| EditRefresh | Refresh | | +| EditSort | Sort | | +| EditOptions | Options | | +| EditSaveMode | OptionsSaveMode | | +| EditMatchBracket | MatchBracket | | +| EditDate | Date | | +| EditMail | Mail | | +| EditQuit | Quit | | +| EditAbout | About | | +| EditExtMode | ExtendedKeyMap | | +| EditExtCmd | ExternalCommand | | +| EditBeginRecordMacro | MacroStartRecord | | +| EditEndRecordMacro | MacroStopRecord | | +| EditBeginOrEndMacro | MacroStartStopRecord | | +| EditDeleteMacro | MacroDelete | | +| CmdLearnKeys | LearnKeys | | +| EditFindFile | | Unused. Removed | +| EditExecuteMacro | | Unused. Removed | +| EditWordLeftAltHighlight | | Unused. Removed | +| EditWordRightAltHighlight | | Unused. Removed | +| EditHomeAltHighlight | | Unused. Removed | +| EditEndAltHighlight | | Unused. Removed | +| EditBeginningOfTextAltHighlight | | Unused. Removed | +| EditEndOfTextAltHighlight | | Unused. Removed | +| EditBeginPageAltHighlight | | Unused. Removed | +| EditEndPageAltHighlight | | Unused. Removed | +| EditSaveAndQuit | | Unused. Removed | +| EditCheckSaveAndQuit | | Unused. Removed | +| EditNewWindow | | Unused. Removed | +| EditSaveDesktop | | Unused. Removed | +| EditTerminal | | Unused. Removed | +| EditTerminalApp | | Unused. Removed | +| EditTypeLoadPython | | Unused. Removed | +| EditUtil | | Unused. Removed | +| EditRunAnother | | Unused. Removed | +| EditDebugStart | | Unused. Removed | +| EditDebugStop | | Unused. Removed | +| EditDebugToggleBreak | | Unused. Removed | +| EditDebugClear | | Unused. Removed | +| EditDebugNext | | Unused. Removed | +| EditDebugStep | | Unused. Removed | +| EditDebugBackTrace | | Unused. Removed | +| EditDebugContinue | | Unused. Removed | +| EditDebugEnterCommand | | Unused. Removed | +| EditDebugUntilCurser | | Unused. Removed | +| EditCycle | | Unused. Removed | +| EditMaximize | | Unused. Removed | +| EditManPage | | Unused. Removed | +| EditCtags | | Unused. Removed | +---------------------------------+-------------------------+-----------------------------------------+ | [editor:xmap] section | +---------------------------------+-------------------------+-----------------------------------------+ -| | | | +| EditExecuteMacro | | Unused. Removed | +---------------------------------+-------------------------+-----------------------------------------+ | [viewer] section | +---------------------------------+-------------------------+-----------------------------------------+ -| | | | +| ViewMoveUp | Up | | +| ViewMoveDown | Down | | +| ViewMoveLeft | Left | | +| ViewMoveRight | Right | | +| ViewMoveToBol | Home | | +| ViewMoveToEol | End | | +| ViewMovePgUp | PageUp | | +| ViewMovePgDn | PageDown | | +| ViewMoveHalfPgUp | HalfPageUp | | +| ViewMoveHalfPgDn | HalfPageDown | | +| ViewMoveTop | Top | | +| ViewMoveBottom | Bottom | | +| ViewHelp | Help | | +| ViewSearch | Search | | +| ViewSearchContinue | SearchContinue | | +| ViewGoto | Goto | | +| ViewNextFile | FileNext | | +| ViewPrevFile | FilePrev | | +| ViewToggleHexMode | HexMode | | +| ViewToggleWrapMode | WrapMode | | +| ViewToggleMagicMode | MagicMode | | +| ViewToggleNroffMode | NroffMode | | +| ViewToggleRuler | Ruler | | +| ViewNewBookmark | Bookmark | | +| ViewGotoBookmark | BookmarkGoto | | +| ShowCommandLine | Shell | | +| ViewQuit | Quit | | +---------------------------------+-------------------------+-----------------------------------------+ | [viewer:hex] section | +---------------------------------+-------------------------+-----------------------------------------+ -| | | | +| ViewMoveUp | Up | | +| ViewMoveDown | Down | | +| ViewMoveLeft | Left | | +| ViewMoveRight | Right | | +| ViewMoveLeft10 | LeftQuick | | +| ViewMoveRight10 | RightQuick | | +| ViewMoveToBol | Home | | +| ViewMoveToEol | End | | +| ViewMovePgUp | PageUp | | +| ViewMovePgDn | PageDown | | +| ViewMoveTop | Top | | +| ViewMoveBottom | Bottom | | +| ViewHelp | Help | | +| ViewSearch | Search | | +| ViewSearchContinue | SearchContinue | | +| ViewHexEditSave | Save | | +| ViewGoto | Goto | | +| ViewToggleHexMode | HexMode | | +| ViewToggleHexEditMode | HexEditMode | | +| ViewToggleHexNavMode | ToggleNavigation | | +| ViewToggleMagicMode | MagicMode | | +| ViewToggleNroffMode | NroffMode | | +| ShowCommandLine | Shell | | +| ViewQuit | Quit | | +---------------------------------+-------------------------+-----------------------------------------+ | [diffviewer] section | +---------------------------------+-------------------------+-----------------------------------------+ -| | | | +| DiffUp | Up | | +| DiffDown | Down | | +| DiffLeft | Left | | +| DiffRight | Right | | +| DiffQuickLeft | LeftQuick | | +| DiffQuickRight | RightQuick | | +| DiffHome | Home | | +| DiffEnd | | Unused. Removed | +| DiffPageUp | PageUp | | +| DiffPageDown | PageDown | | +| DiffBOF | Top | | +| DiffEOF | Bottom | | +| DiffHelp | Help | | +| DiffSearch | Search | | +| DiffSearchContinue | SearchContinue | | +| DiffRedo | Redo | | +| DiffSave | Save | | +| DiffGoto | Goto | | +| DiffSwapPanel | Swap | | +| DiffFull | SplitFull | | +| DiffEqual | SplitEqual | | +| DiffSplitMore | SplitMore | | +| DiffSplitLess | SplitLess | | +| DiffSetTab2 | Tab2 | | +| DiffSetTab3 | Tab3 | | +| DiffSetTab4 | Tab4 | | +| DiffSetTab8 | Tab8 | | +| DiffEditCurrent | Edit | | +| DiffEditOther | EditOther | | +| DiffNextHunk | HunkNext | | +| DiffPrevHunk | HunkPrev | | +| DiffMergeCurrentHunk | Merge | | +| DiffDisplaySymbols | ShowSymbols | | +| DiffDisplayNumbers | ShowNumbers | | +| DiffOptions | Options | | +| ShowCommandLine | Shell | | +| DiffQuit | Quit | | +---------------------------------+-------------------------+-----------------------------------------+ diff --git a/lib/keybind.c b/lib/keybind.c index 8946276dc..e81938765 100644 --- a/lib/keybind.c +++ b/lib/keybind.c @@ -45,486 +45,288 @@ static name_keymap_t command_names[] = { /* common */ + {"Enter", CK_Enter}, + {"Up", CK_Up}, + {"Down", CK_Down}, + {"Left", CK_Left}, + {"Right", CK_Right}, + {"LeftQuick", CK_LeftQuick}, + {"RightQuick", CK_RightQuick}, + {"Home", CK_Home}, + {"End", CK_End}, + {"PageUp", CK_PageUp}, + {"PageDown", CK_PageDown}, + {"HalfPageUp", CK_HalfPageUp}, + {"HalfPageDown", CK_HalfPageDown}, + {"Top", CK_Top}, + {"Bottom", CK_Bottom}, + {"TopOnScreen", CK_TopOnScreen}, + {"MiddleOnScreen", CK_MiddleOnScreen}, + {"BottomOnScreen", CK_BottomOnScreen}, + {"WordLeft", CK_WordLeft}, + {"WordRight", CK_WordRight}, + {"Copy", CK_Copy}, + {"Move", CK_Move}, + {"Delete", CK_Delete}, + {"MakeDir", CK_MakeDir}, + {"ChangeMode", CK_ChangeMode}, + {"ChangeOwn", CK_ChangeOwn}, + {"ChangeOwnAdvanced", CK_ChangeOwnAdvanced}, + {"Remove", CK_Remove}, + {"BackSpace", CK_BackSpace}, + {"Undo", CK_Undo}, + {"Redo", CK_Redo}, + {"Clear", CK_Clear}, + {"Menu", CK_Menu}, + {"MenuLastSelected", CK_MenuLastSelected}, + {"UserMenu", CK_UserMenu}, + {"EditUserMenu", CK_EditUserMenu}, + {"Search", CK_Search}, + {"SearchContinue", CK_SearchContinue}, + {"Replace", CK_Replace}, + {"ReplaceContinue", CK_ReplaceContinue}, + {"Help", CK_Help}, + {"Shell", CK_Shell}, + {"Edit", CK_Edit}, + {"EditNew", CK_EditNew}, +#ifdef HAVE_CHARSET {"SelectCodepage", CK_SelectCodepage}, - {"ShowCommandLine", CK_ShowCommandLine}, - {"ExtMap1", CK_StartExtMap1}, - {"ExtMap2", CK_StartExtMap2}, +#endif + {"History", CK_History}, + {"HistoryNext", CK_HistoryNext}, + {"HistoryPrev", CK_HistoryPrev}, + {"Complete", CK_Complete}, + {"Save", CK_Save}, + {"SaveAs", CK_SaveAs}, + {"Goto", CK_Goto}, + {"Reread", CK_Reread}, + {"Refresh", CK_Refresh}, + {"Suspend", CK_Suspend}, + {"Swap", CK_Swap}, + {"HotList", CK_HotList}, + {"SelectInvert", CK_SelectInvert}, + {"ScreenList", CK_ScreenList}, + {"ScreenNext", CK_ScreenNext}, + {"ScreenPrev", CK_ScreenPrev}, + {"FileNext", CK_FileNext}, + {"FilePrev", CK_FilePrev}, + {"DeleteToWordBegin", CK_DeleteToWordBegin}, + {"DeleteToWordEnd", CK_DeleteToWordEnd}, + {"Cut", CK_Cut}, + {"Store", CK_Store}, + {"Paste", CK_Paste}, + {"Mark", CK_Mark}, + {"MarkLeft", CK_MarkLeft}, + {"MarkRight", CK_MarkRight}, + {"MarkUp", CK_MarkUp}, + {"MarkDown", CK_MarkDown}, + {"MarkToWordBegin", CK_MarkToWordBegin}, + {"MarkToWordEnd", CK_MarkToWordEnd}, + {"MarkToHome", CK_MarkToHome}, + {"MarkToEnd", CK_MarkToEnd}, + {"ToggleNavigation", CK_ToggleNavigation}, + {"Sort", CK_Sort}, + {"Options", CK_Options}, + {"LearnKeys", CK_LearnKeys}, + {"Bookmark", CK_Bookmark}, + {"Quit", CK_Quit}, + {"QuitQuiet", CK_QuitQuiet}, + {"ExtendedKeyMap", CK_ExtendedKeyMap}, /* main commands */ - {"CmdHelp", CK_HelpCmd}, - {"CmdMenu", CK_MenuCmd}, - {"CmdChmod", CK_ChmodCmd}, - {"CmdMenuLastSelected", CK_MenuLastSelectedCmd}, - {"CmdSingleDirsize", CK_SingleDirsizeCmd}, - {"CmdCopyCurrentPathname", CK_CopyCurrentPathname}, - {"CmdCopyOtherPathname", CK_CopyOtherPathname}, - {"CmdSuspend", CK_SuspendCmd}, - {"CmdToggleListing", CK_ToggleListingCmd}, - {"CmdChownAdvanced", CK_ChownAdvancedCmd}, - {"CmdChown", CK_ChownCmd}, - {"CmdCompareDirs", CK_CompareDirsCmd}, - {"CmdConfigureBox", CK_ConfigureBox}, - {"CmdConfigureVfs", CK_ConfigureVfs}, - {"CmdConfirmBox", CK_ConfirmBox}, - {"CmdCopy", CK_CopyCmd}, - {"CmdDelete", CK_DeleteCmd}, - {"CmdDirsizes", CK_DirsizesCmd}, - {"CmdDisplayBitsBox", CK_DisplayBitsBox}, - {"CmdEdit", CK_EditCmd}, #ifdef USE_INTERNAL_EDIT - {"CmdEditForceInternal", CK_EditForceInternalCmd}, + {"EditForceInternal", CK_EditForceInternal}, #endif - {"CmdEditExtFile", CK_EditExtFileCmd}, - {"CmdEditFhlFile", CK_EditFhlFileCmd}, - {"CmdEditMcMenu", CK_EditMcMenuCmd}, - {"CmdEditSymlink", CK_EditSymlinkCmd}, - {"CmdEditSyntax", CK_EditSyntaxCmd}, - {"CmdEditUserMenu", CK_EditUserMenuCmd}, - {"CmdExternalPanelize", CK_ExternalPanelize}, - {"CmdFilter", CK_FilterCmd}, - {"CmdFilteredView", CK_FilteredViewCmd}, - {"CmdFind", CK_FindCmd}, + {"View", CK_View}, + {"ViewRaw", CK_ViewRaw}, + {"ViewFile", CK_ViewFile}, + {"ViewFiltered", CK_ViewFiltered}, + {"Find", CK_Find}, + {"DirSize", CK_DirSize}, + {"PanelListingSwitch", CK_PanelListingSwitch}, + {"CompareDirs", CK_CompareDirs}, +#ifdef USE_DIFF_VIEW + {"CompareFiles", CK_CompareFiles}, +#endif + {"OptionsVfs", CK_OptionsVfs}, + {"OptionsConfirm", CK_OptionsConfirm}, + {"OptionsDisplayBits", CK_OptionsDisplayBits}, + {"EditExtensionsFile", CK_EditExtensionsFile}, + {"EditFileHighlightFile", CK_EditFileHighlightFile}, + {"LinkSymbolicEdit", CK_LinkSymbolicEdit}, + {"ExternalPanelize", CK_ExternalPanelize}, + {"Filter", CK_Filter}, #ifdef ENABLE_VFS_FISH - {"CmdFishlink", CK_FishlinkCmd}, + {"ConnectFish", CK_ConnectFish}, #endif #ifdef ENABLE_VFS_FTP - {"CmdFtplink", CK_FtplinkCmd}, + {"ConnectFtp", CK_ConnectFtp}, #endif - {"CmdHistory", CK_HistoryCmd}, - {"CmdInfo", CK_InfoCmd}, -#ifdef WITH_BACKGROUND - {"CmdJobs", CK_JobsCmd}, -#endif - {"CmdLayout", CK_LayoutBox}, - {"CmdLearnKeys", CK_LearnKeys}, - {"CmdLink", CK_LinkCmd}, - {"CmdChangeListing", CK_ChangeListingCmd}, - {"CmdListing", CK_ListingCmd}, -#ifdef LISTMODE_EDITOR - {"CmdListmodeCmd", CK_ListmodeCmd}. -#endif - {"CmdMkdir", CK_MkdirCmd}, - {"CmdPanelOptions", CK_PanelOptionsBox}, - {"CmdQuickCd", CK_QuickCdCmd}, - {"CmdQuickChdir", CK_QuickChdirCmd}, - {"CmdQuickView", CK_QuickViewCmd}, - {"CmdQuietQuit", CK_QuietQuitCmd}, - {"CmdRelativeSymlink", CK_RelativeSymlinkCmd}, - {"CmdRename", CK_RenameCmd}, - {"CmdReread", CK_RereadCmd}, - {"CmdReselectVfs", CK_ReselectVfs}, - {"CmdReverseSelection", CK_ReverseSelectionCmd}, - {"CmdSaveSetup", CK_SaveSetupCmd}, - {"CmdSelect", CK_SelectCmd}, #ifdef ENABLE_VFS_SMB - {"CmdSmblinkCmd", CK_SmblinkCmd}, + {"ConnectSmb", CK_ConnectSmb}, #endif - {"CmdSwapPanel", CK_SwapCmd}, - {"CmdSymlink", CK_SymlinkCmd}, - {"CmdTree", CK_TreeCmd}, - {"CmdTreeBox", CK_TreeBoxCmd}, + {"PanelInfo", CK_PanelInfo}, +#ifdef WITH_BACKGROUND + {"Jobs", CK_Jobs}, +#endif + {"OptionsLayout", CK_OptionsLayout}, + {"Link", CK_Link}, + {"PanelListingChange", CK_PanelListingChange}, + {"PanelListing", CK_PanelListing}, +#ifdef LISTMODE_EDITOR + {"ListMode", CK_ListMode}. +#endif + {"OptionsPanel", CK_OptionsPanel}, + {"CdQuick", CK_CdQuick}, + {"PanelQuickView", CK_PanelQuickView}, + {"LinkSymbolicRelative", CK_LinkSymbolicRelative}, + {"VfsList", CK_VfsList}, + {"SaveSetup", CK_SaveSetup}, + {"LinkSymbolic", CK_LinkSymbolic}, + {"PanelTree", CK_PanelTree}, + {"Tree", CK_Tree}, #ifdef ENABLE_VFS_UNDELFS - {"CmdUndelete", CK_UndeleteCmd}, + {"Undelete", CK_Undelete}, #endif - {"CmdUnselect", CK_UnselectCmd}, - {"CmdUserMenu", CK_UserMenuCmd}, - {"CmdUserFileMenu", CK_UserFileMenuCmd}, - {"CmdView", CK_ViewCmd}, - {"CmdViewFile", CK_ViewFileCmd}, - {"CmdCopyCurrentReadlink", CK_CopyCurrentReadlink}, - {"CmdCopyOtherReadlink", CK_CopyOtherReadlink}, - {"CmdAddHotlist", CK_AddHotlist}, - {"CmdQuit", CK_QuitCmd}, - {"CmdCopyCurrentTagged", CK_CopyCurrentTagged}, - {"CmdCopyOtherTagged", CK_CopyOtherTagged}, - {"CmdToggleShowHidden", CK_ToggleShowHidden}, - {"CmdTogglePanelsSplit", CK_TogglePanelsSplit}, -#ifdef USE_DIFF_VIEW - {"CmdDiffView", CK_DiffViewCmd}, -#endif - {"CmdDialogList", CK_DialogListCmd}, - {"CmdDialogNext", CK_DialogNextCmd}, - {"CmdDialogPrev", CK_DialogPrevCmd}, + {"PutCurrentLink", CK_PutCurrentLink}, + {"PutOtherLink", CK_PutOtherLink}, + {"HotListAdd", CK_HotListAdd}, + {"ShowHidden", CK_ShowHidden}, + {"SplitVertHoriz", CK_SplitVertHoriz}, + {"PutCurrentPath", CK_PutCurrentPath}, + {"PutOtherPath", CK_PutOtherPath}, + {"PutCurrentTagged", CK_PutCurrentTagged}, + {"PutOtherTagged", CK_PutOtherTagged}, + {"Select", CK_Select}, + {"Unselect", CK_Unselect}, /* panel */ - {"PanelChdirOtherPanel", CK_PanelChdirOtherPanel}, - {"PanelChdirToReadlink", CK_PanelChdirToReadlink}, - {"PanelCopyLocal", CK_PanelCmdCopyLocal}, - {"PanelDeleteLocal", CK_PanelCmdDeleteLocal}, - {"PanelDoEnter", CK_PanelCmdDoEnter}, - {"PanelEditNew", CK_PanelCmdEditNew}, - {"PanelRenameLocal", CK_PanelCmdRenameLocal}, - {"PanelReverseSelection", CK_PanelCmdReverseSelection}, - {"PanelSelect", CK_PanelCmdSelect}, - {"PanelUnselect", CK_PanelCmdUnselect}, - {"PanelViewSimple", CK_PanelCmdViewSimple}, - {"PanelGotoParentDir", CK_PanelGotoParentDir}, - {"PanelGotoChildDir", CK_PanelGotoChildDir}, - {"PanelDirectoryHistoryList", CK_PanelDirectoryHistoryList}, - {"PanelDirectoryHistoryNext", CK_PanelDirectoryHistoryNext}, - {"PanelDirectoryHistoryPrev", CK_PanelDirectoryHistoryPrev}, - {"PanelGotoBottomFile", CK_PanelGotoBottomFile}, - {"PanelGotoMiddleFile", CK_PanelGotoMiddleFile}, - {"PanelGotoTopFile", CK_PanelGotoTopFile}, - {"PanelMarkFile", CK_PanelMarkFile}, - {"PanelMarkFileDown", CK_PanelMarkFileDown}, - {"PanelMarkFileUp", CK_PanelMarkFileUp}, - {"PanelMoveUp", CK_PanelMoveUp}, - {"PanelMoveDown", CK_PanelMoveDown}, - {"PanelMoveLeft", CK_PanelMoveLeft}, - {"PanelMoveRight", CK_PanelMoveRight}, - {"PanelMoveEnd", CK_PanelMoveEnd}, - {"PanelMoveHome", CK_PanelMoveHome}, - {"PanelNextPage", CK_PanelNextPage}, - {"PanelPrevPage", CK_PanelPrevPage}, -#ifdef HAVE_CHARSET - {"PanelSetPanelEncoding", CK_PanelSetPanelEncoding}, -#endif - {"PanelStartSearch", CK_PanelStartSearch}, - {"PanelSyncOtherPanel", CK_PanelSyncOtherPanel}, - {"PanelToggleSortOrderNext", CK_PanelToggleSortOrderNext}, - {"PanelToggleSortOrderPrev", CK_PanelToggleSortOrderPrev}, - {"PanelSelectSortOrder", CK_PanelSelectSortOrder}, - {"PanelReverseSort", CK_PanelReverseSort}, - {"PanelSortOrderByName", CK_PanelSortOrderByName}, - {"PanelSortOrderByExt", CK_PanelSortOrderByExt}, - {"PanelSortOrderBySize", CK_PanelSortOrderBySize}, - {"PanelSortOrderByMTime", CK_PanelSortOrderByMTime}, - {"PanelSmartGotoParentDir", CK_PanelSmartGotoParentDir}, + {"PanelOtherCd", CK_PanelOtherCd}, + {"PanelOtherCdLink", CK_PanelOtherCdLink}, + {"CopySingle", CK_CopySingle}, + {"MoveSingle", CK_MoveSingle}, + {"DeleteSingle", CK_DeleteSingle}, + {"CdParent", CK_CdParent}, + {"CdChild", CK_CdChild}, + {"PanelOtherSync", CK_PanelOtherSync}, + {"SortNext", CK_SortNext}, + {"SortPrev", CK_SortPrev}, + {"SortReverse", CK_SortReverse}, + {"SortByName", CK_SortByName}, + {"SortByExt", CK_SortByExt}, + {"SortBySize", CK_SortBySize}, + {"SortByMTime", CK_SortByMTime}, + {"CdParentSmart", CK_CdParentSmart}, /* dialog */ - {"DialogOK", CK_DialogOK}, - {"DialogCancel", CK_DialogCancel}, - {"DialogPrevItem", CK_DialogPrevItem}, - {"DialogNextItem", CK_DialogNextItem}, - {"DialogHelp", CK_DialogHelp}, - {"DialogSuspend", CK_DialogSuspend}, - {"DialogRefresh", CK_DialogRefresh}, + {"Ok", CK_Ok}, + {"Cancel", CK_Cancel}, /* input line */ - {"InputBol", CK_InputBol}, - {"InputEol", CK_InputEol}, - {"InputMoveLeft", CK_InputMoveLeft}, - {"InputWordLeft", CK_InputWordLeft}, - {"InputBackwardChar", CK_InputBackwardChar}, - {"InputBackwardWord", CK_InputBackwardWord}, - {"InputMoveRight", CK_InputMoveRight}, - {"InputWordRight", CK_InputWordRight}, - {"InputForwardChar", CK_InputForwardChar}, - {"InputForwardWord", CK_InputForwardWord}, - {"InputBackwardDelete", CK_InputBackwardDelete}, - {"InputDeleteChar", CK_InputDeleteChar}, - {"InputKillWord", CK_InputKillWord}, - {"InputBackwardKillWord", CK_InputBackwardKillWord}, - {"InputSetMark", CK_InputSetMark}, - {"InputKillRegion", CK_InputKillRegion}, - {"InputYank", CK_InputYank}, - {"InputKillLine", CK_InputKillLine}, - {"InputHistoryPrev", CK_InputHistoryPrev}, - {"InputHistoryNext", CK_InputHistoryNext}, - {"InputHistoryShow", CK_InputHistoryShow}, - {"InputComplete", CK_InputComplete}, - {"InputXStore", CK_InputKillSave}, - {"InputXPaste", CK_InputPaste}, - {"InputClearLine", CK_InputClearLine}, - {"InputLeftHighlight", CK_InputLeftHighlight}, - {"InputRightHighlight", CK_InputRightHighlight}, - {"InputWordLeftHighlight", CK_InputWordLeftHighlight}, - {"InputWordRightHighlight", CK_InputWordRightHighlight}, - {"InputBolHighlight", CK_InputBolHighlight}, - {"InputEolHighlight", CK_InputEolHighlight}, - - /* listbox */ - {"ListboxMoveUp", CK_ListboxMoveUp}, - {"ListboxMoveDown", CK_ListboxMoveDown}, - {"ListboxMoveHome", CK_ListboxMoveHome}, - {"ListboxMoveEnd", CK_ListboxMoveEnd}, - {"ListboxMovePgUp", CK_ListboxMovePgUp}, - {"ListboxMovePgDn", CK_ListboxMovePgDn}, - {"ListboxDeleteItem", CK_ListboxDeleteItem}, - {"ListboxDeleteAll", CK_ListboxDeleteAll}, + {"Yank", CK_Yank}, /* help */ - {"HelpHelp", CK_HelpHelp}, - {"HelpIndex", CK_HelpIndex}, - {"HelpBack", CK_HelpBack}, - {"HelpQuit", CK_HelpQuit}, - {"HelpMoveUp", CK_HelpMoveUp}, - {"HelpMoveDown", CK_HelpMoveDown}, - {"HelpMovePgDn", CK_HelpMovePgDn}, - {"HelpMovePgUp", CK_HelpMovePgUp}, - {"HelpMoveHalfPgDn", CK_HelpMoveHalfPgDn}, - {"HelpMoveHalfPgUp", CK_HelpMoveHalfPgUp}, - {"HelpMoveTop", CK_HelpMoveTop}, - {"HelpMoveBottom", CK_HelpMoveBottom}, - {"HelpSelectLink", CK_HelpSelectLink}, - {"HelpNextLink", CK_HelpNextLink}, - {"HelpPrevLink", CK_HelpPrevLink}, - {"HelpNextNode", CK_HelpNextNode}, - {"HelpPrevNode", CK_HelpPrevNode}, + {"Index", CK_Index}, + {"Back", CK_Back}, + {"LinkNext", CK_LinkNext}, + {"LinkPrev", CK_LinkPrev}, + {"NodeNext", CK_NodeNext}, + {"NodePrev", CK_NodePrev}, /* tree */ - {"TreeHelp", CK_TreeHelp}, - {"TreeForget", CK_TreeForget}, - {"TreeToggleNav", CK_TreeToggleNav}, - {"TreeCopy", CK_TreeCopy}, - {"TreeMove", CK_TreeMove}, - {"TreeMake", CK_TreeMake}, - {"TreeMoveUp", CK_TreeMoveUp}, - {"TreeMoveDown", CK_TreeMoveDown}, - {"TreeMoveLeft", CK_TreeMoveLeft}, - {"TreeMoveRight", CK_TreeMoveRight}, - {"TreeMoveHome", CK_TreeMoveHome}, - {"TreeMoveEnd", CK_TreeMoveEnd}, - {"TreeMovePgUp", CK_TreeMovePgUp}, - {"TreeMovePgDn", CK_TreeMovePgDn}, - {"TreeOpen", CK_TreeOpen}, - {"TreeRescan", CK_TreeRescan}, - {"TreeStartSearch", CK_TreeStartSearch}, - {"TreeRemove", CK_TreeRemove}, + {"Forget", CK_Forget}, + +#if defined (USE_INTERNAL_EDIT) || defined (USE_DIFF_VIEW) + {"ShowNumbers", CK_ShowNumbers}, +#endif #ifdef USE_INTERNAL_EDIT - {"EditNoCommand", CK_Ignore_Key}, - {"EditIgnoreKey", CK_Ignore_Key}, - {"EditBackSpace", CK_BackSpace}, - {"EditDelete", CK_Delete}, - {"EditEnter", CK_Enter}, - {"EditPageUp", CK_Page_Up}, - {"EditPageDown", CK_Page_Down}, - {"EditLeft", CK_Left}, - {"EditRight", CK_Right}, - {"EditWordLeft", CK_Word_Left}, - {"EditWordRight", CK_Word_Right}, - {"EditUp", CK_Up}, - {"EditDown", CK_Down}, - {"EditHome", CK_Home}, - {"EditEnd", CK_End}, - {"EditTab", CK_Tab}, - {"EditUndo", CK_Undo}, - {"EditRedo", CK_Redo}, - {"EditBeginningOfText", CK_Beginning_Of_Text}, - {"EditEndOfText", CK_End_Of_Text}, - {"EditScrollUp", CK_Scroll_Up}, - {"EditScrollDown", CK_Scroll_Down}, - {"EditReturn", CK_Return}, - {"EditBeginPage", CK_Begin_Page}, - {"EditEndPage", CK_End_Page}, - {"EditDeleteWordLeft", CK_Delete_Word_Left}, - {"EditDeleteWordRight", CK_Delete_Word_Right}, - {"EditParagraphUp", CK_Paragraph_Up}, - {"EditParagraphDown", CK_Paragraph_Down}, - {"EditMenu", CK_Menu}, - {"EditSave", CK_Save}, - {"EditLoad", CK_Load}, - {"EditNew", CK_New}, - {"EditSaveas", CK_Save_As}, - {"EditMark", CK_Mark}, - {"EditCopy", CK_Copy}, - {"EditMove", CK_Move}, - {"EditRemove", CK_Remove}, - {"EditMarkAll", CK_Mark_All}, - {"EditUnmark", CK_Unmark}, - {"EditMarkWord", CK_Mark_Word}, - {"EditMarkLine", CK_Mark_Line}, - {"EditSaveBlock", CK_Save_Block}, - {"EditColumnMark", CK_Column_Mark}, - {"EditFind", CK_Find}, - {"EditFindAgain", CK_Find_Again}, - {"EditReplace", CK_Replace}, - {"EditReplaceAgain", CK_Replace_Again}, - {"EditCompleteWord", CK_Complete_Word}, -#if 0 - {"EditDebugStart", CK_Debug_Start}, - {"EditDebugStop", CK_Debug_Stop}, - {"EditDebugToggleBreak", CK_Debug_Toggle_Break}, - {"EditDebugClear", CK_Debug_Clear}, - {"EditDebugNext", CK_Debug_Next}, - {"EditDebugStep", CK_Debug_Step}, - {"EditDebugBackTrace", CK_Debug_Back_Trace}, - {"EditDebugContinue", CK_Debug_Continue}, - {"EditDebugEnterCommand", CK_Debug_Enter_Command}, - {"EditDebugUntilCurser", CK_Debug_Until_Curser}, -#endif - {"EditInsertFile", CK_Insert_File}, - {"EditQuit", CK_Quit}, - {"EditToggleInsert", CK_Toggle_Insert}, - {"EditHelp", CK_Help}, - {"EditDate", CK_Date}, - {"EditRefresh", CK_Refresh}, - {"EditGoto", CK_Goto}, - {"EditDeleteLine", CK_Delete_Line}, - {"EditDeleteToLineEnd", CK_Delete_To_Line_End}, - {"EditDeleteToLineBegin", CK_Delete_To_Line_Begin}, - {"EditManPage", CK_Man_Page}, - {"EditSort", CK_Sort}, + {"Tab", CK_Tab}, + {"ScrollUp", CK_ScrollUp}, + {"ScrollDown", CK_ScrollDown}, + {"Return", CK_Return}, + {"ParagraphUp", CK_ParagraphUp}, + {"ParagraphDown", CK_ParagraphDown}, + {"EditFile", CK_EditFile}, + {"MarkWord", CK_MarkWord}, + {"MarkLine", CK_MarkLine}, + {"MarkAll", CK_MarkAll}, + {"Unmark", CK_Unmark}, + {"MarkColumn", CK_MarkColumn}, + {"BlockSave", CK_BlockSave}, + {"InsertFile", CK_InsertFile}, + {"InsertOverwrite", CK_InsertOverwrite}, + {"Date", CK_Date}, + {"DeleteLine", CK_DeleteLine}, + {"DeleteToHome", CK_DeleteToHome}, + {"DeleteToEnd", CK_DeleteToEnd}, {"EditMail", CK_Mail}, - {"EditCancel", CK_Cancel}, - {"EditComplete", CK_Complete}, - {"EditParagraphFormat", CK_Paragraph_Format}, - {"EditUtil", CK_Util}, - {"EditTypeLoadPython", CK_Type_Load_Python}, - {"EditFindFile", CK_Find_File}, - {"EditCtags", CK_Ctags}, - {"EditMatchBracket", CK_Match_Bracket}, - {"EditTerminal", CK_Terminal}, - {"EditTerminalApp", CK_Terminal_App}, - {"EditExtCmd", CK_ExtCmd}, - {"EditUserMenu", CK_User_Menu}, - {"EditBeginRecordMacro", CK_Begin_Record_Macro}, - {"EditEndRecordMacro", CK_End_Record_Macro}, - {"EditBeginEndRepeat", CK_Begin_End_Repeat}, - {"EditDeleteMacro", CK_Delete_Macro}, - {"EditToggleBookmark", CK_Toggle_Bookmark}, - {"EditFlushBookmarks", CK_Flush_Bookmarks}, - {"EditNextBookmark", CK_Next_Bookmark}, - {"EditPrevBookmark", CK_Prev_Bookmark}, - {"EditPageUpHighlight", CK_Page_Up_Highlight}, - {"EditPageDownHighlight", CK_Page_Down_Highlight}, - {"EditLeftHighlight", CK_Left_Highlight}, - {"EditRightHighlight", CK_Right_Highlight}, - {"EditWordLeftHighlight", CK_Word_Left_Highlight}, - {"EditWordRightHighlight", CK_Word_Right_Highlight}, - {"EditUpHighlight", CK_Up_Highlight}, - {"EditDownHighlight", CK_Down_Highlight}, - {"EditHomeHighlight", CK_Home_Highlight}, - {"EditEndHighlight", CK_End_Highlight}, - {"EditBeginningOfTextHighlight", CK_Beginning_Of_Text_Highlight}, - {"EditEndOfTextHighlight", CK_End_Of_Text_Highlight}, - {"EditBeginPageHighlight", CK_Begin_Page_Highlight}, - {"EditEndPageHighlight", CK_End_Page_Highlight}, - {"EditScrollUpHighlight", CK_Scroll_Up_Highlight}, - {"EditScrollDownHighlight", CK_Scroll_Down_Highlight}, - {"EditParagraphUpHighlight", CK_Paragraph_Up_Highlight}, - {"EditParagraphDownHighlight", CK_Paragraph_Down_Highlight}, - {"EditPageUpAltHighlight", CK_Page_Up_Alt_Highlight}, - {"EditPageDownAltHighlight", CK_Page_Down_Alt_Highlight}, - {"EditLeftAltHighlight", CK_Left_Alt_Highlight}, - {"EditRightAltHighlight", CK_Right_Alt_Highlight}, - {"EditWordLeftAltHighlight", CK_Word_Left_Alt_Highlight}, - {"EditWordRightAltHighlight", CK_Word_Right_Alt_Highlight}, - {"EditUpAltHighlight", CK_Up_Alt_Highlight}, - {"EditDownAltHighlight", CK_Down_Alt_Highlight}, - {"EditHomeAltHighlight", CK_Home_Alt_Highlight}, - {"EditEndAltHighlight", CK_End_Alt_Highlight}, - {"EditBeginningOfTextAltHighlight", CK_Beginning_Of_Text_Alt_Highlight}, - {"EditEndOfTextAltHighlight", CK_End_Of_Text_Alt_Highlight}, - {"EditBeginPageAltHighlight", CK_Begin_Page_Alt_Highlight}, - {"EditEndPageAltHighlight", CK_End_Page_Alt_Highlight}, - {"EditScrollUpAltHighlight", CK_Scroll_Up_Alt_Highlight}, - {"EditScrollDownAltHighlight", CK_Scroll_Down_Alt_Highlight}, - {"EditParagraphUpAltHighlight", CK_Paragraph_Up_Alt_Highlight}, - {"EditParagraphDownAltHighlight", CK_Paragraph_Down_Alt_Highlight}, - {"EditShiftBlockLeft", CK_Shift_Block_Left}, - {"EditShiftBlockRight", CK_Shift_Block_Right}, - {"EditXStore", CK_XStore}, - {"EditXCut", CK_XCut}, - {"EditXPaste", CK_XPaste}, - {"EditSelectionHistory", CK_Selection_History}, - {"EditShell", CK_Shell}, - {"EditInsertLiteral", CK_Insert_Literal}, - {"EditBeginOrEndMacro", CK_Begin_End_Macro}, - {"EditExtMode", CK_Ext_Mode}, - {"EditToggleLineState", CK_Toggle_Line_State}, - {"EditToggleTabTWS", CK_Toggle_Tab_TWS}, - {"EditToggleSyntax", CK_Toggle_Syntax}, - {"EditToggleShowMargin", CK_Toggle_Show_Margin}, - {"EditFindDefinition", CK_Find_Definition}, - {"EditLoadPrevFile", CK_Load_Prev_File}, - {"EditLoadNextFile", CK_Load_Next_File}, - {"EditOptions", CK_Edit_Options}, - {"EditSaveMode", CK_Edit_Save_Mode}, - {"EditChooseSyntax", CK_Choose_Syntax}, - {"EditAbout", CK_About}, -#if 0 - {"EditFocusNext", CK_Focus_Next}, - {"EditFocusPrev", CK_Focus_Prev}, - {"EditHeightInc", CK_Height_Inc}, - {"EditHeightDec", CK_Height_Dec}, - {"EditMake", CK_Make}, - {"EditErrorNext", CK_Error_Next}, - {"EditErrorPrev", CK_Error_Prev}, - {"EditSaveDesktop", CK_Save_Desktop}, - {"EditNewWindow", CK_New_Window}, - {"EditCycle", CK_Cycle}, - {"EditSaveAndQuit", CK_Save_And_Quit}, - {"EditRunAnother", CK_Run_Another}, - {"EditCheckSaveAndQuit", CK_Check_Save_And_Quit}, - {"EditMaximize", CK_Maximize}, -#endif + {"ParagraphFormat", CK_ParagraphFormat}, + {"MatchBracket", CK_MatchBracket}, + {"ExternalCommand", CK_ExternalCommand}, + {"MacroStartRecord", CK_MacroStartRecord}, + {"MacroStopRecord", CK_MacroStopRecord}, + {"MacroStartStopRecord", CK_MacroStartStopRecord}, + {"MacroDelete", CK_MacroDelete}, + {"RepeatStartStopRecord", CK_RepeatStartStopRecord}, + {"BookmarkFlush", CK_BookmarkFlush}, + {"BookmarkNext", CK_BookmarkNext}, + {"BookmarkPrev", CK_BookmarkPrev}, + {"MarkPageUp", CK_MarkPageUp}, + {"MarkPageDown", CK_MarkPageDown}, + {"MarkToFileBegin", CK_MarkToFileBegin}, + {"MarkToFileEnd", CK_MarkToFileEnd}, + {"MarkToPageBegin", CK_MarkToPageBegin}, + {"MarkToPageEnd", CK_MarkToPageEnd}, + {"MarkScrollUp", CK_MarkScrollUp}, + {"MarkScrollDown", CK_MarkScrollDown}, + {"MarkParagraphUp", CK_MarkParagraphUp}, + {"MarkParagraphDown", CK_MarkParagraphDown}, + {"MarkColumnPageUp", CK_MarkColumnPageUp}, + {"MarkColumnPageDown", CK_MarkColumnPageDown}, + {"MarkColumnLeft", CK_MarkColumnLeft}, + {"MarkColumnRight", CK_MarkColumnRight}, + {"MarkColumnUp", CK_MarkColumnUp}, + {"MarkColumnDown", CK_MarkColumnDown}, + {"MarkColumnScrollUp", CK_MarkColumnScrollUp}, + {"MarkColumnScrollDown", CK_MarkColumnScrollDown}, + {"MarkColumnParagraphUp", CK_MarkColumnParagraphUp}, + {"MarkColumnParagraphDown", CK_MarkColumnParagraphDown}, + {"BlockShiftLeft", CK_BlockShiftLeft}, + {"BlockShiftRight", CK_BlockShiftRight}, + {"InsertLiteral", CK_InsertLiteral}, + {"ShowTabTws", CK_ShowTabTws}, + {"SyntaxOnOff", CK_SyntaxOnOff}, + {"SyntaxChoose", CK_SyntaxChoose}, + {"ShowMargin", CK_ShowMargin}, + {"OptionsSaveMode", CK_OptionsSaveMode}, + {"About", CK_About}, #endif /* USE_INTERNAL_EDIT */ /* viewer */ - {"ViewHelp", CK_ViewHelp}, - {"ViewToggleWrapMode", CK_ViewToggleWrapMode}, - {"ViewToggleHexEditMode", CK_ViewToggleHexEditMode}, - {"ViewQuit", CK_ViewQuit}, - {"ViewToggleHexMode", CK_ViewToggleHexMode}, - {"ViewGoto", CK_ViewGoto}, - {"ViewHexEditSave", CK_ViewHexEditSave}, - {"ViewSearch", CK_ViewSearch}, - {"ViewToggleMagicMode", CK_ViewToggleMagicMode}, - {"ViewToggleNroffMode", CK_ViewToggleNroffMode}, - {"ViewContinueSearch", CK_ViewContinueSearch}, - {"ViewGotoBookmark", CK_ViewGotoBookmark}, - {"ViewNewBookmark", CK_ViewNewBookmark}, - {"ViewMoveUp", CK_ViewMoveUp}, - {"ViewMoveDown", CK_ViewMoveDown}, - {"ViewMoveLeft", CK_ViewMoveLeft}, - {"ViewMoveRight", CK_ViewMoveRight}, - {"ViewMoveLeft10", CK_ViewMoveLeft10}, - {"ViewMoveRight10", CK_ViewMoveRight10}, - {"ViewMovePgDn", CK_ViewMovePgDn}, - {"ViewMovePgUp", CK_ViewMovePgUp}, - {"ViewMoveHalfPgDn", CK_ViewMoveHalfPgDn}, - {"ViewMoveHalfPgUp", CK_ViewMoveHalfPgUp}, - {"ViewMoveToBol", CK_ViewMoveToBol}, - {"ViewMoveToEol", CK_ViewMoveToEol}, - {"ViewMoveTop", CK_ViewMoveTop}, - {"ViewMoveBottom", CK_ViewMoveBottom}, - {"ViewNextFile", CK_ViewNextFile}, - {"ViewPrevFile", CK_ViewPrevFile}, - {"ViewToggleRuler", CK_ViewToggleRuler}, - {"ViewToggleHexNavMode", CK_ViewToggleHexNavMode}, + {"WrapMode", CK_WrapMode}, + {"HexEditMode", CK_HexEditMode}, + {"HexMode", CK_HexMode}, + {"MagicMode", CK_MagicMode}, + {"NroffMode", CK_NroffMode}, + {"BookmarkGoto", CK_BookmarkGoto}, + {"Ruler", CK_Ruler}, #ifdef USE_DIFF_VIEW /* diff viewer */ - {"DiffDisplaySymbols", CK_DiffDisplaySymbols}, - {"DiffDisplayNumbers", CK_DiffDisplayNumbers}, - {"DiffFull", CK_DiffFull}, - {"DiffEqual", CK_DiffEqual}, - {"DiffSplitMore", CK_DiffSplitMore}, - {"DiffSplitLess", CK_DiffSplitLess}, - {"DiffShowDiff", CK_DiffShowDiff}, - {"DiffSetTab2", CK_DiffSetTab2}, - {"DiffSetTab3", CK_DiffSetTab3}, - {"DiffSetTab4", CK_DiffSetTab4}, - {"DiffSetTab8", CK_DiffSetTab8}, - {"DiffSwapPanel", CK_DiffSwapPanel}, - {"DiffRedo", CK_DiffRedo}, - {"DiffNextHunk", CK_DiffNextHunk}, - {"DiffPrevHunk", CK_DiffPrevHunk}, - {"DiffGoto", CK_DiffGoto}, - {"DiffEditCurrent", CK_DiffEditCurrent}, - {"DiffEditOther", CK_DiffEditOther}, - {"DiffSearch", CK_DiffSearch}, - {"DiffContinueSearch", CK_DiffContinueSearch}, - {"DiffEOF", CK_DiffEOF}, - {"DiffBOF", CK_DiffBOF}, - {"DiffDown", CK_DiffDown}, - {"DiffUp", CK_DiffUp}, - {"DiffQuickLeft", CK_DiffQuickLeft}, - {"DiffQuickRight", CK_DiffQuickRight}, - {"DiffLeft", CK_DiffLeft}, - {"DiffRight", CK_DiffRight}, - {"DiffPageDown", CK_DiffPageDown}, - {"DiffPageUp", CK_DiffPageUp}, - {"DiffHome", CK_DiffHome}, - {"DiffEnd", CK_DiffEnd}, - {"DiffQuit", CK_DiffQuit}, - {"DiffHelp", CK_DiffHelp}, - {"DiffMergeCurrentHunk", CK_DiffMergeCurrentHunk}, - {"DiffSave", CK_DiffSave}, - {"DiffOptions", CK_DiffOptions}, + {"ShowSymbols", CK_ShowSymbols}, + {"SplitFull", CK_SplitFull}, + {"SplitEqual", CK_SplitEqual}, + {"SplitMore", CK_SplitMore}, + {"SplitLess", CK_SplitLess}, + {"Tab2", CK_Tab2}, + {"Tab3", CK_Tab3}, + {"Tab4", CK_Tab4}, + {"Tab8", CK_Tab8}, + {"HunkNext", CK_HunkNext}, + {"HunkPrev", CK_HunkPrev}, + {"EditOther", CK_EditOther}, + {"Merge", CK_Merge}, #endif /* USE_DIFF_VIEW */ {NULL, CK_Ignore_Key} diff --git a/lib/keybind.h b/lib/keybind.h index 09d9f144f..0d3598fb0 100644 --- a/lib/keybind.h +++ b/lib/keybind.h @@ -15,481 +15,289 @@ #define CK_Ignore_Key 0 /* common */ +#define CK_Enter 3 +#define CK_Up 10 +#define CK_Down 11 +#define CK_Left 6 +#define CK_Right 7 +#define CK_Home 12 +#define CK_End 13 +#define CK_LeftQuick 9027 +#define CK_RightQuick 9028 +#define CK_PageUp 4 +#define CK_PageDown 5 +#define CK_HalfPageUp 1015 +#define CK_HalfPageDown 1014 +#define CK_Top 17 +#define CK_Bottom 18 +#define CK_TopOnScreen 8019 +#define CK_MiddleOnScreen 8018 +#define CK_BottomOnScreen 8017 +#define CK_WordLeft 8 +#define CK_WordRight 9 +#define CK_Copy 202 +#define CK_Move 203 +#define CK_Delete 2 +#define CK_MakeDir 7045 +#define CK_ChangeMode 7003 +#define CK_ChangeOwn 7005 +#define CK_ChangeOwnAdvanced 7004 +#define CK_Remove 204 +#define CK_BackSpace 1 +#define CK_Redo 16 +#define CK_Clear 4026 +#define CK_Menu 123 +#define CK_MenuLastSelected 7044 +#define CK_UserMenu 425 +#define CK_EditUserMenu 7026 +#define CK_Search 8032 +#define CK_SearchContinue 5011 +#define CK_Replace 303 +#define CK_ReplaceContinue 304 +#define CK_SearchStop 8033 +#define CK_Help 404 +#define CK_Edit 7020 +#define CK_Shell 801 +#ifdef HAVE_CHARSET #define CK_SelectCodepage 2002 -#define CK_ShowCommandLine 2001 -#define CK_StartExtMap1 2021 -#define CK_StartExtMap2 2022 +#endif +#define CK_History 4021 +#define CK_HistoryNext 4022 +#define CK_HistoryPrev 4023 +#define CK_Complete 305 +#define CK_SaveAs 104 +#define CK_Goto 407 +#define CK_Reread 7053 +#define CK_Refresh 406 +#define CK_Suspend 7060 +#define CK_Swap 7061 +#define CK_HotList 7048 +#define CK_ScreenList 7079 +#define CK_ScreenNext 7080 +#define CK_ScreenPrev 7081 +#define CK_FilePrev 111 +#define CK_FileNext 112 +#define CK_DeleteToWordBegin 24 +#define CK_DeleteToWordEnd 25 +#define CK_ShowNumbers 490 +#define CK_Store 701 +#define CK_Cut 702 +#define CK_Paste 703 +#define CK_Mark 201 +#define CK_MarkLeft 606 +#define CK_MarkRight 607 +#define CK_MarkUp 8021 +#define CK_MarkDown 8022 +#define CK_MarkToWordBegin 608 +#define CK_MarkToWordEnd 609 +#define CK_MarkToHome 612 +#define CK_MarkToEnd 613 +#define CK_ToggleNavigation 5027 +#define CK_Sort 412 +#define CK_Options 7007 +#define CK_LearnKeys 7037 +#define CK_Bookmark 5013 +#define CK_Quit 402 +#define CK_QuitQuiet 7050 +/* C-x or similar */ +#define CK_ExtendedKeyMap 820 /* main commands */ -#define CK_AddHotlist 7001 -#define CK_ChangeListingCmd 7002 -#define CK_ChmodCmd 7003 -#define CK_ChownAdvancedCmd 7004 -#define CK_ChownCmd 7005 -#define CK_CompareDirsCmd 7006 -#define CK_ConfigureBox 7007 -#define CK_ConfigureVfs 7008 -#define CK_ConfirmBox 7009 -#define CK_CopyCmd 7010 -#define CK_CopyCurrentPathname 7011 -#define CK_CopyCurrentReadlink 7012 -#define CK_CopyCurrentTagged 7013 -#define CK_CopyOtherPathname 7014 -#define CK_CopyOtherReadlink 7015 -#define CK_CopyOtherTagged 7016 -#define CK_DeleteCmd 7017 -#define CK_DirsizesCmd 7018 -#define CK_DisplayBitsBox 7019 -#define CK_EditCmd 7020 -#define CK_EditExtFileCmd 7021 -#define CK_EditFhlFileCmd 7022 -#define CK_EditMcMenuCmd 7023 -#define CK_EditSymlinkCmd 7024 -#define CK_EditSyntaxCmd 7025 -#define CK_EditUserMenuCmd 7026 +#ifdef USE_INTERNAL_EDIT +#define CK_EditForceInternal 7082 +#endif +#define CK_View 7071 +#define CK_ViewRaw 8011 +#define CK_ViewFile 7072 +#define CK_ViewFiltered 7029 +#define CK_Find 419 +#define CK_DirSize 7058 +#define CK_HotListAdd 7001 +#define CK_PanelListingChange 7002 +#define CK_CompareDirs 7006 +#define CK_OptionsVfs 7008 +#define CK_OptionsConfirm 7009 +#define CK_PutCurrentLink 7012 +#define CK_PutOtherLink 7015 +#define CK_OptionsDisplayBits 7019 +#define CK_EditExtensionsFile 7021 +#define CK_EditFileHighlightFile 7022 +#define CK_LinkSymbolicEdit 7024 #define CK_ExternalPanelize 7027 -#define CK_FilterCmd 7028 -#define CK_FilteredViewCmd 7029 -#define CK_FindCmd 7030 -#define CK_FishlinkCmd 7031 -#define CK_FtplinkCmd 7032 -#define CK_HistoryCmd 7033 -#define CK_InfoCmd 7034 -#define CK_JobsCmd 7035 -#define CK_LayoutBox 7036 -#define CK_LearnKeys 7037 -#define CK_LinkCmd 7038 -#define CK_ListingCmd 7039 -#define CK_ListmodeCmd 7042 -#define CK_MenuLastSelectedCmd 7044 -#define CK_MkdirCmd 7045 -#define CK_QuickCdCmd 7047 -#define CK_QuickChdirCmd 7048 -#define CK_QuickViewCmd 7049 -#define CK_QuietQuitCmd 7050 -#define CK_QuitCmd 7051 -#define CK_RenameCmd 7052 -#define CK_RereadCmd 7053 -#define CK_ReselectVfs 7054 -#define CK_ReverseSelectionCmd 7055 -#define CK_SaveSetupCmd 7056 -#define CK_SelectCmd 7057 -#define CK_SingleDirsizeCmd 7058 -#define CK_SmblinkCmd 7059 -#define CK_SuspendCmd 7060 -#define CK_SwapCmd 7061 -#define CK_SymlinkCmd 7062 -#define CK_ToggleListingCmd 7063 -#define CK_ToggleShowHidden 7064 -#define CK_TreeCmd 7065 -#define CK_TreeBoxCmd 7066 -#define CK_UndeleteCmd 7067 -#define CK_UnselectCmd 7068 -#define CK_UserFileMenuCmd 7069 -#define CK_UserMenuCmd 7070 -#define CK_ViewCmd 7071 -#define CK_ViewFileCmd 7072 -#define CK_HelpCmd 7073 -#define CK_MenuCmd 7074 -#define CK_TogglePanelsSplit 7075 -#define CK_DiffViewCmd 7076 -#define CK_PanelOptionsBox 7077 -#define CK_RelativeSymlinkCmd 7078 -#define CK_DialogListCmd 7079 -#define CK_DialogNextCmd 7080 -#define CK_DialogPrevCmd 7081 -#define CK_EditForceInternalCmd 7082 +#define CK_Filter 7028 +#define CK_ConnectFish 7031 +#define CK_ConnectFtp 7032 +#define CK_ConnectSmb 7059 +#define CK_PanelInfo 7034 +#define CK_Jobs 7035 +#define CK_OptionsLayout 7036 +#define CK_Link 7038 +#define CK_PanelListing 7039 +#define CK_ListMode 7042 +#define CK_CdQuick 7047 +#define CK_PanelQuickView 7049 +#define CK_VfsList 7054 +#define CK_SaveSetup 7056 +#define CK_LinkSymbolic 7062 +#define CK_PanelListingSwitch 7063 +#define CK_ShowHidden 7064 +#define CK_PanelTree 7065 +#define CK_Tree 7066 +#define CK_Undelete 7067 +#define CK_SplitVertHoriz 7075 +#ifdef USE_DIFF_VIEW +#define CK_CompareFiles 7076 +#endif /* USE_DIFF_VIEW */ +#define CK_OptionsPanel 7077 +#define CK_LinkSymbolicRelative 7078 +#define CK_PutCurrentPath 7011 +#define CK_PutOtherPath 7014 +#define CK_PutCurrentTagged 7013 +#define CK_PutOtherTagged 7016 +#define CK_Select 7057 +#define CK_Unselect 7068 +#define CK_SelectInvert 7055 /* panels */ -#define CK_PanelChdirOtherPanel 8001 -#define CK_PanelChdirToReadlink 8002 -#define CK_PanelCmdCopyLocal 8003 -#define CK_PanelCmdDeleteLocal 8004 -#define CK_PanelCmdDoEnter 8005 -#define CK_PanelCmdEditNew 8006 -#define CK_PanelCmdRenameLocal 8007 -#define CK_PanelCmdReverseSelection 8008 -#define CK_PanelCmdSelect 8009 -#define CK_PanelCmdUnselect 8010 -#define CK_PanelCmdViewSimple 8011 -#define CK_PanelGotoChildDir 8012 -#define CK_PanelGotoParentDir 8013 -#define CK_PanelDirectoryHistoryList 8014 -#define CK_PanelDirectoryHistoryNext 8015 -#define CK_PanelDirectoryHistoryPrev 8016 -#define CK_PanelGotoBottomFile 8017 -#define CK_PanelGotoMiddleFile 8018 -#define CK_PanelGotoTopFile 8019 -#define CK_PanelMarkFile 8020 -#define CK_PanelMarkFileUp 8021 -#define CK_PanelMarkFileDown 8022 -#define CK_PanelMoveDown 8023 -#define CK_PanelMoveEnd 8024 -#define CK_PanelMoveHome 8025 -#define CK_PanelMoveUp 8026 -#define CK_PanelMoveLeft 8027 -#define CK_PanelMoveRight 8028 -#define CK_PanelNextPage 8029 -#define CK_PanelPrevPage 8030 -#define CK_PanelSetPanelEncoding 8031 -#define CK_PanelStartSearch 8032 -#define CK_PanelStopSearch 8033 -#define CK_PanelSyncOtherPanel 8034 -#define CK_PanelToggleSortOrderNext 8035 -#define CK_PanelToggleSortOrderPrev 8036 -#define CK_PanelSelectSortOrder 8037 -#define CK_PanelReverseSort 8038 -#define CK_PanelSortOrderByName 8039 -#define CK_PanelSortOrderByExt 8040 -#define CK_PanelSortOrderBySize 8041 -#define CK_PanelSortOrderByMTime 8042 -#define CK_PanelSmartGotoParentDir 8043 +#define CK_PanelOtherCd 8001 +#define CK_PanelOtherCdLink 8002 +#define CK_CopySingle 8003 +#define CK_MoveSingle 8007 +#define CK_DeleteSingle 8004 +#define CK_CdChild 8012 +#define CK_CdParent 8013 +#define CK_CdParentSmart 8043 +#define CK_PanelOtherSync 8034 +#define CK_SortNext 8035 +#define CK_SortPrev 8036 +#define CK_SortReverse 8038 +#define CK_SortByName 8039 +#define CK_SortByExt 8040 +#define CK_SortBySize 8041 +#define CK_SortByMTime 8042 /* dialog */ -#define CK_DialogOK 3001 -#define CK_DialogCancel 3002 -#define CK_DialogPrevItem 3003 -#define CK_DialogNextItem 3004 -#define CK_DialogHelp 3005 -#define CK_DialogSuspend 3006 -#define CK_DialogRefresh 3007 +#define CK_Ok 3001 +#define CK_Cancel 3002 /* input */ -#define CK_InputBol 4001 -#define CK_InputEol 4002 -#define CK_InputMoveLeft 4003 -#define CK_InputWordLeft 4004 -#define CK_InputBackwardChar 4005 -#define CK_InputBackwardWord 4006 -#define CK_InputMoveRight 4007 -#define CK_InputWordRight 4008 -#define CK_InputForwardChar 4009 -#define CK_InputForwardWord 4010 -#define CK_InputBackwardDelete 4011 -#define CK_InputDeleteChar 4012 -#define CK_InputKillWord 4013 -#define CK_InputBackwardKillWord 4014 -#define CK_InputSetMark 4015 -#define CK_InputKillRegion 4016 -#define CK_InputKillSave 4017 -#define CK_InputYank 4018 -#define CK_InputCopyRegion 4019 -#define CK_InputKillLine 4020 -#define CK_InputHistoryPrev 4021 -#define CK_InputHistoryNext 4022 -#define CK_InputHistoryShow 4023 -#define CK_InputComplete 4024 -#define CK_InputPaste 4025 -#define CK_InputClearLine 4026 -#define CK_InputLeftHighlight 4027 -#define CK_InputRightHighlight 4028 -#define CK_InputWordLeftHighlight 4029 -#define CK_InputWordRightHighlight 4030 -#define CK_InputBolHighlight 4031 -#define CK_InputEolHighlight 4032 - -/* listbox */ -#define CK_ListboxMoveUp 4500 -#define CK_ListboxMoveDown 4501 -#define CK_ListboxMoveHome 4502 -#define CK_ListboxMoveEnd 4503 -#define CK_ListboxMovePgUp 4504 -#define CK_ListboxMovePgDn 4505 -#define CK_ListboxDeleteItem 4506 -#define CK_ListboxDeleteAll 4507 +#define CK_Yank 4018 /* help */ -#define CK_HelpHelp 1001 -#define CK_HelpIndex 1002 -#define CK_HelpBack 1003 -#define CK_HelpQuit 1004 -#define CK_HelpMoveUp 1005 -#define CK_HelpMoveDown 1006 -#define CK_HelpSelectLink 1007 -#define CK_HelpNextLink 1008 -#define CK_HelpPrevLink 1009 -#define CK_HelpNextNode 1010 -#define CK_HelpPrevNode 1011 -#define CK_HelpMovePgDn 1012 -#define CK_HelpMovePgUp 1013 -#define CK_HelpMoveHalfPgDn 1014 -#define CK_HelpMoveHalfPgUp 1015 -#define CK_HelpMoveTop 1016 -#define CK_HelpMoveBottom 1017 +#define CK_Index 1002 +#define CK_Back 1003 +#define CK_LinkNext 1008 +#define CK_LinkPrev 1009 +#define CK_NodeNext 1010 +#define CK_NodePrev 1011 /* tree */ -#define CK_TreeHelp 6001 -#define CK_TreeForget 6003 -#define CK_TreeToggleNav 6004 -#define CK_TreeCopy 6005 -#define CK_TreeMove 6006 -#define CK_TreeMake 6007 -#define CK_TreeMoveUp 6011 -#define CK_TreeMoveDown 6012 -#define CK_TreeMoveLeft 6013 -#define CK_TreeMoveRight 6014 -#define CK_TreeMoveHome 6015 -#define CK_TreeMoveEnd 6016 -#define CK_TreeMovePgUp 6017 -#define CK_TreeMovePgDn 6018 -#define CK_TreeOpen 6019 -#define CK_TreeRescan 6020 -#define CK_TreeStartSearch 6021 -#define CK_TreeRemove 6022 +#define CK_Forget 6003 #ifdef USE_INTERNAL_EDIT /* cursor movements */ -#define CK_BackSpace 1 -#define CK_Delete 2 -#define CK_Enter 3 -#define CK_Page_Up 4 -#define CK_Page_Down 5 -#define CK_Left 6 -#define CK_Right 7 -#define CK_Word_Left 8 -#define CK_Word_Right 9 -#define CK_Up 10 -#define CK_Down 11 -#define CK_Home 12 -#define CK_End 13 #define CK_Tab 14 #define CK_Undo 15 -#define CK_Redo 16 -#define CK_Beginning_Of_Text 17 -#define CK_End_Of_Text 18 -#define CK_Scroll_Up 19 -#define CK_Scroll_Down 20 +#define CK_ScrollUp 19 +#define CK_ScrollDown 20 #define CK_Return 21 -#define CK_Begin_Page 22 -#define CK_End_Page 23 -#define CK_Delete_Word_Left 24 -#define CK_Delete_Word_Right 25 -#define CK_Paragraph_Up 26 -#define CK_Paragraph_Down 27 +#define CK_ParagraphUp 26 +#define CK_ParagraphDown 27 /* file commands */ #define CK_Save 101 -#define CK_Load 102 -#define CK_New 103 -#define CK_Save_As 104 -#define CK_Load_Prev_File 111 -#define CK_Load_Next_File 112 -#define CK_Load_Syntax_File 121 -#define CK_Load_Menu_File 122 -#define CK_Menu 123 +#define CK_EditFile 102 +#define CK_EditNew 103 +#define CK_EditSyntaxFile 121 /* block commands */ -#define CK_Mark 201 -#define CK_Copy 202 -#define CK_Move 203 -#define CK_Remove 204 #define CK_Unmark 206 -#define CK_Save_Block 207 -#define CK_Column_Mark 208 -#define CK_Shift_Block_Left 211 -#define CK_Shift_Block_Right 212 -#define CK_Mark_All 213 -#define CK_Mark_Word 214 -#define CK_Mark_Line 215 - -/* search and replace */ -#define CK_Find 301 -#define CK_Find_Again 302 -#define CK_Replace 303 -#define CK_Replace_Again 304 -#define CK_Complete_Word 305 -#if 0 -/* debugger commands */ -#define CK_Debug_Start 350 -#define CK_Debug_Stop 351 -#define CK_Debug_Toggle_Break 352 -#define CK_Debug_Clear 353 -#define CK_Debug_Next 354 -#define CK_Debug_Step 355 -#define CK_Debug_Back_Trace 356 -#define CK_Debug_Continue 357 -#define CK_Debug_Enter_Command 358 -#define CK_Debug_Until_Curser 359 -#endif -#define CK_Insert_File 401 -#define CK_Quit 402 -#define CK_Toggle_Insert 403 -#define CK_Help 404 +#define CK_BlockSave 207 +#define CK_MarkColumn 208 +#define CK_BlockShiftLeft 211 +#define CK_BlockShiftRight 212 +#define CK_MarkAll 213 +#define CK_MarkWord 214 +#define CK_MarkLine 215 +#define CK_InsertFile 401 +#define CK_InsertOverwrite 403 #define CK_Date 405 -#define CK_Refresh 406 -#define CK_Goto 407 -#define CK_Delete_Line 408 -#define CK_Delete_To_Line_End 409 -#define CK_Delete_To_Line_Begin 410 -#define CK_Man_Page 411 -#define CK_Sort 412 +#define CK_DeleteLine 408 +#define CK_DeleteToHome 409 +#define CK_DeleteToEnd 410 #define CK_Mail 413 -#define CK_Cancel 414 -#define CK_Complete 415 -#define CK_Paragraph_Format 416 -#define CK_Util 417 -#define CK_Type_Load_Python 418 -#define CK_Find_File 419 -#define CK_Ctags 420 -#define CK_Match_Bracket 421 -#define CK_Terminal 422 -#define CK_Terminal_App 423 -#define CK_ExtCmd 424 -#define CK_User_Menu 425 -#define CK_Find_Definition 426 -#define CK_Edit_Options 427 -#define CK_Edit_Save_Mode 428 -#define CK_Choose_Syntax 429 +#define CK_ParagraphFormat 416 +#define CK_MatchBracket 421 +#define CK_ExternalCommand 424 +#define CK_OptionsSaveMode 428 #define CK_About 430 -#if 0 -/* application control */ -#define CK_Save_Desktop 451 -#define CK_New_Window 452 -#define CK_Cycle 453 -#define CK_Save_And_Quit 455 -#define CK_Run_Another 456 -#define CK_Check_Save_And_Quit 457 -#define CK_Maximize 458 -#endif -#define CK_Toggle_Show_Margin 460 -#define CK_Toggle_Tab_TWS 470 -#define CK_Toggle_Syntax 480 -#define CK_Toggle_Line_State 490 -/* macro */ -#define CK_Begin_Record_Macro 501 -#define CK_End_Record_Macro 502 -#define CK_Delete_Macro 503 -/* book mark */ -#define CK_Toggle_Bookmark 550 -#define CK_Flush_Bookmarks 551 -#define CK_Next_Bookmark 552 -#define CK_Prev_Bookmark 553 -/* highlight commands */ -#define CK_Page_Up_Highlight 604 -#define CK_Page_Down_Highlight 605 -#define CK_Left_Highlight 606 -#define CK_Right_Highlight 607 -#define CK_Word_Left_Highlight 608 -#define CK_Word_Right_Highlight 609 -#define CK_Up_Highlight 610 -#define CK_Down_Highlight 611 -#define CK_Home_Highlight 612 -#define CK_End_Highlight 613 -#define CK_Beginning_Of_Text_Highlight 614 -#define CK_End_Of_Text_Highlight 615 -#define CK_Begin_Page_Highlight 616 -#define CK_End_Page_Highlight 617 -#define CK_Scroll_Up_Highlight 618 -#define CK_Scroll_Down_Highlight 619 -#define CK_Paragraph_Up_Highlight 620 -#define CK_Paragraph_Down_Highlight 621 -/* alt highlight commands */ -#define CK_Page_Up_Alt_Highlight 654 -#define CK_Page_Down_Alt_Highlight 655 -#define CK_Left_Alt_Highlight 656 -#define CK_Right_Alt_Highlight 657 -#define CK_Word_Left_Alt_Highlight 658 -#define CK_Word_Right_Alt_Highlight 659 -#define CK_Up_Alt_Highlight 660 -#define CK_Down_Alt_Highlight 661 -#define CK_Home_Alt_Highlight 662 -#define CK_End_Alt_Highlight 663 -#define CK_Beginning_Of_Text_Alt_Highlight 664 -#define CK_End_Of_Text_Alt_Highlight 665 -#define CK_Begin_Page_Alt_Highlight 666 -#define CK_End_Page_Alt_Highlight 667 -#define CK_Scroll_Up_Alt_Highlight 668 -#define CK_Scroll_Down_Alt_Highlight 669 -#define CK_Paragraph_Up_Alt_Highlight 670 -#define CK_Paragraph_Down_Alt_Highlight 671 -/* X clipboard operations */ -#define CK_XStore 701 -#define CK_XCut 702 -#define CK_XPaste 703 -#define CK_Selection_History 704 -#define CK_Shell 801 -/* C-x or similar */ -#define CK_Ext_Mode 820 -#define CK_Insert_Literal 851 -#define CK_Begin_End_Macro 853 -#define CK_Begin_End_Repeat 854 -#define CK_Begin_Record_Repeat 855 -#define CK_End_Record_Repeat 856 +#define CK_ShowMargin 460 +#define CK_ShowTabTws 470 +#define CK_SyntaxOnOff 480 +#define CK_SyntaxChoose 429 +#define CK_InsertLiteral 851 +/* bookmarks */ +#define CK_BookmarkFlush 551 +#define CK_BookmarkNext 552 +#define CK_BookmarkPrev 553 +/* mark commands */ +#define CK_MarkPageUp 604 +#define CK_MarkPageDown 605 +#define CK_MarkToFileBegin 614 +#define CK_MarkToFileEnd 615 +#define CK_MarkToPageBegin 616 +#define CK_MarkToPageEnd 617 +#define CK_MarkScrollUp 618 +#define CK_MarkScrollDown 619 +#define CK_MarkParagraphUp 620 +#define CK_MarkParagraphDown 621 +/* column mark commands */ +#define CK_MarkColumnPageUp 654 +#define CK_MarkColumnPageDown 655 +#define CK_MarkColumnLeft 656 +#define CK_MarkColumnRight 657 +#define CK_MarkColumnUp 660 +#define CK_MarkColumnDown 661 +#define CK_MarkColumnScrollUp 668 +#define CK_MarkColumnScrollDown 669 +#define CK_MarkColumnParagraphUp 670 +#define CK_MarkColumnParagraphDown 671 +/* macros */ +#define CK_MacroStartRecord 501 +#define CK_MacroStopRecord 502 +#define CK_MacroStartStopRecord 853 +#define CK_MacroExecute 852 +#define CK_MacroDelete 503 +#define CK_RepeatStartStopRecord 854 +#define CK_RepeatStartRecord 855 +#define CK_RepeatStopRecord 856 #endif /* USE_INTERNAL_EDIT */ /* viewer */ -#define CK_ViewHelp 5001 -#define CK_ViewToggleWrapMode 5002 -#define CK_ViewToggleHexEditMode 5003 -#define CK_ViewToggleHexMode 5004 -#define CK_ViewGoto 5005 -#define CK_ViewHexEditSave 5006 -#define CK_ViewSearch 5007 -#define CK_ViewToggleMagicMode 5008 -#define CK_ViewToggleNroffMode 5009 -#define CK_ViewQuit 5010 -#define CK_ViewContinueSearch 5011 -#define CK_ViewGotoBookmark 5012 -#define CK_ViewNewBookmark 5013 -#define CK_ViewMoveUp 5014 -#define CK_ViewMoveDown 5015 -#define CK_ViewMoveLeft 5016 -#define CK_ViewMoveRight 5017 -#define CK_ViewMovePgDn 5018 -#define CK_ViewMovePgUp 5019 -#define CK_ViewMoveHalfPgDn 5020 -#define CK_ViewMoveHalfPgUp 5021 -#define CK_ViewMoveToBol 5022 -#define CK_ViewMoveToEol 5023 -#define CK_ViewNextFile 5024 -#define CK_ViewPrevFile 5025 -#define CK_ViewToggleRuler 5026 -#define CK_ViewToggleHexNavMode 5027 -#define CK_ViewMoveTop 5028 -#define CK_ViewMoveBottom 5029 -#define CK_ViewMoveLeft10 5030 -#define CK_ViewMoveRight10 5031 +#define CK_WrapMode 5002 +#define CK_HexEditMode 5003 +#define CK_HexMode 5004 +#define CK_MagicMode 5008 +#define CK_NroffMode 5009 +#define CK_BookmarkGoto 5012 +#define CK_Ruler 5026 #ifdef USE_DIFF_VIEW /* diff viewer */ -#define CK_DiffDisplaySymbols 9001 -#define CK_DiffDisplayNumbers 9002 -#define CK_DiffFull 9003 -#define CK_DiffEqual 9004 -#define CK_DiffSplitMore 9005 -#define CK_DiffSplitLess 9006 -#define CK_DiffShowDiff 9008 -#define CK_DiffSetTab2 9009 -#define CK_DiffSetTab3 9010 -#define CK_DiffSetTab4 9011 -#define CK_DiffSetTab8 9012 -#define CK_DiffSwapPanel 9013 -#define CK_DiffRedo 9014 -#define CK_DiffNextHunk 9015 -#define CK_DiffPrevHunk 9016 -#define CK_DiffGoto 9017 -#define CK_DiffEditCurrent 9018 -#define CK_DiffEditOther 9019 -#define CK_DiffSearch 9020 -#define CK_DiffEOF 9021 -#define CK_DiffBOF 9022 -#define CK_DiffDown 9023 -#define CK_DiffUp 9024 -#define CK_DiffLeft 9025 -#define CK_DiffRight 9026 -#define CK_DiffQuickLeft 9027 -#define CK_DiffQuickRight 9028 -#define CK_DiffPageDown 9029 -#define CK_DiffPageUp 9030 -#define CK_DiffHome 9031 -#define CK_DiffEnd 9032 -#define CK_DiffQuit 9033 -#define CK_DiffHelp 9034 -#define CK_DiffMergeCurrentHunk 9035 -#define CK_DiffSave 9036 -#define CK_DiffContinueSearch 9037 -#define CK_DiffOptions 9038 +#define CK_ShowSymbols 9001 +#define CK_SplitFull 9003 +#define CK_SplitEqual 9004 +#define CK_SplitMore 9005 +#define CK_SplitLess 9006 +#define CK_Tab2 9009 +#define CK_Tab3 9010 +#define CK_Tab4 9011 +#define CK_Tab8 9012 +#define CK_HunkNext 9015 +#define CK_HunkPrev 9016 +#define CK_EditOther 9019 +#define CK_Merge 9035 #endif /* USE_DIFF_VIEW */ -#define CK_Pipe_Block(i) (10000+(i)) +#define CK_PipeBlock(i) (10000+(i)) #define CK_Macro(i) (20000+(i)) #define CK_Last_Macro CK_Macro(0x7FFF) diff --git a/lib/widget/dialog.c b/lib/widget/dialog.c index cb52c754a..cbc210010 100644 --- a/lib/widget/dialog.c +++ b/lib/widget/dialog.c @@ -246,48 +246,50 @@ dlg_execute_cmd (Dlg_head * h, unsigned long command) cb_ret_t ret = MSG_HANDLED; switch (command) { - case CK_DialogOK: + case CK_Ok: h->ret_value = B_ENTER; dlg_stop (h); break; - case CK_DialogCancel: + case CK_Cancel: h->ret_value = B_CANCEL; dlg_stop (h); break; - case CK_DialogPrevItem: + case CK_Up: + case CK_Left: dlg_one_up (h); break; - case CK_DialogNextItem: + case CK_Down: + case CK_Right: dlg_one_down (h); break; - case CK_DialogHelp: + case CK_Help: interactive_display (NULL, h->help_ctx); do_refresh (); break; - case CK_DialogSuspend: + case CK_Suspend: suspend_cmd (); refresh_cmd (); break; - case CK_DialogRefresh: + case CK_Refresh: refresh_cmd (); break; - case CK_DialogListCmd: + case CK_ScreenList: if (!h->modal) dialog_switch_list (); else ret = MSG_NOT_HANDLED; break; - case CK_DialogNextCmd: + case CK_ScreenNext: if (!h->modal) dialog_switch_next (); else ret = MSG_NOT_HANDLED; break; - case CK_DialogPrevCmd: + case CK_ScreenPrev: if (!h->modal) dialog_switch_prev (); else @@ -1102,7 +1104,7 @@ dlg_process_event (Dlg_head * h, int key, Gpm_Event * event) if (key == EV_NONE) { if (tty_got_interrupt ()) - dlg_execute_cmd (h, CK_DialogCancel); + dlg_execute_cmd (h, CK_Cancel); return; } diff --git a/lib/widget/input.c b/lib/widget/input.c index 141454714..6b697bbc4 100644 --- a/lib/widget/input.c +++ b/lib/widget/input.c @@ -747,11 +747,9 @@ input_execute_cmd (WInput * in, unsigned long command) cb_ret_t res = MSG_HANDLED; /* a highlight command like shift-arrow */ - if (command == CK_InputLeftHighlight || - command == CK_InputRightHighlight || - command == CK_InputWordLeftHighlight || - command == CK_InputWordRightHighlight || - command == CK_InputBolHighlight || command == CK_InputEolHighlight) + if (command == CK_MarkLeft || command == CK_MarkRight || + command == CK_MarkToWordBegin || command == CK_MarkToWordEnd || + command == CK_MarkToHome || command == CK_MarkToEnd) { if (!in->highlight) { @@ -762,53 +760,41 @@ input_execute_cmd (WInput * in, unsigned long command) switch (command) { - case CK_InputForwardWord: - case CK_InputBackwardWord: - case CK_InputForwardChar: - case CK_InputBackwardChar: + case CK_WordRight: + case CK_WordLeft: + case CK_Right: + case CK_Left: if (in->highlight) input_mark_cmd (in, FALSE); } switch (command) { - case CK_InputBol: - case CK_InputBolHighlight: + case CK_Home: + case CK_MarkToHome: beginning_of_line (in); break; - case CK_InputEol: - case CK_InputEolHighlight: + case CK_End: + case CK_MarkToEnd: end_of_line (in); break; - case CK_InputMoveLeft: - case CK_InputLeftHighlight: + case CK_Left: + case CK_MarkLeft: backward_char (in); break; - case CK_InputWordLeft: - case CK_InputWordLeftHighlight: + case CK_WordLeft: + case CK_MarkToWordBegin: backward_word (in); break; - case CK_InputMoveRight: - case CK_InputRightHighlight: + case CK_Right: + case CK_MarkRight: forward_char (in); break; - case CK_InputWordRight: - case CK_InputWordRightHighlight: + case CK_WordRight: + case CK_MarkToWordEnd: forward_word (in); break; - case CK_InputBackwardChar: - backward_char (in); - break; - case CK_InputBackwardWord: - backward_word (in); - break; - case CK_InputForwardChar: - forward_char (in); - break; - case CK_InputForwardWord: - forward_word (in); - break; - case CK_InputBackwardDelete: + case CK_BackSpace: if (in->highlight) { long m1, m2; @@ -818,7 +804,7 @@ input_execute_cmd (WInput * in, unsigned long command) else backward_delete (in); break; - case CK_InputDeleteChar: + case CK_Delete: if (in->first) port_region_marked_for_delete (in); else if (in->highlight) @@ -830,60 +816,56 @@ input_execute_cmd (WInput * in, unsigned long command) else delete_char (in); break; - case CK_InputKillWord: + case CK_DeleteToWordEnd: kill_word (in); break; - case CK_InputBackwardKillWord: + case CK_DeleteToWordBegin: back_kill_word (in); break; - case CK_InputSetMark: + case CK_Mark: input_mark_cmd (in, TRUE); break; - case CK_InputKillRegion: + case CK_Remove: delete_region (in, in->point, in->mark); break; - case CK_InputKillLine: - /* clear command line from cursor to the EOL */ + case CK_DeleteToEnd: kill_line (in); break; - case CK_InputClearLine: - /* clear command line */ + case CK_Clear: clear_line (in); break; - case CK_InputCopyRegion: + case CK_Store: copy_region (in, in->mark, in->point); break; - case CK_InputKillSave: + case CK_Cut: copy_region (in, in->mark, in->point); delete_region (in, in->point, in->mark); break; - case CK_InputYank: + case CK_Yank: yank (in); break; - case CK_InputPaste: + case CK_Paste: ins_from_clip (in); break; - case CK_InputHistoryPrev: + case CK_HistoryPrev: hist_prev (in); break; - case CK_InputHistoryNext: + case CK_HistoryNext: hist_next (in); break; - case CK_InputHistoryShow: + case CK_History: do_show_hist (in); break; - case CK_InputComplete: + case CK_Complete: complete (in); break; default: res = MSG_NOT_HANDLED; } - if (command != CK_InputLeftHighlight && - command != CK_InputRightHighlight && - command != CK_InputWordLeftHighlight && - command != CK_InputWordRightHighlight && - command != CK_InputBolHighlight && command != CK_InputEolHighlight) + if (command != CK_MarkLeft && command != CK_MarkRight && + command != CK_MarkToWordBegin && command != CK_MarkToWordEnd && + command != CK_MarkToHome && command != CK_MarkToEnd) in->highlight = FALSE; return res; @@ -1144,7 +1126,7 @@ input_handle_char (WInput * in, int key) } else { - if (command != CK_InputComplete) + if (command != CK_Complete) input_free_completions (in); input_execute_cmd (in, command); v = MSG_HANDLED; @@ -1172,7 +1154,7 @@ input_key_is_in_map (WInput * in, int key) if (command == CK_Ignore_Key) return 0; - return (command == CK_InputComplete) ? 2 : 1; + return (command == CK_Complete) ? 2 : 1; } /* --------------------------------------------------------------------------------------------- */ diff --git a/lib/widget/listbox.c b/lib/widget/listbox.c index d91d2e6d7..497368bda 100644 --- a/lib/widget/listbox.c +++ b/lib/widget/listbox.c @@ -237,27 +237,27 @@ listbox_execute_cmd (WListbox * l, unsigned long command) switch (command) { - case CK_ListboxMoveUp: + case CK_Up: listbox_back (l); break; - case CK_ListboxMoveDown: + case CK_Down: listbox_fwd (l); break; - case CK_ListboxMoveHome: + case CK_Top: listbox_select_first (l); break; - case CK_ListboxMoveEnd: + case CK_Bottom: listbox_select_last (l); break; - case CK_ListboxMovePgUp: + case CK_PageUp: for (i = 0; (i < l->widget.lines - 1) && (l->pos > 0); i++) listbox_back (l); break; - case CK_ListboxMovePgDn: + case CK_PageDown: for (i = 0; (i < l->widget.lines - 1) && (l->pos < l->count - 1); i++) listbox_fwd (l); break; - case CK_ListboxDeleteItem: + case CK_Delete: if (l->deletable) { gboolean is_last = (l->pos + 1 >= l->count); @@ -268,7 +268,7 @@ listbox_execute_cmd (WListbox * l, unsigned long command) l->top--; } break; - case CK_ListboxDeleteAll: + case CK_Clear: if (l->deletable && confirm_history_cleanup /* TRANSLATORS: no need to translate 'DialogTitle', it's just a context prefix */ && (query_dialog (Q_ ("DialogTitle|History cleanup"), diff --git a/misc/mc.keymap.default b/misc/mc.keymap.default index 61cea3ad5..f530ece5e 100644 --- a/misc/mc.keymap.default +++ b/misc/mc.keymap.default @@ -1,439 +1,427 @@ [main] -CmdHelp = f1 -CmdUserMenu = f2 -CmdView = f3 -CmdViewFile = f13 -CmdEdit = f4 -CmdEditForceInternal = -CmdCopy = f5 -CmdRename = f6 -CmdMkdir = f7 -CmdDelete = f8 -CmdMenu = f9 -CmdQuit = f10 -CmdMenuLastSelected = f19 -CmdQuietQuit = f20 -CmdFind = alt-question -CmdQuickCd = alt-c -CmdQuickChdir = ctrl-backslash -CmdReread = ctrl-r -CmdSingleDirsize = ctrl-space -CmdSuspend = ctrl-z -CmdSwapPanel = ctrl-u -CmdHistory = alt-h -CmdListing = -CmdToggleListing = alt-t -CmdToggleShowHidden = alt-dot -CmdTogglePanelsSplit = alt-comma -ShowCommandLine = ctrl-o -CmdCopyCurrentPathname = alt-a -CmdCopyOtherPathname = alt-shift-a -CmdFilteredView = alt-exclamation -CmdSelect = kpplus -CmdUnselect = kpminus -CmdReverseSelection = kpasterisk -CmdDialogList = alt-prime -ExtMap1 = ctrl-x +Help = f1 +UserMenu = f2 +View = f3 +ViewFile = +Edit = f4 +EditForceInternal = +Copy = f5 +Move = f6 +MakeDir = f7 +Delete = f8 +Menu = f9 +Quit = f10 +MenuLastSelected = f19 +QuitQuiet = f20 +Find = alt-question +CdQuick = alt-c +HotList = ctrl-backslash +Reread = ctrl-r +DirSize = ctrl-space +Suspend = ctrl-z +Swap = ctrl-u +History = alt-h +PanelListing = +PanelListingSwitch = alt-t +PanelListingChange = +ShowHidden = alt-dot +SplitVertHoriz = alt-comma +Shell = ctrl-o +PutCurrentPath = alt-a +PutOtherPath = alt-shift-a +ViewFiltered = alt-exclamation +Select = kpplus +Unselect = kpminus +SelectInvert = kpasterisk +ScreenList = alt-prime +OptionsLayout = +OptionsPanel = +OptionsConfirm = +OptionsDisplayBits = +OptionsVfs = +LearnKeys = +SaveSetup = +EditExtensionsFile = +EditFileHighlightFile = +Filter = +ConnectFish = +ConnectFtp = +ConnectSmb = +Undelete = +ExtendedKeyMap = ctrl-x [main:xmap] -CmdChmod = c -CmdChown = o -CmdCompareDirs = d -CmdEditSymlink = ctrl-s -CmdLink = l -CmdSymlink = s -CmdRelativeSymlink = v -CmdInfo = i -CmdQuickView = q -CmdExternalPanelize = exclamation -CmdReselectVfs = a -CmdJobs = j -CmdCopyCurrentPathname = p -CmdCopyOtherPathname = ctrl-p -CmdCopyCurrentTagged = t -CmdCopyOtherTagged = ctrl-t -CmdDiffView = ctrl-d +ChangeMode = c +ChangeOwn = o +CompareDirs = d +CompareFiles = ctrl-d +HotListAdd = h +LinkSymbolicEdit = ctrl-s +Link = l +LinkSymbolic = s +LinkSymbolicRelative = v +PanelInfo = i +PanelQuickView = q +ExternalPanelize = exclamation +VfsList = a +Jobs = j +PutCurrentPath = p +PutOtherPath = ctrl-p +PutCurrentTagged = t +PutOtherTagged = ctrl-t +PutCurrentLink = r +PutOtherLink = ctrl-r [panel] -PanelStartSearch = ctrl-s; alt-s -PanelMarkFile = insert; ctrl-t -PanelMarkFileUp = shift-up -PanelMarkFileDown = shift-down -PanelMoveDown = down; ctrl-n -PanelMoveUp = up; ctrl-p -PanelMoveLeft = left -PanelMoveRight = right -PanelPrevPage = pgup; alt-v -PanelNextPage = pgdn; ctrl-v -PanelDoEnter = enter -PanelChdirOtherPanel = alt-o -PanelChdirToReadlink = alt-l -PanelViewSimple = F13 -PanelEditNew = F14 -PanelCopyLocal = F15 -PanelRenameLocal = F16 -PanelDeleteLocal = F18 -PanelReverseSelection = alt-asterisk -PanelSelect = alt-plus -PanelUnselect = alt-minus -PanelGotoChildDir = ctrl-pgdn -PanelGotoParentDir = ctrl-pgup -PanelDirectoryHistoryList = alt-shift-h -PanelDirectoryHistoryNext = alt-u -PanelDirectoryHistoryPrev = alt-y -PanelGotoBottomFile = alt-j -PanelGotoMiddleFile = alt-r -PanelSyncOtherPanel = alt-i -PanelGotoTopFile = alt-g -PanelSetPanelEncoding = alt-e -PanelMoveHome = alt-lt; home; a1 -PanelMoveEnd = alt-gt; end; c1 -PanelSelectSortOrder = -PanelToggleSortOrderPrev = -PanelToggleSortOrderNext = -PanelReverseSort = -PanelSortOrderByName = -PanelSortOrderByExt = -PanelSortOrderBySize = -PanelSortOrderByMTime = -PanelSmartGotoParentDir = +Search = ctrl-s; alt-s +Mark = insert; ctrl-t +MarkUp = shift-up +MarkDown = shift-down +Down = down; ctrl-n +Up = up; ctrl-p +Left = left +Right = right +PageUp = pgup; alt-v +PageDown = pgdn; ctrl-v +Enter = enter +PanelOtherCd = alt-o +PanelOtherCdLink = alt-l +ViewRaw = F13 +EditNew = F14 +CopySingle = F15 +MoveSingle = F16 +DeleteSingle = F18 +Select = alt-plus +Unselect = alt-minus +SelectInvert = alt-asterisk +CdChild = ctrl-pgdn +CdParent = ctrl-pgup +CdParentSmart = +History = alt-shift-h +HistoryNext = alt-u +HistoryPrev = alt-y +BottomOnScreen = alt-j +MiddleOnScreen = alt-r +TopOnScreen = alt-g +PanelOtherSync = alt-i +SelectCodepage = alt-e +Top = alt-lt; home; a1 +Bottom = alt-gt; end; c1 +Sort = +SortPrev = +SortNext = +SortReverse = +SortByName = +SortByExt = +SortBySize = +SortByMTime = [dialog] -DialogOK = enter -DialogCancel = f10; esc; ctrl-g -DialogPrevItem = left; up -DialogNextItem = right; down -DialogHelp = f1 -DialogSuspend = ctrl-z -DialogRefresh = ctrl-l -CmdDialogList = alt-prime -CmdDialogNext = alt-rbrace -CmdDialogPrev = alt-lbrace +Ok = enter +Cancel = f10; esc; ctrl-g +Up = left; up +#Left = left; up +Down = right; down +#Right = right; down +Help = f1 +Suspend = ctrl-z +Refresh = ctrl-l +ScreenList = alt-prime +ScreenNext = alt-rbrace +ScreenPrev = alt-lbrace [input] -InputBol = ctrl-a; alt-lt; home; a1 -InputEol = ctrl-e; alt-gt; end; c1 -InputMoveLeft = left; alt-left -InputWordLeft = ctrl-left -InputBackwardChar = ctrl-b -InputBackwardWord = alt-b -InputMoveRight = right; alt-right -InputWordRight = ctrl-right -InputForwardChar = ctrl-f -InputForwardWord = alt-f -InputBackwardDelete = backspace; ctrl-h -InputDeleteChar = delete; ctrl-d -InputKillWord = alt-d -InputBackwardKillWord = alt-backspace -InputSetMark = -InputKillRegion = ctrl-w -InputXCut = -InputXStore = alt-w -InputXPaste = -InputYank = ctrl-y -InputKillLine = ctrl-k -InputHistoryPrev = alt-p; ctrl-down -InputHistoryNext = alt-n; ctrl-up -InputHistoryShow = alt-h -InputComplete = alt-tab -InputClearLine = -InputLeftHighlight = shift-left -InputRightHighlight = shift-right -InputWordLeftHighlight = ctrl-shift-left -InputWordRightHighlight = ctrl-shift-right -InputBolHighlight = shift-home -InputEolHighlight = shift-end +Home = ctrl-a; alt-lt; home; a1 +End = ctrl-e; alt-gt; end; c1 +Left = left; alt-left; ctrl-b +Right = right; alt-right; ctrl-f +WordLeft = ctrl-left; alt-b +WordRight = ctrl-right; alt-f +Backspace = backspace; ctrl-h +Delete = delete; ctrl-d +DeleteToWordBegin = alt-backspace +DeleteToWordEnd = alt-d +Mark = +Remove = ctrl-w +Cut = +Store = alt-w +Paste = +Yank = ctrl-y +DeleteToEnd = ctrl-k +HistoryPrev = alt-p; ctrl-down +HistoryNext = alt-n; ctrl-up +History = alt-h +Complete = alt-tab +Clear = +MarkLeft = shift-left +MarkRight = shift-right +MarkToWordBegin = ctrl-shift-left +MarkToWordEnd = ctrl-shift-right +MarkToHome = shift-home +MarkToEnd = shift-end [listbox] -ListboxMoveUp = up; ctrl-p -ListboxMoveDown = down; ctrl-n -ListboxMoveHome = home; alt-lt; a1 -ListboxMoveEnd = end; alt-gt; c1 -ListboxMovePgUp = pgup; alt-v -ListboxMovePgDn = pgdn; ctrl-v -ListboxDeleteItem = delete; d -ListboxDeleteAll = shift-delete; shift-d +Up = up; ctrl-p +Down = down; ctrl-n +Top = home; alt-lt; a1 +Bottom = end; alt-gt; c1 +PageUp = pgup; alt-v +PageDown = pgdn; ctrl-v +Delete = delete; d +Clear = shift-delete; shift-d [tree] -TreeHelp = f1 -TreeForget = f3 -TreeToggleNav = f4 -TreeCopy = f5 -TreeMove = f6 -TreeMoveUp = up; ctrl-p -TreeMoveDown = down; ctrl-n -TreeMoveLeft = left -TreeMoveRight = right -TreeMoveHome = home; alt-lt; a1 -TreeMoveEnd = end; alt-gt; c1 -TreeMovePgUp = pgup; alt-v -TreeMovePgDn = pgdn; ctrl-v -TreeOpen = enter -TreeRescan = f2; ctrl-r -TreeStartSearch = ctrl-s; alt-s -TreeRemove = f8; delete +Help = f1 +Reread = f2; ctrl-r +Forget = f3 +ToggleNavigation = f4 +Copy = f5 +Move = f6 +Up = up; ctrl-p +Down = down; ctrl-n +Left = left +Right = right +Top = home; alt-lt; a1 +Bottom = end; alt-gt; c1 +PageUp = pgup; alt-v +PageDown = pgdn; ctrl-v +Enter = enter +Search = ctrl-s; alt-s +Delete = f8; delete [help] -HelpHelp = f1 -HelpIndex = f2; c -HelpBack = f3; left; l -HelpQuit = f10; esc; ctrl-g -HelpMoveUp = up; ctrl-p -HelpMoveDown = down; ctrl-n -HelpMovePgDn = f; space; pgdn; ctrl-v -HelpMovePgUp = b; pgup; alt-v; backspace -HelpMoveHalfPgDn = d -HelpMoveHalfPgUp = u -HelpMoveTop = home; ctrl-home; ctrl-pgup; a1; alt-lt; g -HelpMoveBottom = end; ctrl-end; ctrl-pgdn; c1; alt-gt; shift-g -HelpSelectLink = right; enter -HelpNextLink = tab -HelpPrevLink = alt-tab -HelpNextNode = n -HelpPrevNode = p +Help = f1 +Index = f2; c +Back = f3; left; l +Quit = f10; esc; ctrl-g +Up = up; ctrl-p +Down = down; ctrl-n +PageDown = f; space; pgdn; ctrl-v +PageUp = b; pgup; alt-v; backspace +HalfPageDown = d +HalfPageUp = u +Top = home; ctrl-home; ctrl-pgup; a1; alt-lt; g +Bottom = end; ctrl-end; ctrl-pgdn; c1; alt-gt; shift-g +Enter = right; enter +LinkNext = tab +LinkPrev = alt-tab +NodeNext = n +NodePrev = p [editor] -EditXStore = ctrl-insert -EditXPaste = shift-insert -EditXCut = shift-delete -EditDeleteLine = ctrl-y -EditDeleteToLineEnd = ctrl-k -EditDeleteToLineBegin = -EditLeft = left -EditRight = right -EditUp = up -EditDown = down -EditEnter = enter -EditReturn = shift-enter -EditBackSpace = backspace; ctrl-h -EditDelete = delete; ctrl-d -EditPageUp = pgup -EditPageDown = pgdn -EditWordLeft = ctrl-left; ctrl-z -EditWordRight = ctrl-right; ctrl-x -EditHome = home -EditEnd = end -EditTab = tab -EditUndo = ctrl-u -EditRedo = alt-r -EditBeginningOfText = ctrl-home; alt-lt -EditEndOfText = ctrl-end; alt-gt -EditScrollUp = ctrl-up -EditScrollDown = ctrl-down -EditBeginPage = ctrl-pgup -EditEndPage = ctrl-pgdn -EditDeleteWordLeft = alt-backspace -EditDeleteWordRight = alt-d -EditParagraphUp = -EditParagraphDown = -EditSave = f2 -EditLoad = +Store = ctrl-insert +Paste = shift-insert +Cut = shift-delete +Up = up +Down = down +Left = left +Right = right +WordLeft = ctrl-left; ctrl-z +WordRight = ctrl-right; ctrl-x +Enter = enter +Return = shift-enter +BackSpace = backspace; ctrl-h +Delete = delete; ctrl-d +PageUp = pgup +PageDown = pgdn +Home = home +End = end +Tab = tab +Undo = ctrl-u +Redo = alt-r +Top = ctrl-home; alt-lt +Bottom = ctrl-end; alt-gt +ScrollUp = ctrl-up +ScrollDown = ctrl-down +TopOnScreen = ctrl-pgup +BottomOnScreen = ctrl-pgdn +DeleteToWordBegin = alt-backspace +DeleteToWordEnd = alt-d +DeleteLine = ctrl-y +DeleteToEnd = ctrl-k +DeleteToHome = +ParagraphUp = +ParagraphDown = +Save = f2 +EditFile = EditNew = ctrl-n -EditSaveas = f12 -EditMark = f3 -EditCopy = f5 -EditMove = f6 -EditRemove = f8 -EditMarkAll = -EditUnmark = -EditFind = f7 -EditMarkLine = -EditMarkWord = -EditShiftBlockLeft = -EditShiftBlockRight = -EditPageUpHighlight = shift-pgup -EditPageDownHighlight = shift-pgdn -EditLeftHighlight = shift-left -EditRightHighlight = shift-right -EditWordLeftHighlight = ctrl-shift-left -EditWordRightHighlight = ctrl-shift-right -EditUpHighlight = shift-up -EditDownHighlight = shift-down -EditHomeHighlight = shift-home -EditEndHighlight = shift-end -EditBeginningOfTextHighlight = ctrl-shift-home -EditEndOfTextHighlight = ctrl-shift-end -EditBeginPageHighlight = ctrl-shift-pgup -EditEndPageHighlight = ctrl-shift-pgdn -EditScrollUpHighlight = ctrl-shift-up -EditScrollDownHighlight = ctrl-shift-down -EditParagraphUpHighlight = -EditParagraphDownHighlight = -EditPageUpAltHighlight = alt-pgup -EditPageDownAltHighlight = alt-pgdn -EditLeftAltHighlight = alt-left -EditRightAltHighlight = alt-right -EditWordLeftAltHighlight = ctrl-alt-left -EditWordRightAltHighlight = ctrl-alt-right -EditUpAltHighlight = alt-up -EditDownAltHighlight = alt-down -EditHomeAltHighlight = alt-home -EditEndAltHighlight = alt-end -EditBeginningOfTextAltHighlight = ctrl-alt-home -EditEndOfTextHighlight = ctrl-alt-end -EditBeginPageHighlight = ctrl-alt-pgup -EditEndPageAltHighlight = ctrl-alt-pgdn -EditScrollUpAltHighlight = -EditScrollDownAltHighlight = -EditParagraphUpAltHighlight = -EditParagraphDownAltHighlight = -EditSaveBlock = ctrl-f -EditColumnMark = f13 -EditFindAgain = f17 -EditReplace = f4 -EditReplaceAgain = f14 -EditCompleteWord = alt-tab -EditDebugStart = -EditDebugStop = -EditDebugToggleBreak = -EditDebugClear = -EditDebugNext = -EditDebugStep = -EditDebugBackTrace = -EditDebugContinue = -EditDebugEnterCommand = -EditDebugUntilCurser = -EditInsertFile = f15 -EditQuit = f10 -EditToggleInsert = insert -EditHelp = f1 -EditDate = -EditRefresh = ctrl-l -EditGoto = alt-l -EditManPage = -EditSort = alt-t -EditMail = alt-m -EditCancel = -EditComplete = -EditParagraphFormat = alt-p -EditUtil = -EditTypeLoadPython = -EditFindFile = -EditCtags = -EditMatchBracket = alt-b -EditTerminal = -EditTerminalApp = -EditExtCmd = alt-u -EditUserMenu = f11 -EditSaveDesktop = -EditNewWindow = -EditCycle = -EditMenu = f9 -EditSaveAndQuit = -EditRunAnother = -EditCheckSaveAndQuit = -EditMaximize = -EditToggleBookmark = alt-k -EditFlushBookmarks = alt-o -EditNextBookmark = alt-j -EditPrevBookmark = alt-i -EditSelectionHistory = -EditShell = ctrl-o -EditInsertLiteral = ctrl-q -EditBeginRecordMacro = -EditEndRecordMacro = -EditBeginOrEndMacro = ctrl-r -EditDeleteMacro = -EditToggleLineState = alt-n -EditToggleTabTWS = alt-underline -EditToggleSyntax = ctrl-s -EditToggleShowMargin = -EditFindDefinition = alt-enter -EditLoadPrevFile = alt-minus -EditLoadNextFile = alt-plus -EditBeginEndRepeat = +SaveAs = f12; ctrl-f2 +Mark = f3 +Copy = f5 +Move = f6 +Remove = f8 +MarkLine = +MarkWord = +MarkAll = +Unmark = +Search = f7 +SearchContinue = f17 +BlockShiftLeft = +BlockShiftRight = +MarkPageUp = shift-pgup +MarkPageDown = shift-pgdn +MarkLeft = shift-left +MarkRight = shift-right +MarkToWordBegin = ctrl-shift-left +MarkToWordEnd = ctrl-shift-right +MarkUp = shift-up +MarkDown = shift-down +MarkToHome = shift-home +MarkToEnd = shift-end +MarkToFileBegin = ctrl-shift-home +MarkToFileEnd = ctrl-shift-end +MarkToPageBegin = ctrl-shift-pgup +MarkToPageEnd = ctrl-shift-pgdn +MarkScrollUp = ctrl-shift-up +MarkScrollDown = ctrl-shift-down +MarkParagraphUp = +MarkParagraphDown = +MarkColumnPageUp = alt-pgup +MarkColumnPageDown = alt-pgdn +MarkColumnLeft = alt-left +MarkColumnRight = alt-right +MarkColumnUp = alt-up +MarkColumnDown = alt-down +MarkColumnScrollUp = +MarkColumnScrollDown = +MarkColumnParagraphUp = +MarkColumnParagraphDown = +BlockSave = ctrl-f +MarkColumn = f13 +Replace = f4 +ReplaceContinue = f14 +Complete = alt-tab +InsertFile = f15 +Quit = f10 +InsertOverwrite = insert +Help = f1 +Date = +Refresh = ctrl-l +Goto = alt-l +Sort = alt-t +Mail = alt-m +ParagraphFormat = alt-p +MatchBracket = alt-b +ExternalCommand = alt-u +UserMenu = f11 +Menu = f9 +Bookmark = alt-k +BookmarkFlush = alt-o +BookmarkNext = alt-j +BookmarkPrev = alt-i +History = +Shell = ctrl-o +InsertLiteral = ctrl-q +MacroStartRecord = +MacroStopRecord = +MacroStartStopRecord = ctrl-r +MacroDelete = +ShowNumbers = alt-n +ShowTabTws = alt-underline +SyntaxOnOff = ctrl-s +SyntaxChoose = +ShowMargin = +Find = alt-enter +FilePrev = alt-minus +FileNext = alt-plus +RepeatStartStopRecord = SelectCodepage = alt-e +Options = +OptionsSaveMode = +LearnKeys = +ExtendedKeyMap = ctrl-x [viewer] -ViewHelp = f1 -ViewToggleWrapMode = f2 -ViewQuit = f3; f10; q; esc; ctrl-g -ViewToggleHexMode = f4 -ViewGoto = f5 -ViewSearch = f7; question; slash -ViewToggleMagicMode = f8 -ViewToggleNroffMode = f9 -ViewContinueSearch = ctrl-r; ctrl-s; f17; n -ViewMoveToBol = ctrl-a -ViewMoveToEol = ctrl-e -ViewMoveLeft = h; left -ViewMoveRight = l; right -ViewMoveLeft10 = ctrl-left -ViewMoveRight10 = ctrl-right -ViewMoveUp = k; y; insert; up; ctrl-p -ViewMoveDown = j; e; delete; down; enter; ctrl-n -ViewMovePgDn = f; space; pgdn; ctrl-v -ViewMovePgUp = b; pgup; alt-v; backspace -ViewMoveHalfPgDn = d -ViewMoveHalfPgUp = u -ViewMoveTop = home; ctrl-home; ctrl-pgup; a1; alt-lt; g -ViewMoveBottom = end; ctrl-end; ctrl-pgdn; c1; alt-gt; shift-g -ViewGotoBookmark = m -ViewNewBookmark = r -ViewNextFile = ctrl-f -ViewPrevFile = ctrl-b +Help = f1 +WrapMode = f2 +Quit = f3; f10; q; esc; ctrl-g +HexMode = f4 +Goto = f5 +Search = f7; question; slash +SearchContinue = ctrl-r; ctrl-s; f17; n +MagicMode = f8 +NroffMode = f9 +Home = ctrl-a +End = ctrl-e +Left = h; left +Right = l; right +LeftQuick = ctrl-left +RightQuick = ctrl-right +Up = k; y; insert; up; ctrl-p +Down = j; e; delete; down; enter; ctrl-n +PageDown = f; space; pgdn; ctrl-v +PageUp = b; pgup; alt-v; backspace +HalfPageDown = d +HalfPageUp = u +Top = home; ctrl-home; ctrl-pgup; a1; alt-lt; g +Bottom = end; ctrl-end; ctrl-pgdn; c1; alt-gt; shift-g +BookmarkGoto = m +Bookmark = r +FileNext = ctrl-f +FilePrev = ctrl-b SelectCodepage = alt-e -ShowCommandLine = ctrl-o -ViewToggleRuler = alt-r +Shell = ctrl-o +Ruler = alt-r [viewer:hex] -ViewHelp = f1 -ViewToggleHexEditMode = f2 -ViewQuit = f3; f10; q; esc; ctrl-g -ViewToggleHexMode = f4 -ViewGoto = f5 -ViewHexEditSave = f6 -ViewSearch = f7; question; slash -ViewToggleMagicMode = f8 -ViewToggleNroffMode = f9 -ViewToggleHexNavMode = tab -ViewMoveToBol = ctrl-a; home -ViewMoveToEol = ctrl-e; end -ViewMoveLeft = b; left -ViewMoveRight = f; right -ViewMoveUp = k; y; up -ViewMoveDown = j; delete; down -ViewMovePgDn = pgdn; ctrl-v -ViewMovePgUp = pgup; alt-v -ViewMoveTop = home; ctrl-home; ctrl-pgup; a1; alt-lt; g -ViewMoveBottom = end; ctrl-end; ctrl-pgdn; c1; alt-gt; shift-g +Help = f1 +HexEditMode = f2 +Quit = f3; f10; q; esc; ctrl-g +HexMode = f4 +Goto = f5 +Save = f6 +Search = f7; question; slash +SearchContinue = ctrl-r; ctrl-s; f17; n +MagicMode = f8 +NroffMode = f9 +ToggleNavigation = tab +Home = ctrl-a; home +End = ctrl-e; end +Left = b; left +Right = f; right +Up = k; y; up +Down = j; delete; down +PageDown = pgdn; ctrl-v +PageUp = pgup; alt-v +Top = ctrl-home; ctrl-pgup; a1; alt-lt; g +Bottom = ctrl-end; ctrl-pgdn; c1; alt-gt; shift-g [diffviewer] -DiffDisplaySymbols = alt-s; s -DiffDisplayNumbers = alt-n; l -DiffFull = f -DiffEqual = equal -DiffSplitMore = gt -DiffSplitLess = lt -DiffSetTab2 = 2 -DiffSetTab3 = 3 -DiffSetTab4 = 4 -DiffSetTab8 = 8 -DiffSwapPanel = ctrl-u -DiffRedo = ctrl-r -DiffNextHunk = n; enter; space -DiffPrevHunk = p; backspace -DiffGoto = g; shift-g -DiffSave = f2 -DiffEditCurrent = f4 -DiffEditOther = f14 -DiffMergeCurrentHunk = f5 -DiffSearch = f7 -DiffContinueSearch = f17 -DiffOptions = f9 -DiffBOF = ctrl-home -DiffEOF = ctrl-end -DiffDown = down -DiffUp = up -DiffQuickLeft = ctrl-left -DiffQuickRight = ctrl-right -DiffLeft = left -DiffRight = right -DiffPageDown = pgdn -DiffPageUp = pgup -DiffHome = home -DiffEnd = end -DiffHelp = f1 -DiffQuit = f10; q; shift-q; ctrl-g; esc -ShowCommandLine = ctrl-o +ShowSymbols = alt-s; s +ShowNumbers = alt-n; l +SplitFull = f +SplitEqual = equal +SplitMore = gt +SplitLess = lt +Tab2 = 2 +Tab3 = 3 +Tab4 = 4 +Tab8 = 8 +Swap = ctrl-u +Redo = ctrl-r +HunkNext = n; enter; space +HunkPrev = p; backspace +Goto = g; shift-g +Save = f2 +Edit = f4 +EditOther = f14 +Merge = f5 +Search = f7 +SearchContinue = f17 +Options = f9 +Top = ctrl-home +Bottom = ctrl-end +Down = down +Up = up +LeftQuick = ctrl-left +RightQuick = ctrl-right +Left = left +Right = right +PageDown = pgdn +PageUp = pgup +Home = home +End = end +Help = f1 +Quit = f10; q; shift-q; ctrl-g; esc +Shell = ctrl-o SelectCodepage = alt-e diff --git a/misc/mc.keymap.emacs b/misc/mc.keymap.emacs index d127741d6..e8da1bee1 100644 --- a/misc/mc.keymap.emacs +++ b/misc/mc.keymap.emacs @@ -1,441 +1,430 @@ [main] -CmdHelp = f1 -CmdUserMenu = f2 -CmdView = f3 -CmdViewFile = f13 -CmdEdit = f4 -CmdEditForceInternal = -CmdCopy = f5 -CmdRename = f6 -CmdMkdir = f7 -CmdDelete = f8 -CmdMenu = f9 -CmdQuit = f10 -CmdMenuLastSelected = f19 -CmdQuietQuit = f20 -CmdFind = alt-question -CmdQuickCd = alt-c -CmdQuickChdir = ctrl-backslash -CmdReread = ctrl-r -CmdSingleDirsize = ctrl-space -CmdSuspend = ctrl-z -CmdSwapPanel = ctrl-u -CmdHistory = alt-h -CmdListing = -CmdToggleListing = alt-t -CmdToggleShowHidden = alt-dot -CmdTogglePanelsSplit = alt-comma -ShowCommandLine = ctrl-o -CmdCopyCurrentPathname = alt-a -CmdCopyOtherPathname = alt-shift-a -CmdFilteredView = alt-exclamation -CmdSelect = kpplus -CmdUnselect = kpminus -CmdReverseSelection = kpasterisk -CmdDialogList = alt-prime -ExtMap1 = ctrl-x +Help = f1 +UserMenu = f2 +View = f3 +ViewFile = +Edit = f4 +EditForceInternal = +Copy = f5 +Move = f6 +MakeDir = f7 +Delete = f8 +Menu = f9 +Quit = f10 +MenuLastSelected = f19 +QuitQuiet = f20 +Find = alt-question +CdQuick = alt-c +HotList = ctrl-backslash +Reread = ctrl-r +DirSize = ctrl-space +Suspend = ctrl-z +Swap = ctrl-u +History = alt-h +PanelListing = +PanelListingSwitch = alt-t +PanelListingChange = +ShowHidden = alt-dot +SplitVertHoriz = alt-comma +Shell = ctrl-o +PutCurrentPath = alt-a +PutOtherPath = alt-shift-a +ViewFiltered = alt-exclamation +Select = kpplus +Unselect = kpminus +SelectInvert = kpasterisk +ScreenList = alt-prime +Options = +OptionsLayout = +OptionsPanel = +OptionsConfirm = +OptionsDisplayBits = +OptionsVfs = +LearnKeys = +SaveSetup = +EditExtensionsFile = +EditFileHighlightFile = +Filter = +ConnectFish = +ConnectFtp = +ConnectSmb = +Undelete = +ExtendedKeyMap = ctrl-x [main:xmap] -CmdChmod = c -CmdChown = o -CmdCompareDirs = d -CmdEditSymlink = ctrl-s -CmdLink = l -CmdSymlink = s -CmdRelativeSymlink = v -CmdInfo = i -CmdQuickView = q -CmdExternalPanelize = exclamation -CmdReselectVfs = a -CmdJobs = j -CmdCopyCurrentPathname = p -CmdCopyOtherPathname = ctrl-p -CmdCopyCurrentTagged = t -CmdCopyOtherTagged = ctrl-t -CmdDiffView = ctrl-d +ChangeMode = c +ChangeOwn = o +CompareDirs = d +CompareFiles = ctrl-d +HotListAdd = h +LinkSymbolicEdit = ctrl-s +Link = l +LinkSymbolic = s +LinkSymbolicRelative +PanelInfo = i +PanelQuickView = q +ExternalPanelize = exclamation +VfsList = a +Jobs = j +PutCurrentPath = p +PutOtherPath = ctrl-p +PutCurrentTagged = t +PutOtherTagged = ctrl-t +PutCurrentLink = r +PutOtherLink = ctrl-r [panel] -PanelStartSearch = ctrl-s; alt-s -PanelMarkFile = insert; ctrl-t -PanelMarkFileUp = shift-up -PanelMarkFileDown = shift-down -PanelMoveDown = down; ctrl-n -PanelMoveUp = up; ctrl-p -PanelMoveLeft = left -PanelMoveRight = right -PanelPrevPage = pgup; alt-v -PanelNextPage = pgdn; ctrl-v -PanelDoEnter = enter -PanelChdirOtherPanel = alt-o -PanelChdirToReadlink = alt-l -PanelViewSimple = F13 -PanelEditNew = F14 -PanelCopyLocal = F15 -PanelRenameLocal = F16 -PanelDeleteLocal = F18 -PanelReverseSelection = alt-asterisk -PanelSelect = alt-plus -PanelUnselect = alt-minus -PanelGotoChildDir = ctrl-pgdn -PanelGotoParentDir = ctrl-pgup -PanelDirectoryHistoryList = alt-shift-h -PanelDirectoryHistoryNext = alt-u -PanelDirectoryHistoryPrev = alt-y -PanelGotoBottomFile = alt-j -PanelGotoMiddleFile = alt-r -PanelSyncOtherPanel = alt-i -PanelGotoTopFile = alt-g -PanelSetPanelEncoding = alt-e -PanelMoveHome = alt-lt; home; a1 -PanelMoveEnd = alt-gt; end; c1 -PanelSelectSortOrder = -PanelToggleSortOrderPrev = -PanelToggleSortOrderNext = -PanelReverseSort = -PanelSortOrderByName = -PanelSortOrderByExt = -PanelSortOrderBySize = -PanelSortOrderByMTime = -PanelSmartGotoParentDir = +Search = ctrl-s; alt-s +Mark = insert; ctrl-t +MarkUp = shift-up +MarkDown = shift-down +Down = down; ctrl-n +Up = up; ctrl-p +Left = left +Right = right +PageUp = pgup; alt-v +PageDown = pgdn; ctrl-v +Enter = enter +PanelOtherCd = alt-o +PanelOtherCdLink = alt-l +ViewRaw = F13 +EditNew = F14 +CopySingle = F15 +MoveSingle = F16 +DeleteSingle = F18 +Select = alt-plus +Unselect = alt-minus +SelectInvert = alt-asterisk +CdChild = ctrl-pgdn +CdParent = ctrl-pgup +CdParentSmart = +History = alt-shift-h +HistoryNext = alt-u +HistoryPrev = alt-y +BottomOnScreen = alt-j +MiddleOnScreen = alt-r +TopOnScreen = alt-g +PanelOtherSync = alt-i +SelectCodepage = alt-e +Top = alt-lt; home; a1 +Bottom = alt-gt; end; c1 +Sort = +SortPrev = +SortNext = +SortReverse = +SortByName = +SortByExt = +SortBySize = +SortByMTime = [dialog] -DialogOK = enter -DialogCancel = f10; esc; ctrl-g -DialogPrevItem = left; up -DialogNextItem = right; down -DialogHelp = f1 -DialogSuspend = ctrl-z -DialogRefresh = ctrl-l -CmdDialogList = alt-prime -CmdDialogNext = alt-rbrace -CmdDialogPrev = alt-lbrace +Ok = enter +Cancel = f10; esc; ctrl-g +Up = left; up +#Left = left; up +Down = right; down +#Right = right; down +Help = f1 +Suspend = ctrl-z +Refresh = ctrl-l +ScreenList = alt-prime +ScreenNext = alt-rbrace +ScreenPrev = alt-lbrace [input] -InputBol = ctrl-a; alt-lt; home; a1 -InputEol = ctrl-e; alt-gt; end; c1 -InputMoveLeft = left; alt-left -InputWordLeft = ctrl-left -InputBackwardChar = ctrl-b -InputBackwardWord = alt-b -InputMoveRight = right; alt-right -InputWordRight = ctrl-right -InputForwardChar = ctrl-f -InputForwardWord = alt-f -InputBackwardDelete = backspace -InputDeleteChar = delete -InputKillWord = alt-d -InputBackwardKillWord = alt-backspace -InputSetMark = -InputKillRegion = ctrl-w -InputXCut = -InputXStore = alt-w -InputXPaste = -InputYank = ctrl-y -InputKillLine = ctrl-k -InputHistoryPrev = alt-p; ctrl-down -InputHistoryNext = alt-n; ctrl-up -InputHistoryShow = alt-h -InputComplete = alt-tab -InputClearLine = -InputLeftHighlight = -InputRightHighlight = -InputWordLeftHighlight = -InputWordRightHighlight = -InputBolHighlight = -InputEolHighlight = +Home = ctrl-a; alt-lt; home; a1 +End = ctrl-e; alt-gt; end; c1 +Left = left; alt-left; ctrl-b +Right = right; alt-right; ctrl-f +WordLeft = ctrl-left; alt-b +WordRight = ctrl-right; alt-f +Backspace = backspace +Delete = delete +DeleteToWordBegin = alt-backspace +DeleteToWordEnd = alt-d +Mark = +Remove = ctrl-w +Cut = +Store = alt-w +Paste = +Yank = ctrl-y +DeleteToEnd = ctrl-k +HistoryPrev = alt-p; ctrl-down +HistoryNext = alt-n; ctrl-up +History = alt-h +Complete = alt-tab +Clear = +MarkLeft = +MarkRight = +MarkToWordBegin = +MarkToWordEnd = +MarkToHome = +MarkToEnd = [listbox] -ListboxMoveUp = up; ctrl-p -ListboxMoveDown = down; ctrl-n -ListboxMoveHome = home; alt-lt; a1 -ListboxMoveEnd = end; alt-gt; c1 -ListboxMovePgUp = pgup; alt-v -ListboxMovePgDn = pgdn; ctrl-v -ListboxDeleteItem = delete; d -ListboxDeleteAll = shift-delete; shift-d +Up = up; ctrl-p +Down = down; ctrl-n +Top = home; alt-lt; a1 +Bottom = end; alt-gt; c1 +PageUp = pgup; alt-v +PageDown = pgdn; ctrl-v +Delete = delete; d +Clear = shift-delete; shift-d [tree] -TreeHelp = f1 -TreeForget = f3 -TreeToggleNav = f4 -TreeCopy = f5 -TreeMove = f6 -TreeMoveUp = up; ctrl-p -TreeMoveDown = down; ctrl-n -TreeMoveLeft = left -TreeMoveRight = right -TreeMoveHome = home; alt-lt; a1 -TreeMoveEnd = end; alt-gt; c1 -TreeMovePgUp = pgup; alt-v -TreeMovePgDn = pgdn; ctrl-v -TreeOpen = enter -TreeRescan = f2; ctrl-r -TreeStartSearch = ctrl-s; alt-s -TreeRemove = f8; delete +Help = f1 +Reread = f2; ctrl-r +Forget = f3 +ToggleNavigation = f4 +Copy = f5 +Move = f6 +Up = up; ctrl-p +Down = down; ctrl-n +Left = left +Right = right +Top = home; alt-lt; a1 +Bottom = end; alt-gt; c1 +PageUp = pgup; alt-v +PageDown = pgdn; ctrl-v +Enter = enter +Search = ctrl-s; alt-s +Delete = f8; delete [help] -HelpHelp = f1 -HelpIndex = f2; c -HelpBack = f3; left; l -HelpQuit = f10; esc; ctrl-g -HelpMoveUp = up; ctrl-p -HelpMoveDown = down; ctrl-n -HelpMovePgDn = f; space; pgdn; ctrl-v -HelpMovePgUp = b; pgup; alt-v; backspace -HelpMoveHalfPgDn = d -HelpMoveHalfPgUp = u -HelpMoveTop = home; ctrl-home; ctrl-pgup; a1; alt-lt; g -HelpMoveBottom = end; ctrl-end; ctrl-pgdn; c1; alt-gt; shift-g -HelpSelectLink = right; enter -HelpNextLink = tab -HelpPrevLink = alt-tab -HelpNextNode = n -HelpPrevNode = p +Help = f1 +Index = f2; c +Back = f3; left; l +Quit = f10; esc; ctrl-g +Up = up; ctrl-p +Down = down; ctrl-n +PageDown = f; space; pgdn; ctrl-v +PageUp = b; pgup; alt-v; backspace +HalfPageDown = d +HalfPageUp = u +Top = home; ctrl-home; ctrl-pgup; a1; alt-lt; g +Bottom = end; ctrl-end; ctrl-pgdn; c1; alt-gt; shift-g +Enter = right; enter +LinkNext = tab +LinkPrev = alt-tab +NodeNext = n +NodePrev = p [editor] -EditXStore = alt-w -EditXPaste = ctrl-y -EditXCut = ctrl-w -EditDeleteLine = ctrl-y -EditDeleteToLineEnd = ctrl-k -EditDeleteToLineBegin = -EditLeft = left; ctrl-b -EditRight = right; ctrl-f -EditUp = up; ctrl-p -EditDown = down; ctrl-n -EditEnter = enter -EditReturn = shift-enter -EditBackSpace = backspace -EditDelete = delete -EditPageUp = pgup; alt-v -EditPageDown = pgdn; ctrl-v -EditWordLeft = ctrl-left; alt-b -EditWordRight = ctrl-right; alt-f -EditHome = home; ctrl-a -EditEnd = end; ctrl-e -EditTab = tab -EditUndo = ctrl-u -EditBeginningOfText = ctrl-home; alt-lt -EditEndOfText = ctrl-end; alt-gt -EditScrollUp = ctrl-up -EditScrollDown = ctrl-down -EditBeginPage = ctrl-pgup -EditEndPage = ctrl-pgdn -EditDeleteWordLeft = alt-backspace -EditDeleteWordRight = alt-d -EditParagraphUp = -EditParagraphDown = -EditSave = f2 -EditLoad = -EditSaveas = f12 -EditMark = f3; ctrl-at -EditCopy = f5 -EditMove = f6 -EditRemove = f8 -EditMarkAll = -EditUnmark = -EditFind = f7; ctrl-s -EditMarkLine = -EditMarkWord = -EditShiftBlockLeft = -EditShiftBlockRight = -EditPageUpHighlight = shift-pgup -EditPageDownHighlight = shift-pgdn -EditLeftHighlight = shift-left -EditRightHighlight = shift-right -EditWordLeftHighlight = ctrl-shift-left -EditWordRightHighlight = ctrl-shift-right -EditUpHighlight = shift-up -EditDownHighlight = shift-down -EditHomeHighlight = shift-home -EditEndHighlight = shift-end -EditBeginningOfTextHighlight = ctrl-shift-home -EditEndOfTextHighlight = ctrl-shift-end -EditBeginPageHighlight = ctrl-shift-pgup -EditEndPageHighlight = ctrl-shift-pgdn -EditScrollUpHighlight = ctrl-shift-up -EditScrollDownHighlight = ctrl-shift-down -EditParagraphUpHighlight = -EditParagraphDownHighlight = -EditPageUpAltHighlight = alt-pgup -EditPageDownAltHighlight = alt-pgdn -EditLeftAltHighlight = alt-left -EditRightAltHighlight = alt-right -EditWordLeftAltHighlight = ctrl-alt-left -EditWordRightAltHighlight = ctrl-alt-right -EditUpAltHighlight = alt-up -EditDownAltHighlight = alt-down -EditHomeAltHighlight = alt-home -EditEndAltHighlight = alt-end -EditBeginningOfTextAltHighlight = ctrl-alt-home -EditEndOfTextHighlight = ctrl-alt-end -EditBeginPageHighlight = ctrl-alt-pgup -EditEndPageAltHighlight = ctrl-alt-pgdn -EditScrollUpAltHighlight = -EditScrollDownAltHighlight = -EditParagraphUpAltHighlight = -EditParagraphDownAltHighlight = -EditSaveBlock = -EditColumnMark = f13 -EditFindAgain = f17 -EditReplace = f4 -EditReplaceAgain = f14 -EditCompleteWord = alt-tab -EditDebugStart = -EditDebugStop = -EditDebugToggleBreak = -EditDebugClear = -EditDebugNext = -EditDebugStep = -EditDebugBackTrace = -EditDebugContinue = -EditDebugEnterCommand = -EditDebugUntilCurser = -EditInsertFile = f15 -EditQuit = f10 -EditToggleInsert = insert -EditHelp = f1 -EditDate = -EditRefresh = ctrl-l -EditGoto = alt-l -EditManPage = -EditSort = alt-t -EditMail = -EditCancel = -EditComplete = -EditParagraphFormat = alt-p -EditUtil = -EditTypeLoadPython = -EditFindFile = -EditCtags = -EditMatchBracket = -EditTerminal = -EditTerminalApp = -EditExtCmd = alt-u -EditUserMenu = f11 -EditSaveDesktop = -EditNewWindow = -EditCycle = -EditMenu = f9 -EditSaveAndQuit = -EditRunAnother = -EditCheckSaveAndQuit = -EditMaximize = -EditToggleBookmark = -EditFlushBookmarks = -EditNextBookmark = -EditPrevBookmark = -EditSelectionHistory = -EditShell = ctrl-o -EditInsertLiteral = ctrl-q -EditBeginRecordMacro = -EditEndRecordMacro = -EditBeginOrEndMacro = ctrl-r -EditDeleteMacro = -EditToggleLineState = alt-n -EditToggleTabTWS = alt-underline -EditToggleSyntax = ctrl-s -EditToggleShowMargin = -EditFindDefinition = alt-enter -EditLoadPrevFile = alt-minus -EditLoadNextFile = alt-plus -EditBeginEndRepeat = +Store = alt-w +Paste = ctrl-y +Cut = ctrl-w +Up = up; ctrl-p +Down = down; ctrl-n +Left = left; ctrl-b +Right = right; ctrl-f +WordLeft = ctrl-left; alt-b +WordRight = ctrl-right; alt-f +Enter = enter +Return = shift-enter +BackSpace = backspace +Delete = delete +PageUp = pgup; alt-v +PageDown = pgdn; ctrl-v +Home = home; ctrl-a +End = end; ctrl-e +Tab = tab +Undo = ctrl-u +Redo = +Top = ctrl-home; alt-lt +Bottom = ctrl-end; alt-gt +ScrollUp = ctrl-up +ScrollDown = ctrl-down +TopOnScreen = ctrl-pgup +BottomOnScreen = ctrl-pgdn +DeleteToWordBegin = alt-backspace +DeleteToWordEnd = alt-d +DeleteLine = ctrl-y +DeleteToEnd = ctrl-k +DeleteToHome = +ParagraphUp = +ParagraphDown = +Save = f2 +EditFile = +SaveAs = f12; ctrl-f2 +Mark = f3; ctrl-at +Copy = f5 +Move = f6 +Remove = f8 +MarkLine = +MarkWord = +MarkAll = +Unmark = +Search = f7; ctrl-s +SearchContinue = f17 +BlockShiftLeft = +BlockShiftRight = +MarkPageUp = shift-pgup +MarkPageDown = shift-pgdn +MarkLeft = shift-left +MarkRight = shift-right +MarkToWordBegin = ctrl-shift-left +MarkToWordEnd = ctrl-shift-right +MarkUp = shift-up +MarkDown = shift-down +MarkToHome = shift-home +MarkToEnd = shift-end +MarkToFileBegin = ctrl-shift-home +MarkToFileEnd = ctrl-shift-end +MarkToPageBegin = ctrl-shift-pgup +MarkToPageEnd = ctrl-shift-pgdn +MarkScrollUp = ctrl-shift-up +MarkScrollDown = ctrl-shift-down +MarkParagraphUp = +MarkParagraphDown = +MarkColumnPageUp = alt-pgup +MarkColumnPageDown = alt-pgdn +MarkColumnLeft = alt-left +MarkColumnRight = alt-right +MarkColumnUp = alt-up +MarkColumnDown = alt-down +MarkColumnScrollUp = +MarkColumnScrollDown = +MarkColumnParagraphUp = +MarkColumnParagraphDown = +BlockSave = +MarkColumn = f13 +Replace = f4 +ReplaceContinue = f14 +Complete = alt-tab +InsertFile = f15 +Quit = f10 +InsertOverwrite = insert +Help = f1 +Date = +Refresh = ctrl-l +Goto = alt-l +Sort = alt-t +Mail = +ParagraphFormat = alt-p +MatchBracket = +ExternalCommand = alt-u +UserMenu = f11 +Menu = f9 +Bookmark = +BookmarkFlush = +BookmarkNext = +BookmarkPrev = +History = +Shell = ctrl-o +InsertLiteral = ctrl-q +MacroStartRecord = +MacroStopRecord = +MacroStartStopRecord = ctrl-r +MacroDelete = +ShowNumbers = alt-n +ShowTabTws = alt-underline +SyntaxOnOff = ctrl-s +SyntaxChoose = +ShowMargin = +Find = alt-enter +FilePrev = alt-minus +FileNext = alt-plus +RepeatStartStopRecord = SelectCodepage = alt-e -EditExtMode = ctrl-x +Options = +OptionsSaveMode = +LearnKeys = +ExtendedKeyMap = ctrl-x [editor:xmap] EditNew = k [viewer] -ViewHelp = f1 -ViewToggleWrapMode = f2 -ViewQuit = f3; f10; q; esc; ctrl-g -ViewToggleHexMode = f4 -ViewGoto = f5 -ViewSearch = f7; question; slash -ViewToggleMagicMode = f8 -ViewToggleNroffMode = f9 -ViewContinueSearch = ctrl-r; ctrl-s; f17; n -ViewMoveToBol = ctrl-a -ViewMoveToEol = ctrl-e -ViewMoveLeft = h; left -ViewMoveRight = l; right -ViewMoveLeft10 = ctrl-left -ViewMoveRight10 = ctrl-right -ViewMoveUp = k; y; insert; up; ctrl-p -ViewMoveDown = j; e; delete; down; enter; ctrl-n -ViewMovePgDn = f; space; pgdn; ctrl-v -ViewMovePgUp = b; pgup; alt-v; backspace -ViewMoveHalfPgDn = d -ViewMoveHalfPgUp = u -ViewMoveTop = home; ctrl-home; ctrl-pgup; a1; alt-lt; g -ViewMoveBottom = end; ctrl-end; ctrl-pgdn; c1; alt-gt; shift-g -ViewGotoBookmark = m -ViewNewBookmark = r -ViewNextFile = ctrl-f -ViewPrevFile = ctrl-b +Help = f1 +WrapMode = f2 +Quit = f3; f10; q; esc; ctrl-g +HexMode = f4 +Goto = f5 +Search = f7; question; slash +MagicMode = f8 +NroffMode = f9 +SearchContinue = ctrl-r; ctrl-s; f17; n +Home = ctrl-a +End = ctrl-e +Left = h; left +Right = l; right +LeftQuick= ctrl-left +RightQuick = ctrl-right +Up = k; y; insert; up; ctrl-p +Down = j; e; delete; down; enter; ctrl-n +PageDown = f; space; pgdn; ctrl-v +PageUp = b; pgup; alt-v; backspace +HalfPageDown = d +HalfPageUp = u +Top = home; ctrl-home; ctrl-pgup; a1; alt-lt; g +Bottom = end; ctrl-end; ctrl-pgdn; c1; alt-gt; shift-g +BookmarkGoto = m +Bookmark = r +FileNext = ctrl-f +FilePrev = ctrl-b SelectCodepage = alt-e -ShowCommandLine = ctrl-o -ViewToggleRuler = alt-r +Shell = ctrl-o +Ruler = alt-r [viewer:hex] -ViewHelp = f1 -ViewToggleHexEditMode = f2 -ViewQuit = f3; f10; q; esc; ctrl-g -ViewToggleHexMode = f4 -ViewGoto = f5 -ViewHexEditSave = f6 -ViewSearch = f7; question; slash -ViewToggleMagicMode = f8 -ViewToggleNroffMode = f9 -ViewToggleHexNavMode = tab -ViewMoveToBol = ctrl-a; home -ViewMoveToEol = ctrl-e; end -ViewMoveLeft = b; left -ViewMoveRight = f; right -ViewMoveUp = k; y; up -ViewMoveDown = j; delete; down -ViewMovePgDn = pgdn; ctrl-v -ViewMovePgUp = pgup; alt-v -ViewMoveTop = home; ctrl-home; ctrl-pgup; a1; alt-lt; g -ViewMoveBottom = end; ctrl-end; ctrl-pgdn; c1; alt-gt; shift-g +Help = f1 +HexEditMode = f2 +Quit = f3; f10; q; esc; ctrl-g +HexMode = f4 +Goto = f5 +Save = f6 +Search = f7; question; slash +SearchContinue = ctrl-r; ctrl-s; f17; n +MagicMode = f8 +NroffMode = f9 +ToggleNavigation = tab +Home = ctrl-a; home +End = ctrl-e; end +Left = b; left +Right = f; right +Up = k; y; up +Down = j; delete; down +PageDown = pgdn; ctrl-v +PageUp = pgup; alt-v +Top = ctrl-home; ctrl-pgup; a1; alt-lt; g +Bottom = ctrl-end; ctrl-pgdn; c1; alt-gt; shift-g [diffviewer] -DiffDisplaySymbols = alt-s; s -DiffDisplayNumbers = alt-n; l -DiffFull = f -DiffEqual = equal -DiffSplitMore = gt -DiffSplitLess = lt -DiffSetTab2 = 2 -DiffSetTab3 = 3 -DiffSetTab4 = 4 -DiffSetTab8 = 8 -DiffSwapPanel = ctrl-u -DiffRedo = ctrl-r -DiffNextHunk = n; enter; space -DiffPrevHunk = p; backspace -DiffGoto = g; shift-g -DiffSave = f2 -DiffEditCurrent = f4 -DiffEditOther = f14 -DiffMergeCurrentHunk = f5 -DiffSearch = f7 -DiffContinueSearch = f17 -DiffOptions = f9 -DiffBOF = ctrl-home -DiffEOF = ctrl-end -DiffDown = down -DiffUp = up -DiffQuickLeft = ctrl-left -DiffQuickRight = ctrl-right -DiffLeft = left -DiffRight = right -DiffPageDown = pgdn -DiffPageUp = pgup -DiffHome = home -DiffEnd = end -DiffHelp = f1 -DiffQuit = f10; q; shift-q; ctrl-g; esc -ShowCommandLine = ctrl-o +ShowSymbols = alt-s; s +ShowNumbers = alt-n; l +SplitFull = f +SplitEqual = equal +SplitMore = gt +SplitLess = lt +Tab2 = 2 +Tab3 = 3 +Tab4 = 4 +Tab8 = 8 +Swap = ctrl-u +Redo = ctrl-r +HunkNext = n; enter; space +HunkPrev = p; backspace +Goto = g; shift-g +Save = f2 +Edit = f4 +EditOther = f14 +Merge = f5 +Search = f7 +SearchContinue = f17 +Options = f9 +Top = ctrl-home +Bottom = ctrl-end +Down = down +Up = up +LeftQuick = ctrl-left +RightQuick = ctrl-right +Left = left +Right = right +PageDown = pgdn +PageUp = pgup +Home = home +End = end +Help = f1 +Quit = f10; q; shift-q; ctrl-g; esc +Shell = ctrl-o SelectCodepage = alt-e diff --git a/src/diffviewer/ydiff.c b/src/diffviewer/ydiff.c index 979cb5504..f34381b6d 100644 --- a/src/diffviewer/ydiff.c +++ b/src/diffviewer/ydiff.c @@ -2980,29 +2980,29 @@ dview_execute_cmd (WDiff * dview, unsigned long command) cb_ret_t res = MSG_HANDLED; switch (command) { - case CK_DiffHelp: + case CK_Help: interactive_display (NULL, "[Diff Viewer]"); break; - case CK_DiffDisplaySymbols: + case CK_ShowSymbols: dview->display_symbols ^= 1; dview->new_frame = 1; break; - case CK_DiffDisplayNumbers: + case CK_ShowNumbers: dview->display_numbers ^= calc_nwidth ((const GArray ** const) dview->a); dview->new_frame = 1; break; - case CK_DiffFull: + case CK_SplitFull: dview->full ^= 1; dview->new_frame = 1; break; - case CK_DiffEqual: + case CK_SplitEqual: if (!dview->full) { dview->bias = 0; dview->new_frame = 1; } break; - case CK_DiffSplitMore: + case CK_SplitMore: if (!dview->full) { dview_compute_split (dview, 1); @@ -3010,122 +3010,124 @@ dview_execute_cmd (WDiff * dview, unsigned long command) } break; - case CK_DiffSplitLess: + case CK_SplitLess: if (!dview->full) { dview_compute_split (dview, -1); dview->new_frame = 1; } break; - case CK_DiffSetTab2: + case CK_Tab2: dview->tab_size = 2; break; - case CK_DiffSetTab3: + case CK_Tab3: dview->tab_size = 3; break; - case CK_DiffSetTab4: + case CK_Tab4: dview->tab_size = 4; break; - case CK_DiffSetTab8: + case CK_Tab8: dview->tab_size = 8; break; - case CK_DiffSwapPanel: + case CK_Swap: dview->ord ^= 1; break; - case CK_DiffRedo: + case CK_Redo: dview_redo (dview); break; - case CK_DiffNextHunk: + case CK_HunkNext: dview->skip_rows = dview->search.last_accessed_num_line = find_next_hunk (dview->a[0], dview->skip_rows); break; - case CK_DiffPrevHunk: + case CK_HunkPrev: dview->skip_rows = dview->search.last_accessed_num_line = find_prev_hunk (dview->a[0], dview->skip_rows); break; - case CK_DiffGoto: + case CK_Goto: dview_goto_cmd (dview, TRUE); break; - case CK_DiffEditCurrent: + case CK_Edit: dview_edit (dview, dview->ord); break; - case CK_DiffMergeCurrentHunk: + case CK_Merge: do_merge_hunk (dview); dview_redo (dview); break; - case CK_DiffEditOther: + case CK_EditOther: dview_edit (dview, dview->ord ^ 1); break; - case CK_DiffSearch: + case CK_Search: dview_search_cmd (dview); break; - case CK_DiffContinueSearch: + case CK_SearchContinue: dview_continue_search_cmd (dview); break; - case CK_DiffBOF: + case CK_Top: dview->skip_rows = dview->search.last_accessed_num_line = 0; break; - case CK_DiffEOF: + case CK_Bottom: dview->skip_rows = dview->search.last_accessed_num_line = dview->a[0]->len - 1; break; - case CK_DiffUp: + case CK_Up: if (dview->skip_rows > 0) { dview->skip_rows--; dview->search.last_accessed_num_line = dview->skip_rows; } break; - case CK_DiffDown: + case CK_Down: dview->skip_rows++; dview->search.last_accessed_num_line = dview->skip_rows; break; - case CK_DiffPageDown: + case CK_PageDown: if (dview->height > 2) { dview->skip_rows += dview->height - 2; dview->search.last_accessed_num_line = dview->skip_rows; } break; - case CK_DiffPageUp: + case CK_PageUp: if (dview->height > 2) { dview->skip_rows -= dview->height - 2; dview->search.last_accessed_num_line = dview->skip_rows; } break; - case CK_DiffLeft: + case CK_Left: dview->skip_cols--; break; - case CK_DiffRight: + case CK_Right: dview->skip_cols++; break; - case CK_DiffQuickLeft: + case CK_LeftQuick: dview->skip_cols -= 8; break; - case CK_DiffQuickRight: + case CK_RightQuick: dview->skip_cols += 8; break; - case CK_DiffHome: + case CK_Home: dview->skip_cols = 0; break; - case CK_ShowCommandLine: + case CK_Shell: view_other_cmd (); break; - case CK_DiffQuit: + case CK_Quit: dview->view_quit = 1; break; - case CK_DiffSave: + case CK_Save: dview_do_save (dview); break; - case CK_DiffOptions: + case CK_Options: dview_diff_options (dview); break; +#ifdef HAVE_CHARSET case CK_SelectCodepage: dview_select_encoding (dview); dview_reread (dview); tty_touch_screen (); repaint_screen (); break; +#endif default: res = MSG_NOT_HANDLED; } diff --git a/src/editor/edit.c b/src/editor/edit.c index 7f1337651..97596f91d 100644 --- a/src/editor/edit.c +++ b/src/editor/edit.c @@ -1666,8 +1666,7 @@ user_menu (WEdit * edit, const char *menu_file, int selected_entry) /* run shell scripts from menu */ if (user_menu_cmd (edit, menu_file, selected_entry) - && (mc_stat (block_file, &status) == 0) - && (status.st_size != 0)) + && (mc_stat (block_file, &status) == 0) && (status.st_size != 0)) { int rc = 0; FILE *fd; @@ -3386,8 +3385,9 @@ edit_find_bracket (WEdit * edit) void edit_execute_key_command (WEdit * edit, unsigned long command, int char_for_insertion) { - if (command == CK_Begin_Record_Macro || command == CK_Begin_Record_Repeat - || (macro_index < 0 && (command == CK_Begin_End_Macro || command == CK_Begin_End_Repeat))) + if (command == CK_MacroStartRecord || command == CK_RepeatStartRecord + || (macro_index < 0 + && (command == CK_MacroStartStopRecord || command == CK_RepeatStartStopRecord))) { macro_index = 0; edit->force |= REDRAW_CHAR_ONLY | REDRAW_LINE; @@ -3396,19 +3396,18 @@ edit_execute_key_command (WEdit * edit, unsigned long command, int char_for_inse if (macro_index != -1) { edit->force |= REDRAW_COMPLETELY; - if (command == CK_End_Record_Macro || command == CK_Begin_End_Macro) + if (command == CK_MacroStopRecord || command == CK_MacroStartStopRecord) { edit_store_macro_cmd (edit); macro_index = -1; return; } - else if (command == CK_End_Record_Repeat || command == CK_Begin_End_Repeat) + else if (command == CK_RepeatStopRecord || command == CK_RepeatStartStopRecord) { edit_repeat_macro_cmd (edit); macro_index = -1; return; } - } if (macro_index >= 0 && macro_index < MAX_MACRO_LENGTH - 1) @@ -3417,7 +3416,7 @@ edit_execute_key_command (WEdit * edit, unsigned long command, int char_for_inse record_macro_buf[macro_index++].ch = char_for_insertion; } /* record the beginning of a set of editing actions initiated by a key press */ - if (command != CK_Undo && command != CK_Ext_Mode) + if (command != CK_Undo && command != CK_ExtendedKeyMap) edit_push_key_press (edit); edit_execute_cmd (edit, command, char_for_insertion); @@ -3542,16 +3541,16 @@ edit_execute_cmd (WEdit * edit, unsigned long command, int char_for_insertion) switch (command) { - case CK_Begin_Page: - case CK_End_Page: - case CK_Begin_Page_Highlight: - case CK_End_Page_Highlight: - case CK_Word_Left: - case CK_Word_Right: + case CK_TopOnScreen: + case CK_BottomOnScreen: + case CK_MarkToPageBegin: + case CK_MarkToPageEnd: case CK_Up: case CK_Down: case CK_Left: case CK_Right: + case CK_WordLeft: + case CK_WordRight: if (edit->mark2 >= 0) { if (!option_persistent_selections) @@ -3566,26 +3565,26 @@ edit_execute_cmd (WEdit * edit, unsigned long command, int char_for_insertion) switch (command) { - case CK_Begin_Page: - case CK_End_Page: - case CK_Begin_Page_Highlight: - case CK_End_Page_Highlight: - case CK_Word_Left: - case CK_Word_Right: + case CK_TopOnScreen: + case CK_BottomOnScreen: + case CK_MarkToPageBegin: + case CK_MarkToPageEnd: case CK_Up: case CK_Down: - case CK_Word_Left_Highlight: - case CK_Word_Right_Highlight: - case CK_Up_Highlight: - case CK_Down_Highlight: - case CK_Up_Alt_Highlight: - case CK_Down_Alt_Highlight: + case CK_WordLeft: + case CK_WordRight: + case CK_MarkToWordBegin: + case CK_MarkToWordEnd: + case CK_MarkUp: + case CK_MarkDown: + case CK_MarkColumnUp: + case CK_MarkColumnDown: if (edit->mark2 == -1) break; /*marking is following the cursor: may need to highlight a whole line */ case CK_Left: case CK_Right: - case CK_Left_Highlight: - case CK_Right_Highlight: + case CK_MarkLeft: + case CK_MarkRight: edit->force |= REDRAW_CHAR_ONLY; } @@ -3654,25 +3653,25 @@ edit_execute_cmd (WEdit * edit, unsigned long command, int char_for_insertion) } edit_delete (edit, 0); break; - case CK_Delete_Word_Left: + case CK_DeleteToWordBegin: edit->over_col = 0; edit_left_delete_word (edit); break; - case CK_Delete_Word_Right: + case CK_DeleteToWordEnd: if (option_cursor_beyond_eol && edit->over_col > 0) edit_insert_over (edit); edit_right_delete_word (edit); break; - case CK_Delete_Line: + case CK_DeleteLine: edit_delete_line (edit); break; - case CK_Delete_To_Line_End: - edit_delete_to_line_end (edit); - break; - case CK_Delete_To_Line_Begin: + case CK_DeleteToHome: edit_delete_to_line_begin (edit); break; + case CK_DeleteToEnd: + edit_delete_to_line_end (edit); + break; case CK_Enter: edit->over_col = 0; if (option_auto_para_formatting) @@ -3695,22 +3694,22 @@ edit_execute_cmd (WEdit * edit, unsigned long command, int char_for_insertion) edit_insert (edit, '\n'); break; - case CK_Page_Up_Alt_Highlight: + case CK_MarkColumnPageUp: edit->column_highlight = 1; - case CK_Page_Up: - case CK_Page_Up_Highlight: + case CK_PageUp: + case CK_MarkPageUp: edit_move_up (edit, edit->num_widget_lines - 1, 1); break; - case CK_Page_Down_Alt_Highlight: + case CK_MarkColumnPageDown: edit->column_highlight = 1; - case CK_Page_Down: - case CK_Page_Down_Highlight: + case CK_PageDown: + case CK_MarkPageDown: edit_move_down (edit, edit->num_widget_lines - 1, 1); break; - case CK_Left_Alt_Highlight: + case CK_MarkColumnLeft: edit->column_highlight = 1; case CK_Left: - case CK_Left_Highlight: + case CK_MarkLeft: if (option_fake_half_tabs) { if (is_in_indent (edit) && right_of_four_spaces (edit)) @@ -3725,10 +3724,10 @@ edit_execute_cmd (WEdit * edit, unsigned long command, int char_for_insertion) } edit_left_char_move_cmd (edit); break; - case CK_Right_Alt_Highlight: + case CK_MarkColumnRight: edit->column_highlight = 1; case CK_Right: - case CK_Right_Highlight: + case CK_MarkRight: if (option_fake_half_tabs) { if (is_in_indent (edit) && left_of_four_spaces (edit)) @@ -3740,66 +3739,66 @@ edit_execute_cmd (WEdit * edit, unsigned long command, int char_for_insertion) } edit_right_char_move_cmd (edit); break; - case CK_Begin_Page: - case CK_Begin_Page_Highlight: + case CK_TopOnScreen: + case CK_MarkToPageBegin: edit_begin_page (edit); break; - case CK_End_Page: - case CK_End_Page_Highlight: + case CK_BottomOnScreen: + case CK_MarkToPageEnd: edit_end_page (edit); break; - case CK_Word_Left: - case CK_Word_Left_Highlight: + case CK_WordLeft: + case CK_MarkToWordBegin: edit->over_col = 0; edit_left_word_move_cmd (edit); break; - case CK_Word_Right: - case CK_Word_Right_Highlight: + case CK_WordRight: + case CK_MarkToWordEnd: edit->over_col = 0; edit_right_word_move_cmd (edit); break; - case CK_Up_Alt_Highlight: + case CK_MarkColumnUp: edit->column_highlight = 1; case CK_Up: - case CK_Up_Highlight: + case CK_MarkUp: edit_move_up (edit, 1, 0); break; - case CK_Down_Alt_Highlight: + case CK_MarkColumnDown: edit->column_highlight = 1; case CK_Down: - case CK_Down_Highlight: + case CK_MarkDown: edit_move_down (edit, 1, 0); break; - case CK_Paragraph_Up_Alt_Highlight: + case CK_MarkColumnParagraphUp: edit->column_highlight = 1; - case CK_Paragraph_Up: - case CK_Paragraph_Up_Highlight: + case CK_ParagraphUp: + case CK_MarkParagraphUp: edit_move_up_paragraph (edit, 0); break; - case CK_Paragraph_Down_Alt_Highlight: + case CK_MarkColumnParagraphDown: edit->column_highlight = 1; - case CK_Paragraph_Down: - case CK_Paragraph_Down_Highlight: + case CK_ParagraphDown: + case CK_MarkParagraphDown: edit_move_down_paragraph (edit, 0); break; - case CK_Scroll_Up_Alt_Highlight: + case CK_MarkColumnScrollUp: edit->column_highlight = 1; - case CK_Scroll_Up: - case CK_Scroll_Up_Highlight: + case CK_ScrollUp: + case CK_MarkScrollUp: edit_move_up (edit, 1, 1); break; - case CK_Scroll_Down_Alt_Highlight: + case CK_MarkColumnScrollDown: edit->column_highlight = 1; - case CK_Scroll_Down: - case CK_Scroll_Down_Highlight: + case CK_ScrollDown: + case CK_MarkScrollDown: edit_move_down (edit, 1, 1); break; case CK_Home: - case CK_Home_Highlight: + case CK_MarkToHome: edit_cursor_to_bol (edit); break; case CK_End: - case CK_End_Highlight: + case CK_MarkToEnd: edit_cursor_to_eol (edit); break; case CK_Tab: @@ -3827,8 +3826,8 @@ edit_execute_cmd (WEdit * edit, unsigned long command, int char_for_insertion) } break; - case CK_Toggle_Insert: - edit->overwrite = (edit->overwrite == 0); + case CK_InsertOverwrite: + edit->overwrite = !edit->overwrite; break; case CK_Mark: @@ -3840,13 +3839,13 @@ edit_execute_cmd (WEdit * edit, unsigned long command, int char_for_insertion) } edit_mark_cmd (edit, 0); break; - case CK_Column_Mark: + case CK_MarkColumn: if (!edit->column_highlight) edit_push_undo_action (edit, COLUMN_OFF); edit->column_highlight = 1; edit_mark_cmd (edit, 0); break; - case CK_Mark_All: + case CK_MarkAll: edit_set_markers (edit, 0, edit->last_byte, 0, 0); edit->force |= REDRAW_PAGE; break; @@ -3856,49 +3855,43 @@ edit_execute_cmd (WEdit * edit, unsigned long command, int char_for_insertion) edit->column_highlight = 0; edit_mark_cmd (edit, 1); break; - case CK_Mark_Word: + case CK_MarkWord: if (edit->column_highlight) edit_push_undo_action (edit, COLUMN_ON); edit->column_highlight = 0; edit_mark_current_word_cmd (edit); break; - case CK_Mark_Line: + case CK_MarkLine: if (edit->column_highlight) edit_push_undo_action (edit, COLUMN_ON); edit->column_highlight = 0; edit_mark_current_line_cmd (edit); break; - case CK_Toggle_Line_State: + + case CK_ShowNumbers: option_line_state = !option_line_state; - if (option_line_state) - { - option_line_state_width = LINE_STATE_WIDTH; - } - else - { - option_line_state_width = 0; - } + option_line_state_width = option_line_state ? LINE_STATE_WIDTH : 0; edit->force |= REDRAW_PAGE; break; - case CK_Toggle_Show_Margin: + case CK_ShowMargin: show_right_margin = !show_right_margin; edit->force |= REDRAW_PAGE; break; - case CK_Toggle_Bookmark: + case CK_Bookmark: book_mark_clear (edit, edit->curs_line, BOOK_MARK_FOUND_COLOR); if (book_mark_query_color (edit, edit->curs_line, BOOK_MARK_COLOR)) book_mark_clear (edit, edit->curs_line, BOOK_MARK_COLOR); else book_mark_insert (edit, edit->curs_line, BOOK_MARK_COLOR); break; - case CK_Flush_Bookmarks: + case CK_BookmarkFlush: book_mark_flush (edit, BOOK_MARK_COLOR); book_mark_flush (edit, BOOK_MARK_FOUND_COLOR); edit->force |= REDRAW_PAGE; break; - case CK_Next_Bookmark: + case CK_BookmarkNext: if (edit->book_mark) { struct _book_mark *p; @@ -3913,7 +3906,7 @@ edit_execute_cmd (WEdit * edit, unsigned long command, int char_for_insertion) } } break; - case CK_Prev_Bookmark: + case CK_BookmarkPrev: if (edit->book_mark) { struct _book_mark *p; @@ -3931,12 +3924,12 @@ edit_execute_cmd (WEdit * edit, unsigned long command, int char_for_insertion) } break; - case CK_Beginning_Of_Text: - case CK_Beginning_Of_Text_Highlight: + case CK_Top: + case CK_MarkToFileBegin: edit_move_to_top (edit); break; - case CK_End_Of_Text: - case CK_End_Of_Text_Highlight: + case CK_Bottom: + case CK_MarkToFileEnd: edit_move_to_bottom (edit); break; @@ -3952,21 +3945,21 @@ edit_execute_cmd (WEdit * edit, unsigned long command, int char_for_insertion) edit_block_move_cmd (edit); break; - case CK_Shift_Block_Left: + case CK_BlockShiftLeft: if (edit->mark1 != edit->mark2) edit_move_block_to_left (edit); break; - case CK_Shift_Block_Right: + case CK_BlockShiftRight: if (edit->mark1 != edit->mark2) edit_move_block_to_right (edit); break; - case CK_XStore: + case CK_Store: edit_copy_to_X_buf_cmd (edit); break; - case CK_XCut: + case CK_Cut: edit_cut_to_X_buf_cmd (edit); break; - case CK_XPaste: + case CK_Paste: /* if non persistent selection and text selected */ if (!option_persistent_selections) { @@ -3977,69 +3970,69 @@ edit_execute_cmd (WEdit * edit, unsigned long command, int char_for_insertion) edit_insert_over (edit); edit_paste_from_X_buf_cmd (edit); break; - case CK_Selection_History: + case CK_History: edit_paste_from_history (edit); break; - case CK_Save_As: + case CK_SaveAs: edit_save_as_cmd (edit); break; case CK_Save: edit_save_confirm_cmd (edit); break; - case CK_Load: + case CK_EditFile: edit_load_cmd (edit, EDIT_FILE_COMMON); break; - case CK_Save_Block: + case CK_BlockSave: edit_save_block_cmd (edit); break; - case CK_Insert_File: + case CK_InsertFile: edit_insert_file_cmd (edit); break; - case CK_Load_Prev_File: + case CK_FilePrev: edit_load_back_cmd (edit); break; - case CK_Load_Next_File: + case CK_FileNext: edit_load_forward_cmd (edit); break; - case CK_Load_Syntax_File: + case CK_EditSyntaxFile: edit_load_cmd (edit, EDIT_FILE_SYNTAX); break; - case CK_Choose_Syntax: + case CK_SyntaxChoose: edit_syntax_dialog (edit); break; - case CK_Load_Menu_File: + case CK_EditUserMenu: edit_load_cmd (edit, EDIT_FILE_MENU); break; - case CK_Toggle_Syntax: + case CK_SyntaxOnOff: option_syntax_highlighting ^= 1; if (option_syntax_highlighting == 1) edit_load_syntax (edit, NULL, edit->syntax_type); edit->force |= REDRAW_PAGE; break; - case CK_Toggle_Tab_TWS: + case CK_ShowTabTws: enable_show_tabs_tws ^= 1; edit->force |= REDRAW_PAGE; break; - case CK_Find: + case CK_Search: edit_search_cmd (edit, FALSE); break; - case CK_Find_Again: + case CK_SearchContinue: edit_search_cmd (edit, TRUE); break; case CK_Replace: edit_replace_cmd (edit, 0); break; - case CK_Replace_Again: + case CK_ReplaceContinue: edit_replace_cmd (edit, 1); break; - case CK_Complete_Word: + case CK_Complete: /* if text marked shift block */ if (edit->mark1 != edit->mark2 && !option_persistent_selections) { @@ -4050,13 +4043,13 @@ edit_execute_cmd (WEdit * edit, unsigned long command, int char_for_insertion) edit_complete_word_cmd (edit); } break; - case CK_Find_Definition: + case CK_Find: edit_get_match_keyword_cmd (edit); break; case CK_Quit: dlg_stop (edit->widget.owner); break; - case CK_New: + case CK_EditNew: edit_new_cmd (edit); break; case CK_Help: @@ -4065,7 +4058,7 @@ edit_execute_cmd (WEdit * edit, unsigned long command, int char_for_insertion) case CK_Refresh: edit_refresh_cmd (edit); break; - case CK_SaveSetupCmd: + case CK_SaveSetup: save_setup_cmd (); break; case CK_About: @@ -4074,10 +4067,10 @@ edit_execute_cmd (WEdit * edit, unsigned long command, int char_for_insertion) case CK_LearnKeys: learn_keys (); break; - case CK_Edit_Options: + case CK_Options: edit_options_dialog (edit); break; - case CK_Edit_Save_Mode: + case CK_OptionsSaveMode: menu_save_mode_cmd (); break; case CK_Date: @@ -4096,23 +4089,23 @@ edit_execute_cmd (WEdit * edit, unsigned long command, int char_for_insertion) case CK_Goto: edit_goto_cmd (edit); break; - case CK_Paragraph_Format: + case CK_ParagraphFormat: format_paragraph (edit, 1); edit->force |= REDRAW_PAGE; break; - case CK_Delete_Macro: + case CK_MacroDelete: edit_delete_macro_cmd (edit); break; - case CK_Match_Bracket: + case CK_MatchBracket: edit_goto_matching_bracket (edit); break; - case CK_User_Menu: + case CK_UserMenu: user_menu (edit, NULL, -1); break; case CK_Sort: edit_sort_cmd (edit); break; - case CK_ExtCmd: + case CK_ExternalCommand: edit_ext_cmd (edit); break; case CK_Mail: @@ -4121,67 +4114,69 @@ edit_execute_cmd (WEdit * edit, unsigned long command, int char_for_insertion) case CK_Shell: view_other_cmd (); break; +#ifdef HAVE_CHARSET case CK_SelectCodepage: edit_select_codepage_cmd (edit); break; - case CK_Insert_Literal: +#endif + case CK_InsertLiteral: edit_insert_literal_cmd (edit); break; - case CK_Begin_End_Macro: + case CK_MacroStartStopRecord: edit_begin_end_macro_cmd (edit); break; - case CK_Begin_End_Repeat: + case CK_RepeatStartStopRecord: edit_begin_end_repeat_cmd (edit); break; - case CK_Ext_Mode: + case CK_ExtendedKeyMap: edit->extmod = 1; break; default: break; } - /* CK_Pipe_Block */ - if ((command / CK_Pipe_Block (0)) == 1) - edit_block_process_cmd (edit, command - CK_Pipe_Block (0)); + /* CK_PipeBlock */ + if ((command / CK_PipeBlock (0)) == 1) + edit_block_process_cmd (edit, command - CK_PipeBlock (0)); /* keys which must set the col position, and the search vars */ switch (command) { - case CK_Find: - case CK_Find_Again: + case CK_Search: + case CK_SearchContinue: case CK_Replace: - case CK_Replace_Again: - case CK_Complete_Word: + case CK_ReplaceContinue: + case CK_Complete: edit->prev_col = edit_get_col (edit); break; case CK_Up: - case CK_Up_Highlight: - case CK_Up_Alt_Highlight: + case CK_MarkUp: + case CK_MarkColumnUp: case CK_Down: - case CK_Down_Highlight: - case CK_Down_Alt_Highlight: - case CK_Page_Up: - case CK_Page_Up_Highlight: - case CK_Page_Up_Alt_Highlight: - case CK_Page_Down: - case CK_Page_Down_Highlight: - case CK_Page_Down_Alt_Highlight: - case CK_Beginning_Of_Text: - case CK_Beginning_Of_Text_Highlight: - case CK_End_Of_Text: - case CK_End_Of_Text_Highlight: - case CK_Paragraph_Up: - case CK_Paragraph_Up_Highlight: - case CK_Paragraph_Up_Alt_Highlight: - case CK_Paragraph_Down: - case CK_Paragraph_Down_Highlight: - case CK_Paragraph_Down_Alt_Highlight: - case CK_Scroll_Up: - case CK_Scroll_Up_Highlight: - case CK_Scroll_Up_Alt_Highlight: - case CK_Scroll_Down: - case CK_Scroll_Down_Highlight: - case CK_Scroll_Down_Alt_Highlight: + case CK_MarkDown: + case CK_MarkColumnDown: + case CK_PageUp: + case CK_MarkPageUp: + case CK_MarkColumnPageUp: + case CK_PageDown: + case CK_MarkPageDown: + case CK_MarkColumnPageDown: + case CK_Top: + case CK_MarkToFileBegin: + case CK_Bottom: + case CK_MarkToFileEnd: + case CK_ParagraphUp: + case CK_MarkParagraphUp: + case CK_MarkColumnParagraphUp: + case CK_ParagraphDown: + case CK_MarkParagraphDown: + case CK_MarkColumnParagraphDown: + case CK_ScrollUp: + case CK_MarkScrollUp: + case CK_MarkColumnScrollUp: + case CK_ScrollDown: + case CK_MarkScrollDown: + case CK_MarkColumnScrollDown: edit->search_start = edit->curs1; edit->found_len = 0; break; @@ -4198,10 +4193,10 @@ edit_execute_cmd (WEdit * edit, unsigned long command, int char_for_insertion) { case CK_BackSpace: case CK_Delete: - case CK_Delete_Word_Left: - case CK_Delete_Word_Right: - case CK_Delete_To_Line_End: - case CK_Delete_To_Line_Begin: + case CK_DeleteToWordBegin: + case CK_DeleteToWordEnd: + case CK_DeleteToHome: + case CK_DeleteToEnd: format_paragraph (edit, 0); edit->force |= REDRAW_PAGE; } diff --git a/src/editor/editcmd.c b/src/editor/editcmd.c index 5fb523730..d1fa746b8 100644 --- a/src/editor/editcmd.c +++ b/src/editor/editcmd.c @@ -1533,9 +1533,9 @@ edit_store_macro_cmd (WEdit * edit) tmp_act = keybind_lookup_keymap_command (editor_map, hotkey); /* return FALSE if try assign macro into restricted hotkeys */ - if (tmp_act == CK_Begin_Record_Macro - || tmp_act == CK_End_Record_Macro - || tmp_act == CK_Begin_End_Macro) + if (tmp_act == CK_MacroStartRecord + || tmp_act == CK_MacroStopRecord + || tmp_act == CK_MacroStartStopRecord) return FALSE; edit_delete_macro (edit, hotkey); @@ -1692,9 +1692,9 @@ edit_load_macro_cmd (WEdit * edit) if (m_act.action != 0) { /* a shell command */ - if ((m_act.action / CK_Pipe_Block (0)) == 1) + if ((m_act.action / CK_PipeBlock (0)) == 1) { - m_act.action = CK_Pipe_Block (0) + (m_act.ch > 0 ? m_act.ch : 0); + m_act.action = CK_PipeBlock (0) + (m_act.ch > 0 ? m_act.ch : 0); m_act.ch = -1; } g_array_append_val (macros, m_act); @@ -3056,7 +3056,7 @@ edit_begin_end_macro_cmd (WEdit * edit) /* edit is a pointer to the widget */ if (edit != NULL) { - unsigned long command = macro_index < 0 ? CK_Begin_Record_Macro : CK_End_Record_Macro; + unsigned long command = macro_index < 0 ? CK_MacroStartRecord : CK_MacroStopRecord; edit_execute_key_command (edit, command, -1); } } @@ -3069,7 +3069,7 @@ edit_begin_end_repeat_cmd (WEdit * edit) /* edit is a pointer to the widget */ if (edit != NULL) { - unsigned long command = macro_index < 0 ? CK_Begin_Record_Repeat : CK_End_Record_Repeat; + unsigned long command = macro_index < 0 ? CK_RepeatStartRecord : CK_RepeatStopRecord; edit_execute_key_command (edit, command, -1); } } diff --git a/src/editor/editmenu.c b/src/editor/editmenu.c index 58d8e4d6e..ee3234694 100644 --- a/src/editor/editmenu.c +++ b/src/editor/editmenu.c @@ -67,16 +67,16 @@ create_file_menu (void) { GList *entries = NULL; - entries = g_list_append (entries, menu_entry_create (_("&Open file..."), CK_Load)); - entries = g_list_append (entries, menu_entry_create (_("&New"), CK_New)); + entries = g_list_append (entries, menu_entry_create (_("&Open file..."), CK_EditFile)); + entries = g_list_append (entries, menu_entry_create (_("&New"), CK_EditNew)); entries = g_list_append (entries, menu_separator_create ()); entries = g_list_append (entries, menu_entry_create (_("&Save"), CK_Save)); - entries = g_list_append (entries, menu_entry_create (_("Save &as..."), CK_Save_As)); + entries = g_list_append (entries, menu_entry_create (_("Save &as..."), CK_SaveAs)); entries = g_list_append (entries, menu_separator_create ()); - entries = g_list_append (entries, menu_entry_create (_("&Insert file..."), CK_Insert_File)); - entries = g_list_append (entries, menu_entry_create (_("Cop&y to file..."), CK_Save_Block)); + entries = g_list_append (entries, menu_entry_create (_("&Insert file..."), CK_InsertFile)); + entries = g_list_append (entries, menu_entry_create (_("Cop&y to file..."), CK_BlockSave)); entries = g_list_append (entries, menu_separator_create ()); - entries = g_list_append (entries, menu_entry_create (_("&User menu..."), CK_User_Menu)); + entries = g_list_append (entries, menu_entry_create (_("&User menu..."), CK_UserMenu)); entries = g_list_append (entries, menu_separator_create ()); entries = g_list_append (entries, menu_entry_create (_("A&bout..."), CK_About)); entries = g_list_append (entries, menu_separator_create ()); @@ -95,23 +95,24 @@ create_edit_menu (void) entries = g_list_append (entries, menu_entry_create (_("&Undo"), CK_Undo)); entries = g_list_append (entries, menu_entry_create (_("&Redo"), CK_Redo)); entries = g_list_append (entries, menu_separator_create ()); - entries = g_list_append (entries, menu_entry_create (_("&Toggle ins/overw"), CK_Toggle_Insert)); + entries = + g_list_append (entries, menu_entry_create (_("&Toggle ins/overw"), CK_InsertOverwrite)); entries = g_list_append (entries, menu_separator_create ()); entries = g_list_append (entries, menu_entry_create (_("To&ggle mark"), CK_Mark)); - entries = g_list_append (entries, menu_entry_create (_("&Mark columns"), CK_Column_Mark)); - entries = g_list_append (entries, menu_entry_create (_("Mark &all"), CK_Mark_All)); + entries = g_list_append (entries, menu_entry_create (_("&Mark columns"), CK_MarkColumn)); + entries = g_list_append (entries, menu_entry_create (_("Mark &all"), CK_MarkAll)); entries = g_list_append (entries, menu_entry_create (_("Unmar&k"), CK_Unmark)); entries = g_list_append (entries, menu_separator_create ()); entries = g_list_append (entries, menu_entry_create (_("Cop&y"), CK_Copy)); entries = g_list_append (entries, menu_entry_create (_("Mo&ve"), CK_Move)); entries = g_list_append (entries, menu_entry_create (_("&Delete"), CK_Remove)); entries = g_list_append (entries, menu_separator_create ()); - entries = g_list_append (entries, menu_entry_create (_("Co&py to clipfile"), CK_XStore)); - entries = g_list_append (entries, menu_entry_create (_("&Cut to clipfile"), CK_XCut)); - entries = g_list_append (entries, menu_entry_create (_("Pa&ste from clipfile"), CK_XPaste)); + entries = g_list_append (entries, menu_entry_create (_("Co&py to clipfile"), CK_Store)); + entries = g_list_append (entries, menu_entry_create (_("&Cut to clipfile"), CK_Cut)); + entries = g_list_append (entries, menu_entry_create (_("Pa&ste from clipfile"), CK_Paste)); entries = g_list_append (entries, menu_separator_create ()); - entries = g_list_append (entries, menu_entry_create (_("&Beginning"), CK_Beginning_Of_Text)); - entries = g_list_append (entries, menu_entry_create (_("&End"), CK_End_Of_Text)); + entries = g_list_append (entries, menu_entry_create (_("&Beginning"), CK_Top)); + entries = g_list_append (entries, menu_entry_create (_("&End"), CK_Bottom)); return entries; } @@ -123,15 +124,14 @@ create_search_replace_menu (void) { GList *entries = NULL; - entries = g_list_append (entries, menu_entry_create (_("&Search..."), CK_Find)); - entries = g_list_append (entries, menu_entry_create (_("Search &again"), CK_Find_Again)); + entries = g_list_append (entries, menu_entry_create (_("&Search..."), CK_Search)); + entries = g_list_append (entries, menu_entry_create (_("Search &again"), CK_SearchContinue)); entries = g_list_append (entries, menu_entry_create (_("&Replace..."), CK_Replace)); entries = g_list_append (entries, menu_separator_create ()); - entries = - g_list_append (entries, menu_entry_create (_("&Toggle bookmark"), CK_Toggle_Bookmark)); - entries = g_list_append (entries, menu_entry_create (_("&Next bookmark"), CK_Next_Bookmark)); - entries = g_list_append (entries, menu_entry_create (_("&Prev bookmark"), CK_Prev_Bookmark)); - entries = g_list_append (entries, menu_entry_create (_("&Flush bookmark"), CK_Flush_Bookmarks)); + entries = g_list_append (entries, menu_entry_create (_("&Toggle bookmark"), CK_Bookmark)); + entries = g_list_append (entries, menu_entry_create (_("&Next bookmark"), CK_BookmarkNext)); + entries = g_list_append (entries, menu_entry_create (_("&Prev bookmark"), CK_BookmarkPrev)); + entries = g_list_append (entries, menu_entry_create (_("&Flush bookmarks"), CK_BookmarkFlush)); return entries; } @@ -145,20 +145,18 @@ create_command_menu (void) entries = g_list_append (entries, menu_entry_create (_("&Go to line..."), CK_Goto)); entries = - g_list_append (entries, menu_entry_create (_("&Toggle line state"), CK_Toggle_Line_State)); + g_list_append (entries, menu_entry_create (_("&Toggle line state"), CK_ShowNumbers)); entries = - g_list_append (entries, menu_entry_create (_("Go to matching &bracket"), CK_Match_Bracket)); + g_list_append (entries, menu_entry_create (_("Go to matching &bracket"), CK_MatchBracket)); entries = g_list_append (entries, - menu_entry_create (_("Toggle s&yntax highlighting"), CK_Toggle_Syntax)); + menu_entry_create (_("Toggle s&yntax highlighting"), CK_SyntaxOnOff)); entries = g_list_append (entries, menu_separator_create ()); entries = - g_list_append (entries, menu_entry_create (_("&Find declaration"), CK_Find_Definition)); + g_list_append (entries, menu_entry_create (_("&Find declaration"), CK_Find)); + entries = g_list_append (entries, menu_entry_create (_("Back from &declaration"), CK_FilePrev)); entries = - g_list_append (entries, menu_entry_create (_("Back from &declaration"), CK_Load_Prev_File)); - entries = - g_list_append (entries, - menu_entry_create (_("For&ward to declaration"), CK_Load_Next_File)); + g_list_append (entries, menu_entry_create (_("For&ward to declaration"), CK_FileNext)); #ifdef HAVE_CHARSET entries = g_list_append (entries, menu_separator_create ()); entries = g_list_append (entries, menu_entry_create (_("Encod&ing..."), CK_SelectCodepage)); @@ -168,12 +166,14 @@ create_command_menu (void) entries = g_list_append (entries, menu_separator_create ()); entries = g_list_append (entries, - menu_entry_create (_("&Start/Stop record macro"), CK_Begin_End_Macro)); - entries = g_list_append (entries, menu_entry_create (_("Delete macr&o..."), CK_Delete_Macro)); - entries = g_list_append (entries, menu_entry_create (_("Record/Repeat &actions"), CK_Begin_End_Repeat)); + menu_entry_create (_("&Start/Stop record macro"), CK_MacroStartStopRecord)); + entries = g_list_append (entries, menu_entry_create (_("Delete macr&o..."), CK_MacroDelete)); + entries = + g_list_append (entries, + menu_entry_create (_("Record/Repeat &actions"), CK_RepeatStartStopRecord)); entries = g_list_append (entries, menu_separator_create ()); entries = - g_list_append (entries, menu_entry_create (_("'ispell' s&pell check"), CK_Pipe_Block (1))); + g_list_append (entries, menu_entry_create (_("'ispell' s&pell check"), CK_PipeBlock (1))); entries = g_list_append (entries, menu_entry_create (_("&Mail..."), CK_Mail)); return entries; @@ -187,15 +187,16 @@ create_format_menu (void) GList *entries = NULL; entries = - g_list_append (entries, menu_entry_create (_("Insert &literal..."), CK_Insert_Literal)); + g_list_append (entries, menu_entry_create (_("Insert &literal..."), CK_InsertLiteral)); entries = g_list_append (entries, menu_entry_create (_("Insert &date/time"), CK_Date)); entries = g_list_append (entries, menu_separator_create ()); entries = - g_list_append (entries, menu_entry_create (_("&Format paragraph"), CK_Paragraph_Format)); + g_list_append (entries, menu_entry_create (_("&Format paragraph"), CK_ParagraphFormat)); entries = g_list_append (entries, menu_entry_create (_("&Sort..."), CK_Sort)); - entries = g_list_append (entries, menu_entry_create (_("&Paste output of..."), CK_ExtCmd)); entries = - g_list_append (entries, menu_entry_create (_("&External formatter"), CK_Pipe_Block (0))); + g_list_append (entries, menu_entry_create (_("&Paste output of..."), CK_ExternalCommand)); + entries = + g_list_append (entries, menu_entry_create (_("&External formatter"), CK_PipeBlock (0))); return entries; } @@ -207,16 +208,16 @@ create_options_menu (void) { GList *entries = NULL; - entries = g_list_append (entries, menu_entry_create (_("&General..."), CK_Edit_Options)); - entries = g_list_append (entries, menu_entry_create (_("Save &mode..."), CK_Edit_Save_Mode)); + entries = g_list_append (entries, menu_entry_create (_("&General..."), CK_Options)); + entries = g_list_append (entries, menu_entry_create (_("Save &mode..."), CK_OptionsSaveMode)); entries = g_list_append (entries, menu_entry_create (_("Learn &keys..."), CK_LearnKeys)); entries = - g_list_append (entries, menu_entry_create (_("Syntax &highlighting..."), CK_Choose_Syntax)); + g_list_append (entries, menu_entry_create (_("Syntax &highlighting..."), CK_SyntaxChoose)); entries = g_list_append (entries, menu_separator_create ()); - entries = g_list_append (entries, menu_entry_create (_("S&yntax file"), CK_Load_Syntax_File)); - entries = g_list_append (entries, menu_entry_create (_("&Menu file"), CK_Load_Menu_File)); + entries = g_list_append (entries, menu_entry_create (_("S&yntax file"), CK_EditSyntaxFile)); + entries = g_list_append (entries, menu_entry_create (_("&Menu file"), CK_EditUserMenu)); entries = g_list_append (entries, menu_separator_create ()); - entries = g_list_append (entries, menu_entry_create (_("&Save setup"), CK_SaveSetupCmd)); + entries = g_list_append (entries, menu_entry_create (_("&Save setup"), CK_SaveSetup)); return entries; } diff --git a/src/editor/editwidget.c b/src/editor/editwidget.c index 7fdd779b0..9a49bedab 100644 --- a/src/editor/editwidget.c +++ b/src/editor/editwidget.c @@ -79,7 +79,7 @@ edit_get_shortcut (unsigned long command) if (shortcut != NULL) return g_strdup (shortcut); - ext_map = keybind_lookup_keymap_shortcut (editor_map, CK_Ext_Mode); + ext_map = keybind_lookup_keymap_shortcut (editor_map, CK_ExtendedKeyMap); if (ext_map != NULL) shortcut = keybind_lookup_keymap_shortcut (editor_x_map, command); if (shortcut != NULL) diff --git a/src/filemanager/cmd.c b/src/filemanager/cmd.c index 42d58e910..e8e2ee774 100644 --- a/src/filemanager/cmd.c +++ b/src/filemanager/cmd.c @@ -58,7 +58,7 @@ #include "lib/strutil.h" #include "lib/util.h" #include "lib/widget.h" -#include "lib/keybind.h" /* CK_PanelMoveDown, CK_InputHistoryShow */ +#include "lib/keybind.h" /* CK_Down, CK_History */ #include "src/subshell.h" /* use_subshell */ #include "src/consaver/cons.saver.h" /* console_flag */ @@ -79,7 +79,7 @@ #include "fileopctx.h" #include "file.h" /* file operation routines */ #include "find.h" /* do_find() */ -#include "hotlist.h" /* hotlist_cmd() */ +#include "hotlist.h" /* hotlist_show() */ #include "tree.h" /* tree_chdir() */ #include "midnight.h" /* change_panel() */ #include "usermenu.h" /* MC_GLOBAL_MENU */ @@ -146,10 +146,10 @@ scan_for_file (WPanel * panel, int idx, int direction) /* --------------------------------------------------------------------------------------------- */ /** * Run viewer (internal or external) on the currently selected file. - * If normal is 1, force internal viewer and raw mode (used for F13). + * If normal is TRUE, force internal viewer and raw mode (used for F13). */ static void -do_view_cmd (int normal) +do_view_cmd (gboolean normal) { /* Directories are viewed by changing to them */ if (S_ISDIR (selection (current_panel)->st.st_mode) || link_isdir (selection (current_panel))) @@ -168,14 +168,16 @@ do_view_cmd (int normal) } else { - int dir, file_idx; - char *filename; + int file_idx; file_idx = current_panel->selected; - while (1) - { - filename = current_panel->dir.list[file_idx].fname; + while (TRUE) + { + char *filename; + int dir; + + filename = current_panel->dir.list[file_idx].fname; dir = view_file (filename, normal, use_internal_view); if (dir == 0) break; @@ -686,7 +688,7 @@ view_file (const char *filename, int plain_view, int internal) void view_cmd (void) { - do_view_cmd (0); + do_view_cmd (FALSE); } /* --------------------------------------------------------------------------------------------- */ @@ -710,15 +712,15 @@ view_file_cmd (void) /* --------------------------------------------------------------------------------------------- */ /** Run plain internal viewer on the currently selected file */ void -view_simple_cmd (void) +view_raw_cmd (void) { - do_view_cmd (1); + do_view_cmd (TRUE); } /* --------------------------------------------------------------------------------------------- */ void -filtered_view_cmd (void) +view_filtered_cmd (void) { char *command; const char *initial_command; @@ -975,7 +977,7 @@ reread_cmd (void) /* --------------------------------------------------------------------------------------------- */ void -reverse_selection_cmd (void) +select_invert_cmd (void) { int i; file_entry *file; @@ -1142,11 +1144,11 @@ edit_fhl_cmd (void) /* --------------------------------------------------------------------------------------------- */ void -quick_chdir_cmd (void) +hotlist_cmd (void) { char *target; - target = hotlist_cmd (LIST_HOTLIST); + target = hotlist_show (LIST_HOTLIST); if (!target) return; @@ -1163,11 +1165,11 @@ quick_chdir_cmd (void) #ifdef ENABLE_VFS void -reselect_vfs (void) +vfs_list (void) { char *target; - target = hotlist_cmd (LIST_VFSLIST); + target = hotlist_show (LIST_VFSLIST); if (!target) return; @@ -1224,15 +1226,6 @@ diff_view_cmd (void) /* --------------------------------------------------------------------------------------------- */ -void -history_cmd (void) -{ - /* show the history of command line widget */ - send_message (&cmdline->widget, WIDGET_COMMAND, CK_InputHistoryShow); -} - -/* --------------------------------------------------------------------------------------------- */ - void swap_cmd (void) { @@ -1518,7 +1511,7 @@ single_dirsize_cmd (void) } if (panels_options.mark_moves_down) - send_message ((Widget *) panel, WIDGET_COMMAND, CK_PanelMoveDown); + send_message ((Widget *) panel, WIDGET_COMMAND, CK_Down); recalculate_panel_summary (panel); @@ -1636,7 +1629,7 @@ change_listing_cmd (void) /* --------------------------------------------------------------------------------------------- */ void -tree_cmd (void) +panel_tree_cmd (void) { set_display_type (MENU_PANEL_IDX, view_tree); } diff --git a/src/filemanager/cmd.h b/src/filemanager/cmd.h index c397850c1..e757727a4 100644 --- a/src/filemanager/cmd.h +++ b/src/filemanager/cmd.h @@ -53,8 +53,8 @@ int view_file_at_line (const char *filename, int plain_view, int internal, int s int view_file (const char *filename, int normal, int internal); void view_cmd (void); void view_file_cmd (void); -void view_simple_cmd (void); -void filtered_view_cmd (void); +void view_raw_cmd (void); +void view_filtered_cmd (void); void do_edit_at_line (const char *what, gboolean internal, int start_line); void edit_cmd (void); void edit_cmd_new (void); @@ -71,18 +71,17 @@ void delete_cmd_local (void); void find_cmd (void); void filter_cmd (void); void reread_cmd (void); -void reselect_vfs (void); +void vfs_list (void); void ext_cmd (void); void edit_mc_menu_cmd (void); void edit_fhl_cmd (void); -void quick_chdir_cmd (void); +void hotlist_cmd (void); void compare_dirs_cmd (void); void diff_view_cmd (void); -void history_cmd (void); -void tree_cmd (void); +void panel_tree_cmd (void); void link_cmd (link_type_t link_type); void edit_symlink_cmd (void); -void reverse_selection_cmd (void); +void select_invert_cmd (void); void unselect_cmd (void); void select_cmd (void); void swap_cmd (void); diff --git a/src/filemanager/hotlist.c b/src/filemanager/hotlist.c index aba978aee..30db4e2a0 100644 --- a/src/filemanager/hotlist.c +++ b/src/filemanager/hotlist.c @@ -1707,7 +1707,7 @@ add2hotlist_cmd (void) /* --------------------------------------------------------------------------------------------- */ char * -hotlist_cmd (int vfs_or_hotlist) +hotlist_show (int vfs_or_hotlist) { char *target = NULL; diff --git a/src/filemanager/hotlist.h b/src/filemanager/hotlist.h index 5c3cb0e2b..18135be9a 100644 --- a/src/filemanager/hotlist.h +++ b/src/filemanager/hotlist.h @@ -20,7 +20,7 @@ /*** declarations of public functions ************************************************************/ void add2hotlist_cmd (void); -char *hotlist_cmd (int list_vfs); +char *hotlist_show (int list_vfs); int save_hotlist (void); void done_hotlist (void); diff --git a/src/filemanager/midnight.c b/src/filemanager/midnight.c index f99774ce1..169b893ca 100644 --- a/src/filemanager/midnight.c +++ b/src/filemanager/midnight.c @@ -193,33 +193,32 @@ create_panel_menu (void) { GList *entries = NULL; - entries = g_list_append (entries, menu_entry_create (_("File listin&g"), CK_ListingCmd)); - entries = g_list_append (entries, menu_entry_create (_("&Quick view"), CK_QuickViewCmd)); - entries = g_list_append (entries, menu_entry_create (_("&Info"), CK_InfoCmd)); - entries = g_list_append (entries, menu_entry_create (_("&Tree"), CK_TreeCmd)); + entries = g_list_append (entries, menu_entry_create (_("File listin&g"), CK_PanelListing)); + entries = g_list_append (entries, menu_entry_create (_("&Quick view"), CK_PanelQuickView)); + entries = g_list_append (entries, menu_entry_create (_("&Info"), CK_PanelInfo)); + entries = g_list_append (entries, menu_entry_create (_("&Tree"), CK_PanelTree)); entries = g_list_append (entries, menu_separator_create ()); entries = - g_list_append (entries, menu_entry_create (_("&Listing mode..."), CK_ChangeListingCmd)); + g_list_append (entries, menu_entry_create (_("&Listing mode..."), CK_PanelListingChange)); entries = g_list_append (entries, menu_entry_create (_("&Sort order..."), CK_Sort)); - entries = g_list_append (entries, menu_entry_create (_("&Filter..."), CK_FilterCmd)); + entries = g_list_append (entries, menu_entry_create (_("&Filter..."), CK_Filter)); #ifdef HAVE_CHARSET - entries = - g_list_append (entries, menu_entry_create (_("&Encoding..."), CK_PanelSetPanelEncoding)); + entries = g_list_append (entries, menu_entry_create (_("&Encoding..."), CK_SelectCodepage)); #endif #ifdef ENABLE_VFS_NET entries = g_list_append (entries, menu_separator_create ()); #ifdef ENABLE_VFS_FTP - entries = g_list_append (entries, menu_entry_create (_("FT&P link..."), CK_FtplinkCmd)); + entries = g_list_append (entries, menu_entry_create (_("FT&P link..."), CK_ConnectFtp)); #endif #ifdef ENABLE_VFS_FISH - entries = g_list_append (entries, menu_entry_create (_("S&hell link..."), CK_FishlinkCmd)); + entries = g_list_append (entries, menu_entry_create (_("S&hell link..."), CK_ConnectFish)); #endif #ifdef ENABLE_VFS_SMB - entries = g_list_append (entries, menu_entry_create (_("SM&B link..."), CK_SmblinkCmd)); + entries = g_list_append (entries, menu_entry_create (_("SM&B link..."), CK_ConnectSmb)); #endif #endif /* ENABLE_VFS_NET */ entries = g_list_append (entries, menu_separator_create ()); - entries = g_list_append (entries, menu_entry_create (_("&Rescan"), CK_RereadCmd)); + entries = g_list_append (entries, menu_entry_create (_("&Rescan"), CK_Reread)); return entries; } @@ -231,32 +230,31 @@ create_file_menu (void) { GList *entries = NULL; - entries = g_list_append (entries, menu_entry_create (_("&View"), CK_ViewCmd)); - entries = g_list_append (entries, menu_entry_create (_("Vie&w file..."), CK_ViewFileCmd)); - entries = g_list_append (entries, menu_entry_create (_("&Filtered view"), CK_FilteredViewCmd)); - entries = g_list_append (entries, menu_entry_create (_("&Edit"), CK_EditCmd)); - entries = g_list_append (entries, menu_entry_create (_("&Copy"), CK_CopyCmd)); - entries = g_list_append (entries, menu_entry_create (_("C&hmod"), CK_ChmodCmd)); - entries = g_list_append (entries, menu_entry_create (_("&Link"), CK_LinkCmd)); - entries = g_list_append (entries, menu_entry_create (_("&Symlink"), CK_SymlinkCmd)); - entries = - g_list_append (entries, menu_entry_create (_("Relative symlin&k"), CK_RelativeSymlinkCmd)); - entries = g_list_append (entries, menu_entry_create (_("Edit s&ymlink"), CK_EditSymlinkCmd)); - entries = g_list_append (entries, menu_entry_create (_("Ch&own"), CK_ChownCmd)); - entries = - g_list_append (entries, menu_entry_create (_("&Advanced chown"), CK_ChownAdvancedCmd)); - entries = g_list_append (entries, menu_entry_create (_("&Rename/Move"), CK_RenameCmd)); - entries = g_list_append (entries, menu_entry_create (_("&Mkdir"), CK_MkdirCmd)); - entries = g_list_append (entries, menu_entry_create (_("&Delete"), CK_DeleteCmd)); - entries = g_list_append (entries, menu_entry_create (_("&Quick cd"), CK_QuickCdCmd)); - entries = g_list_append (entries, menu_separator_create ()); - entries = g_list_append (entries, menu_entry_create (_("Select &group"), CK_SelectCmd)); - entries = g_list_append (entries, menu_entry_create (_("U&nselect group"), CK_UnselectCmd)); + entries = g_list_append (entries, menu_entry_create (_("&View"), CK_View)); + entries = g_list_append (entries, menu_entry_create (_("Vie&w file..."), CK_ViewFile)); + entries = g_list_append (entries, menu_entry_create (_("&Filtered view"), CK_ViewFiltered)); + entries = g_list_append (entries, menu_entry_create (_("&Edit"), CK_Edit)); + entries = g_list_append (entries, menu_entry_create (_("&Copy"), CK_Copy)); + entries = g_list_append (entries, menu_entry_create (_("C&hmod"), CK_ChangeMode)); + entries = g_list_append (entries, menu_entry_create (_("&Link"), CK_Link)); + entries = g_list_append (entries, menu_entry_create (_("&Symlink"), CK_LinkSymbolic)); entries = g_list_append (entries, - menu_entry_create (_("Reverse selec&tion"), CK_ReverseSelectionCmd)); + menu_entry_create (_("Relative symlin&k"), CK_LinkSymbolicRelative)); + entries = g_list_append (entries, menu_entry_create (_("Edit s&ymlink"), CK_LinkSymbolicEdit)); + entries = g_list_append (entries, menu_entry_create (_("Ch&own"), CK_ChangeOwn)); + entries = + g_list_append (entries, menu_entry_create (_("&Advanced chown"), CK_ChangeOwnAdvanced)); + entries = g_list_append (entries, menu_entry_create (_("&Rename/Move"), CK_Move)); + entries = g_list_append (entries, menu_entry_create (_("&Mkdir"), CK_MakeDir)); + entries = g_list_append (entries, menu_entry_create (_("&Delete"), CK_Delete)); + entries = g_list_append (entries, menu_entry_create (_("&Quick cd"), CK_CdQuick)); entries = g_list_append (entries, menu_separator_create ()); - entries = g_list_append (entries, menu_entry_create (_("E&xit"), CK_QuitCmd)); + entries = g_list_append (entries, menu_entry_create (_("Select &group"), CK_Select)); + entries = g_list_append (entries, menu_entry_create (_("U&nselect group"), CK_Unselect)); + entries = g_list_append (entries, menu_entry_create (_("&Invert selection"), CK_SelectInvert)); + entries = g_list_append (entries, menu_separator_create ()); + entries = g_list_append (entries, menu_entry_create (_("E&xit"), CK_Quit)); return entries; } @@ -272,52 +270,49 @@ create_command_menu (void) */ GList *entries = NULL; - entries = g_list_append (entries, menu_entry_create (_("&User menu"), CK_UserMenuCmd)); - entries = g_list_append (entries, menu_entry_create (_("&Directory tree"), CK_TreeBoxCmd)); - entries = g_list_append (entries, menu_entry_create (_("&Find file"), CK_FindCmd)); - entries = g_list_append (entries, menu_entry_create (_("S&wap panels"), CK_SwapCmd)); + entries = g_list_append (entries, menu_entry_create (_("&User menu"), CK_UserMenu)); + entries = g_list_append (entries, menu_entry_create (_("&Directory tree"), CK_Tree)); + entries = g_list_append (entries, menu_entry_create (_("&Find file"), CK_Find)); + entries = g_list_append (entries, menu_entry_create (_("S&wap panels"), CK_Swap)); + entries = g_list_append (entries, menu_entry_create (_("Switch &panels on/off"), CK_Shell)); entries = - g_list_append (entries, menu_entry_create (_("Switch &panels on/off"), CK_ShowCommandLine)); - entries = - g_list_append (entries, menu_entry_create (_("&Compare directories"), CK_CompareDirsCmd)); + g_list_append (entries, menu_entry_create (_("&Compare directories"), CK_CompareDirs)); #ifdef USE_DIFF_VIEW - entries = g_list_append (entries, menu_entry_create (_("&View diff files"), CK_DiffViewCmd)); + entries = g_list_append (entries, menu_entry_create (_("C&ompare files"), CK_CompareFiles)); #endif entries = g_list_append (entries, menu_entry_create (_("E&xternal panelize"), CK_ExternalPanelize)); - entries = - g_list_append (entries, - menu_entry_create (_("Show directory s&izes"), CK_SingleDirsizeCmd)); + entries = g_list_append (entries, menu_entry_create (_("Show directory s&izes"), CK_DirSize)); entries = g_list_append (entries, menu_separator_create ()); - entries = g_list_append (entries, menu_entry_create (_("Command &history"), CK_HistoryCmd)); - entries = - g_list_append (entries, menu_entry_create (_("Di&rectory hotlist"), CK_QuickChdirCmd)); + entries = g_list_append (entries, menu_entry_create (_("Command &history"), CK_History)); + entries = g_list_append (entries, menu_entry_create (_("Di&rectory hotlist"), CK_HotList)); #ifdef ENABLE_VFS - entries = g_list_append (entries, menu_entry_create (_("&Active VFS list"), CK_ReselectVfs)); + entries = g_list_append (entries, menu_entry_create (_("&Active VFS list"), CK_VfsList)); #endif #ifdef WITH_BACKGROUND - entries = g_list_append (entries, menu_entry_create (_("&Background jobs"), CK_JobsCmd)); + entries = g_list_append (entries, menu_entry_create (_("&Background jobs"), CK_Jobs)); #endif - entries = g_list_append (entries, menu_entry_create (_("Screen lis&t"), CK_DialogListCmd)); + entries = g_list_append (entries, menu_entry_create (_("Screen lis&t"), CK_ScreenList)); entries = g_list_append (entries, menu_separator_create ()); #ifdef ENABLE_VFS_UNDELFS entries = g_list_append (entries, - menu_entry_create (_("&Undelete files (ext2fs only)"), CK_UndeleteCmd)); + menu_entry_create (_("&Undelete files (ext2fs only)"), CK_Undelete)); #endif #ifdef LISTMODE_EDITOR - entries = - g_list_append (entries, menu_entry_create (_("&Listing format edit"), CK_ListmodeCmd)); + entries = g_list_append (entries, menu_entry_create (_("&Listing format edit"), CK_ListMode)); #endif #if defined (ENABLE_VFS_UNDELFS) || defined (LISTMODE_EDITOR) entries = g_list_append (entries, menu_separator_create ()); #endif entries = - g_list_append (entries, menu_entry_create (_("Edit &extension file"), CK_EditExtFileCmd)); - entries = g_list_append (entries, menu_entry_create (_("Edit &menu file"), CK_EditMcMenuCmd)); + g_list_append (entries, + menu_entry_create (_("Edit &extension file"), CK_EditExtensionsFile)); + entries = g_list_append (entries, menu_entry_create (_("Edit &menu file"), CK_EditUserMenu)); entries = g_list_append (entries, - menu_entry_create (_("Edit hi&ghlighting group file"), CK_EditFhlFileCmd)); + menu_entry_create (_("Edit hi&ghlighting group file"), + CK_EditFileHighlightFile)); return entries; } @@ -329,18 +324,18 @@ create_options_menu (void) { GList *entries = NULL; - entries = g_list_append (entries, menu_entry_create (_("&Configuration..."), CK_ConfigureBox)); - entries = g_list_append (entries, menu_entry_create (_("&Layout..."), CK_LayoutBox)); + entries = g_list_append (entries, menu_entry_create (_("&Configuration..."), CK_Options)); + entries = g_list_append (entries, menu_entry_create (_("&Layout..."), CK_OptionsLayout)); + entries = g_list_append (entries, menu_entry_create (_("&Panel options..."), CK_OptionsPanel)); + entries = g_list_append (entries, menu_entry_create (_("C&onfirmation..."), CK_OptionsConfirm)); entries = - g_list_append (entries, menu_entry_create (_("&Panel options..."), CK_PanelOptionsBox)); - entries = g_list_append (entries, menu_entry_create (_("C&onfirmation..."), CK_ConfirmBox)); - entries = g_list_append (entries, menu_entry_create (_("&Display bits..."), CK_DisplayBitsBox)); + g_list_append (entries, menu_entry_create (_("&Display bits..."), CK_OptionsDisplayBits)); entries = g_list_append (entries, menu_entry_create (_("Learn &keys..."), CK_LearnKeys)); #ifdef ENABLE_VFS - entries = g_list_append (entries, menu_entry_create (_("&Virtual FS..."), CK_ConfigureVfs)); + entries = g_list_append (entries, menu_entry_create (_("&Virtual FS..."), CK_OptionsVfs)); #endif entries = g_list_append (entries, menu_separator_create ()); - entries = g_list_append (entries, menu_entry_create (_("&Save setup"), CK_SaveSetupCmd)); + entries = g_list_append (entries, menu_entry_create (_("&Save setup"), CK_SaveSetup)); return entries; } @@ -420,7 +415,7 @@ midnight_get_shortcut (unsigned long command) if (shortcut != NULL) return g_strdup (shortcut); - ext_map = keybind_lookup_keymap_shortcut (main_map, CK_StartExtMap1); + ext_map = keybind_lookup_keymap_shortcut (main_map, CK_ExtendedKeyMap); if (ext_map != NULL) shortcut = keybind_lookup_keymap_shortcut (main_x_map, command); if (shortcut != NULL) @@ -570,7 +565,7 @@ create_panels (void) /* --------------------------------------------------------------------------------------------- */ static void -copy_current_pathname (void) +put_current_path (void) { char *cwd_path; if (!command_prompt) @@ -587,7 +582,7 @@ copy_current_pathname (void) /* --------------------------------------------------------------------------------------------- */ static void -copy_other_pathname (void) +put_other_path (void) { char *cwd_path; @@ -608,21 +603,22 @@ copy_other_pathname (void) /* --------------------------------------------------------------------------------------------- */ static void -copy_readlink (WPanel * panel) +put_link (WPanel * panel) { if (!command_prompt) return; if (S_ISLNK (selection (panel)->st.st_mode)) { char buffer[MC_MAXPATHLEN]; - char *p = concat_dir_and_file (panel->cwd, selection (panel)->fname); + char *p; int i; + p = concat_dir_and_file (panel->cwd, selection (panel)->fname); i = mc_readlink (p, buffer, MC_MAXPATHLEN - 1); g_free (p); if (i > 0) { - buffer[i] = 0; + buffer[i] = '\0'; command_insert (cmdline, buffer, TRUE); } } @@ -631,25 +627,25 @@ copy_readlink (WPanel * panel) /* --------------------------------------------------------------------------------------------- */ static void -copy_current_readlink (void) +put_current_link (void) { - copy_readlink (current_panel); + put_link (current_panel); } /* --------------------------------------------------------------------------------------------- */ static void -copy_other_readlink (void) +put_other_link (void) { if (get_other_type () == view_listing) - copy_readlink (other_panel); + put_link (other_panel); } /* --------------------------------------------------------------------------------------------- */ /** Insert the selected file name into the input line */ static void -copy_prog_name (void) +put_prog_name (void) { char *tmp; if (!command_prompt) @@ -669,7 +665,7 @@ copy_prog_name (void) /* --------------------------------------------------------------------------------------------- */ static void -copy_tagged (WPanel * panel) +put_tagged (WPanel * panel) { int i; @@ -694,18 +690,18 @@ copy_tagged (WPanel * panel) /* --------------------------------------------------------------------------------------------- */ static void -copy_current_tagged (void) +put_current_tagged (void) { - copy_tagged (current_panel); + put_tagged (current_panel); } /* --------------------------------------------------------------------------------------------- */ static void -copy_other_tagged (void) +put_other_tagged (void) { if (get_other_type () == view_listing) - copy_tagged (other_panel); + put_tagged (other_panel); } /* --------------------------------------------------------------------------------------------- */ @@ -1024,264 +1020,265 @@ midnight_execute_cmd (Widget * sender, unsigned long command) (void) sender; /* stop quick search before executing any command */ - send_message ((Widget *) current_panel, WIDGET_COMMAND, CK_PanelStopSearch); + send_message ((Widget *) current_panel, WIDGET_COMMAND, CK_SearchStop); switch (command) { - case CK_AddHotlist: + case CK_HotListAdd: add2hotlist_cmd (); break; - case CK_ChangeListingCmd: + case CK_PanelListingChange: change_listing_cmd (); break; - case CK_ChmodCmd: + case CK_ChangeMode: chmod_cmd (); break; - case CK_ChownCmd: + case CK_ChangeOwn: chown_cmd (); break; - case CK_ChownAdvancedCmd: + case CK_ChangeOwnAdvanced: chown_advanced_cmd (); break; - case CK_CompareDirsCmd: + case CK_CompareDirs: compare_dirs_cmd (); break; - case CK_ConfigureBox: + case CK_Options: configure_box (); break; #ifdef ENABLE_VFS - case CK_ConfigureVfs: + case CK_OptionsVfs: configure_vfs (); break; #endif - case CK_ConfirmBox: + case CK_OptionsConfirm: confirm_box (); break; - case CK_CopyCmd: + case CK_Copy: copy_cmd (); break; - case CK_CopyCurrentPathname: - copy_current_pathname (); + case CK_PutCurrentPath: + put_current_path (); break; - case CK_CopyCurrentReadlink: - copy_current_readlink (); + case CK_PutCurrentLink: + put_current_link (); break; - case CK_CopyCurrentTagged: - copy_current_tagged (); + case CK_PutCurrentTagged: + put_current_tagged (); break; - case CK_CopyOtherPathname: - copy_other_pathname (); + case CK_PutOtherPath: + put_other_path (); break; - case CK_CopyOtherReadlink: - copy_other_readlink (); + case CK_PutOtherLink: + put_other_link (); break; - case CK_CopyOtherTagged: - copy_other_tagged (); + case CK_PutOtherTagged: + put_other_tagged (); break; - case CK_DeleteCmd: + case CK_Delete: delete_cmd (); break; - case CK_DialogListCmd: + case CK_ScreenList: dialog_switch_list (); break; #ifdef USE_DIFF_VIEW - case CK_DiffViewCmd: + case CK_CompareFiles: diff_view_cmd (); break; #endif - case CK_DisplayBitsBox: + case CK_OptionsDisplayBits: display_bits_box (); break; - case CK_EditCmd: + case CK_Edit: edit_cmd (); break; #ifdef USE_INTERNAL_EDIT - case CK_EditForceInternalCmd: + case CK_EditForceInternal: edit_cmd_force_internal (); break; #endif - case CK_EditExtFileCmd: + case CK_EditExtensionsFile: ext_cmd (); break; - case CK_EditFhlFileCmd: + case CK_EditFileHighlightFile: edit_fhl_cmd (); break; - case CK_EditMcMenuCmd: + case CK_EditUserMenu: edit_mc_menu_cmd (); break; - case CK_EditSymlinkCmd: + case CK_LinkSymbolicEdit: edit_symlink_cmd (); break; case CK_ExternalPanelize: external_panelize (); break; - case CK_FilterCmd: + case CK_Filter: filter_cmd (); break; - case CK_FilteredViewCmd: - filtered_view_cmd (); + case CK_ViewFiltered: + view_filtered_cmd (); break; - case CK_FindCmd: + case CK_Find: find_cmd (); break; #ifdef ENABLE_VFS_FISH - case CK_FishlinkCmd: + case CK_ConnectFish: fishlink_cmd (); break; #endif #ifdef ENABLE_VFS_FTP - case CK_FtplinkCmd: + case CK_ConnectFtp: ftplink_cmd (); break; #endif - case CK_HelpCmd: +#ifdef ENABLE_VFS_SMB + case CK_ConnectSmb: + smblink_cmd (); + break; +#endif /* ENABLE_VFS_SMB */ + case CK_Help: help_cmd (); break; - case CK_HistoryCmd: - history_cmd (); + case CK_History: + /* show the history of command line widget */ + send_message (&cmdline->widget, WIDGET_COMMAND, CK_History); break; - case CK_InfoCmd: + case CK_PanelInfo: if (sender == (Widget *) the_menubar) - info_cmd (); /* mwnu */ + info_cmd (); /* menu */ else info_cmd_no_menu (); /* shortcut or buttonbar */ break; #ifdef WITH_BACKGROUND - case CK_JobsCmd: + case CK_Jobs: jobs_cmd (); break; #endif - case CK_LayoutBox: + case CK_OptionsLayout: layout_box (); break; case CK_LearnKeys: learn_keys (); break; - case CK_LinkCmd: + case CK_Link: link_cmd (LINK_HARDLINK); break; - case CK_ListingCmd: + case CK_PanelListing: listing_cmd (); break; #ifdef LISTMODE_EDITOR - case CK_ListmodeCmd: + case CK_ListMode: listmode_cmd (); break; #endif - case CK_MenuCmd: + case CK_Menu: menu_cmd (); break; - case CK_MenuLastSelectedCmd: + case CK_MenuLastSelected: menu_last_selected_cmd (); break; - case CK_MkdirCmd: + case CK_MakeDir: mkdir_cmd (); break; - case CK_PanelOptionsBox: + case CK_OptionsPanel: panel_options_box (); break; #ifdef HAVE_CHARSET - case CK_PanelSetPanelEncoding: + case CK_SelectCodepage: encoding_cmd (); break; #endif - case CK_QuickCdCmd: + case CK_CdQuick: quick_cd_cmd (); break; - case CK_QuickChdirCmd: - quick_chdir_cmd (); + case CK_HotList: + hotlist_cmd (); break; - case CK_QuickViewCmd: + case CK_PanelQuickView: if (sender == (Widget *) the_menubar) quick_view_cmd (); /* menu */ else quick_cmd_no_menu (); /* shortcut or buttonabr */ break; - case CK_QuietQuitCmd: + case CK_QuitQuiet: quiet_quit_cmd (); break; - case CK_QuitCmd: + case CK_Quit: quit_cmd (); break; - case CK_RelativeSymlinkCmd: + case CK_LinkSymbolicRelative: link_cmd (LINK_SYMLINK_RELATIVE); break; - case CK_RenameCmd: + case CK_Move: rename_cmd (); break; - case CK_RereadCmd: + case CK_Reread: reread_cmd (); break; #ifdef ENABLE_VFS - case CK_ReselectVfs: - reselect_vfs (); + case CK_VfsList: + vfs_list (); break; #endif - case CK_ReverseSelectionCmd: - reverse_selection_cmd (); + case CK_SelectInvert: + select_invert_cmd (); break; - case CK_SaveSetupCmd: + case CK_SaveSetup: save_setup_cmd (); break; - case CK_SelectCmd: + case CK_Select: select_cmd (); break; - case CK_ShowCommandLine: + case CK_Shell: view_other_cmd (); break; - case CK_SingleDirsizeCmd: + case CK_DirSize: smart_dirsize_cmd (); break; -#ifdef ENABLE_VFS_SMB - case CK_SmblinkCmd: - smblink_cmd (); - break; -#endif /* ENABLE_VFS_SMB */ case CK_Sort: sort_cmd (); break; - case CK_StartExtMap1: + case CK_ExtendedKeyMap: ctl_x_cmd (); break; - case CK_SuspendCmd: + case CK_Suspend: suspend_cmd (); break; - case CK_SwapCmd: + case CK_Swap: swap_cmd (); break; - case CK_SymlinkCmd: + case CK_LinkSymbolic: link_cmd (LINK_SYMLINK_ABSOLUTE); break; - case CK_ToggleListingCmd: + case CK_PanelListingSwitch: toggle_listing_cmd (); break; - case CK_ToggleShowHidden: + case CK_ShowHidden: toggle_show_hidden (); break; - case CK_TogglePanelsSplit: + case CK_SplitVertHoriz: toggle_panels_split (); break; - case CK_TreeCmd: - tree_cmd (); + case CK_PanelTree: + panel_tree_cmd (); break; - case CK_TreeBoxCmd: + case CK_Tree: treebox_cmd (); break; #ifdef ENABLE_VFS_UNDELFS - case CK_UndeleteCmd: + case CK_Undelete: undelete_cmd (); break; #endif - case CK_UnselectCmd: + case CK_Unselect: unselect_cmd (); break; - case CK_UserMenuCmd: + case CK_UserMenu: user_file_menu_cmd (); break; - case CK_ViewCmd: + case CK_View: view_cmd (); break; - case CK_ViewFileCmd: + case CK_ViewFile: view_file_cmd (); break; default: @@ -1329,7 +1326,7 @@ midnight_callback (Dlg_head * h, Widget * sender, dlg_msg_t msg, int parm, void dlg_select_widget (get_panel_widget (1)); if (auto_menu) - midnight_execute_cmd (NULL, CK_UserMenuCmd); + midnight_execute_cmd (NULL, CK_UserMenu); return MSG_HANDLED; case DLG_KEY: @@ -1369,15 +1366,15 @@ midnight_callback (Dlg_head * h, Widget * sender, dlg_msg_t msg, int parm, void /* Ctrl-Enter and Alt-Enter */ if (((parm & ~(KEY_M_CTRL | KEY_M_ALT)) == '\n') && (parm & (KEY_M_CTRL | KEY_M_ALT))) { - copy_prog_name (); + put_prog_name (); return MSG_HANDLED; } /* Ctrl-Shift-Enter */ if (parm == (KEY_M_CTRL | KEY_M_SHIFT | '\n')) { - copy_current_pathname (); - copy_prog_name (); + put_current_path (); + put_prog_name (); return MSG_HANDLED; } @@ -1401,7 +1398,7 @@ midnight_callback (Dlg_head * h, Widget * sender, dlg_msg_t msg, int parm, void if (parm == '*') { - reverse_selection_cmd (); + select_invert_cmd (); return MSG_HANDLED; } } @@ -1425,7 +1422,7 @@ midnight_callback (Dlg_head * h, Widget * sender, dlg_msg_t msg, int parm, void if (parm == '*') { - reverse_selection_cmd (); + select_invert_cmd (); return MSG_HANDLED; } } @@ -1436,7 +1433,7 @@ midnight_callback (Dlg_head * h, Widget * sender, dlg_msg_t msg, int parm, void if ((get_current_type () == view_listing) && current_panel->searching) { current_panel->dirty = 1; /* FIXME: unneeded? */ - send_message ((Widget *) current_panel, WIDGET_COMMAND, CK_PanelStopSearch); + send_message ((Widget *) current_panel, WIDGET_COMMAND, CK_SearchStop); } return MSG_HANDLED; diff --git a/src/filemanager/panel.c b/src/filemanager/panel.c index 92f35dfbf..86b87f805 100644 --- a/src/filemanager/panel.c +++ b/src/filemanager/panel.c @@ -2319,7 +2319,7 @@ chdir_other_panel (WPanel * panel) */ static void -sync_other_panel (WPanel * panel) +panel_sync_other (const WPanel * panel) { if (get_other_type () != view_listing) { @@ -2718,138 +2718,140 @@ panel_execute_cmd (WPanel * panel, unsigned long command) { int res = MSG_HANDLED; - if (command != CK_PanelStartSearch) + if (command != CK_Search) stop_search (panel); switch (command) { - case CK_PanelChdirOtherPanel: + case CK_PanelOtherCd: chdir_other_panel (panel); break; - case CK_PanelChdirToReadlink: + case CK_PanelOtherCdLink: chdir_to_readlink (panel); break; - case CK_PanelCmdCopyLocal: + case CK_CopySingle: copy_cmd_local (); break; - case CK_PanelCmdDeleteLocal: + case CK_DeleteSingle: delete_cmd_local (); break; - case CK_PanelCmdDoEnter: + case CK_Enter: do_enter (panel); break; - case CK_PanelCmdViewSimple: - view_simple_cmd (); + case CK_ViewRaw: + view_raw_cmd (); break; - case CK_PanelCmdEditNew: + case CK_EditNew: edit_cmd_new (); break; - case CK_PanelCmdRenameLocal: + case CK_MoveSingle: rename_cmd_local (); break; - case CK_PanelCmdReverseSelection: - reverse_selection_cmd (); + case CK_SelectInvert: + select_invert_cmd (); break; - case CK_PanelCmdSelect: + case CK_Select: select_cmd (); break; - case CK_PanelCmdUnselect: + case CK_Unselect: unselect_cmd (); break; - case CK_PanelNextPage: + case CK_PageDown: next_page (panel); break; - case CK_PanelPrevPage: + case CK_PageUp: prev_page (panel); break; - case CK_PanelGotoChildDir: + case CK_CdChild: goto_child_dir (panel); break; - case CK_PanelGotoParentDir: + case CK_CdParent: goto_parent_dir (panel); break; - case CK_PanelDirectoryHistoryList: + case CK_History: directory_history_list (panel); break; - case CK_PanelDirectoryHistoryNext: + case CK_HistoryNext: directory_history_next (panel); break; - case CK_PanelDirectoryHistoryPrev: + case CK_HistoryPrev: directory_history_prev (panel); break; - case CK_PanelGotoBottomFile: + case CK_BottomOnScreen: goto_bottom_file (panel); break; - case CK_PanelGotoMiddleFile: + case CK_MiddleOnScreen: goto_middle_file (panel); break; - case CK_PanelGotoTopFile: + case CK_TopOnScreen: goto_top_file (panel); break; - case CK_PanelMarkFile: + case CK_Mark: mark_file (panel); break; - case CK_PanelMarkFileUp: + case CK_MarkUp: mark_file_up (panel); break; - case CK_PanelMarkFileDown: + case CK_MarkDown: mark_file_down (panel); break; - case CK_PanelSmartGotoParentDir: + case CK_CdParentSmart: res = force_maybe_cd (); break; - case CK_PanelMoveUp: + case CK_Up: move_up (panel); break; - case CK_PanelMoveDown: + case CK_Down: move_down (panel); break; - case CK_PanelMoveLeft: + case CK_Left: res = move_left (panel); break; - case CK_PanelMoveRight: + case CK_Right: res = move_right (panel); break; - case CK_PanelMoveEnd: + case CK_Bottom: move_end (panel); break; - case CK_PanelMoveHome: + case CK_Top: move_home (panel); break; - case CK_PanelSetPanelEncoding: +#ifdef HAVE_CHARSET + case CK_SelectCodepage: panel_change_encoding (panel); break; - case CK_PanelStartSearch: +#endif + case CK_Search: start_search (panel); break; - case CK_PanelStopSearch: + case CK_SearchStop: break; - case CK_PanelSyncOtherPanel: - sync_other_panel (panel); + case CK_PanelOtherSync: + panel_sync_other (panel); break; - case CK_PanelSelectSortOrder: + case CK_Sort: panel_select_sort_order (panel); break; - case CK_PanelToggleSortOrderPrev: + case CK_SortPrev: panel_toggle_sort_order_prev (panel); break; - case CK_PanelToggleSortOrderNext: + case CK_SortNext: panel_toggle_sort_order_next (panel); break; - case CK_PanelReverseSort: + case CK_SortReverse: panel->sort_info.reverse = !panel->sort_info.reverse; panel_set_sort_order (panel, panel->sort_info.sort_field); break; - case CK_PanelSortOrderByName: + case CK_SortByName: panel_set_sort_type_by_id (panel, "name"); break; - case CK_PanelSortOrderByExt: + case CK_SortByExt: panel_set_sort_type_by_id (panel, "extension"); break; - case CK_PanelSortOrderBySize: + case CK_SortBySize: panel_set_sort_type_by_id (panel, "size"); break; - case CK_PanelSortOrderByMTime: + case CK_SortByMTime: panel_set_sort_type_by_id (panel, "mtime"); break; } @@ -3091,7 +3093,7 @@ do_panel_event (Gpm_Event * event, WPanel * panel, gboolean * redir) if (event->x == panel->widget.cols - 5) { panel->widget.owner->callback (panel->widget.owner, NULL, - DLG_ACTION, CK_ToggleShowHidden, NULL); + DLG_ACTION, CK_ShowHidden, NULL); repaint_screen (); return MOU_NORMAL; } diff --git a/src/filemanager/tree.c b/src/filemanager/tree.c index 431c1be6b..40c2f3035 100644 --- a/src/filemanager/tree.c +++ b/src/filemanager/tree.c @@ -1016,54 +1016,54 @@ tree_execute_cmd (WTree * tree, unsigned long command) { cb_ret_t res = MSG_HANDLED; - if (command != CK_TreeStartSearch) + if (command != CK_Search) tree->searching = 0; switch (command) { - case CK_TreeHelp: + case CK_Help: interactive_display (NULL, "[Directory Tree]"); break; - case CK_TreeForget: + case CK_Forget: tree_forget (tree); break; - case CK_TreeToggleNav: + case CK_ToggleNavigation: tree_toggle_navig (tree); break; - case CK_TreeCopy: + case CK_Copy: tree_copy (tree, ""); break; - case CK_TreeMove: + case CK_Move: tree_move (tree, ""); break; - case CK_TreeMoveUp: + case CK_Up: tree_move_up (tree); break; - case CK_TreeMoveDown: + case CK_Down: tree_move_down (tree); break; - case CK_TreeMoveHome: + case CK_Top: tree_move_home (tree); break; - case CK_TreeMoveEnd: + case CK_Bottom: tree_move_end (tree); break; - case CK_TreeMovePgUp: + case CK_PageUp: tree_move_pgup (tree); break; - case CK_TreeMovePgDn: + case CK_PageDown: tree_move_pgdn (tree); break; - case CK_TreeOpen: + case CK_Enter: tree_chdir_sel (tree); break; - case CK_TreeRescan: + case CK_Reread: tree_rescan (tree); break; - case CK_TreeStartSearch: + case CK_Search: tree_start_search (tree); break; - case CK_TreeRemove: + case CK_Delete: tree_rmdir (tree); break; default: @@ -1086,9 +1086,9 @@ tree_key (WTree * tree, int key) if (key == tree_map[i].key) switch (tree_map[i].command) { - case CK_TreeMoveLeft: + case CK_Left: return tree_move_left (tree) ? MSG_HANDLED : MSG_NOT_HANDLED; - case CK_TreeMoveRight: + case CK_Right: return tree_move_right (tree) ? MSG_HANDLED : MSG_NOT_HANDLED; default: tree_execute_cmd (tree, tree_map[i].command); diff --git a/src/help.c b/src/help.c index 3a3ae3970..6fa619b9d 100644 --- a/src/help.c +++ b/src/help.c @@ -853,55 +853,55 @@ help_execute_cmd (unsigned long command) switch (command) { - case CK_HelpHelp: + case CK_Help: help_help (whelp); break; - case CK_HelpIndex: + case CK_Index: help_index (whelp); break; - case CK_HelpBack: + case CK_Back: help_back (whelp); break; - case CK_HelpMoveUp: + case CK_Up: help_prev_link (TRUE); break; - case CK_HelpMoveDown: + case CK_Down: help_next_link (TRUE); break; - case CK_HelpMovePgDn: + case CK_PageDown: move_forward (help_lines - 1); break; - case CK_HelpMovePgUp: + case CK_PageUp: move_backward (help_lines - 1); break; - case CK_HelpMoveHalfPgDn: + case CK_HalfPageDown: move_forward (help_lines / 2); break; - case CK_HelpMoveHalfPgUp: + case CK_HalfPageUp: move_backward (help_lines / 2); break; - case CK_HelpMoveTop: + case CK_Top: move_to_top (); break; - case CK_HelpMoveBottom: + case CK_Bottom: move_to_bottom (); break; - case CK_HelpSelectLink: + case CK_Enter: help_select_link (); break; - case CK_HelpNextLink: + case CK_LinkNext: help_next_link (FALSE); break; - case CK_HelpPrevLink: + case CK_LinkPrev: help_prev_link (FALSE); break; - case CK_HelpNextNode: + case CK_NodeNext: help_next_node (); break; - case CK_HelpPrevNode: + case CK_NodePrev: help_prev_node (); break; - case CK_HelpQuit: + case CK_Quit: dlg_stop (whelp); break; default: diff --git a/src/keybind-defaults.c b/src/keybind-defaults.c index 0f0734f81..a6bda692b 100644 --- a/src/keybind-defaults.c +++ b/src/keybind-defaults.c @@ -69,290 +69,297 @@ const global_keymap_t *diff_map; /* midnight */ const global_keymap_t default_main_map[] = { - {KEY_F (1), CK_HelpCmd, "F1"}, - {KEY_F (2), CK_UserMenuCmd, "F2"}, - {KEY_F (3), CK_ViewCmd, "F3"}, - {KEY_F (4), CK_EditCmd, "F4"}, - {KEY_F (5), CK_CopyCmd, "F5"}, - {KEY_F (6), CK_RenameCmd, "F6"}, - {KEY_F (7), CK_MkdirCmd, "F7"}, - {KEY_F (8), CK_DeleteCmd, "F8"}, - {KEY_F (9), CK_MenuCmd, "F9"}, - {KEY_F (10), CK_QuitCmd, "F10"}, - {KEY_F (13), CK_ViewFileCmd, "S-F3"}, - {KEY_F (19), CK_MenuLastSelectedCmd, "S-F9"}, - {KEY_F (20), CK_QuietQuitCmd, "S-10"}, - {ALT ('h'), CK_HistoryCmd, "M-h"}, - {XCTRL ('@'), CK_SingleDirsizeCmd, "C-Space"}, + {KEY_F (1), CK_Help, "F1"}, + {KEY_F (2), CK_UserMenu, "F2"}, + {KEY_F (3), CK_View, "F3"}, + {KEY_F (4), CK_Edit, "F4"}, + {KEY_F (5), CK_Copy, "F5"}, + {KEY_F (6), CK_Move, "F6"}, + {KEY_F (7), CK_MakeDir, "F7"}, + {KEY_F (8), CK_Delete, "F8"}, + {KEY_F (9), CK_Menu, "F9"}, + {KEY_F (10), CK_Quit, "F10"}, + {KEY_F (13), CK_ViewFile, "S-F3"}, + {KEY_F (19), CK_MenuLastSelected, "S-F9"}, + {KEY_F (20), CK_QuitQuiet, "S-10"}, + {ALT ('h'), CK_History, "M-h"}, + {XCTRL ('@'), CK_DirSize, "C-Space"}, /* Copy useful information to the command line */ - {ALT ('a'), CK_CopyCurrentPathname, "M-a"}, - {ALT ('A'), CK_CopyOtherPathname, "M-A"}, - {ALT ('c'), CK_QuickCdCmd, "M-c"}, + {ALT ('a'), CK_PutCurrentPath, "M-a"}, + {ALT ('A'), CK_PutOtherPath, "M-A"}, + {ALT ('c'), CK_CdQuick, "M-c"}, /* To access the directory hotlist */ - {XCTRL ('\\'), CK_QuickChdirCmd, "C-\\"}, + {XCTRL ('\\'), CK_HotList, "C-\\"}, /* Suspend */ - {XCTRL ('z'), CK_SuspendCmd, "C-z"}, + {XCTRL ('z'), CK_Suspend, "C-z"}, /* The filtered view command */ - {ALT ('!'), CK_FilteredViewCmd, "M-!"}, + {ALT ('!'), CK_ViewFiltered, "M-!"}, /* Find file */ - {ALT ('?'), CK_FindCmd, "M-?"}, + {ALT ('?'), CK_Find, "M-?"}, /* Panel refresh */ - {XCTRL ('r'), CK_RereadCmd, "C-r"}, - /* Toggle listing between long, user defined and full formats */ - {ALT ('t'), CK_ToggleListingCmd, "M-t"}, + {XCTRL ('r'), CK_Reread, "C-r"}, + /* Switch listing between long, user defined and full formats */ + {ALT ('t'), CK_PanelListingSwitch, "M-t"}, /* Swap panels */ - {XCTRL ('u'), CK_SwapCmd, "C-u"}, + {XCTRL ('u'), CK_Swap, "C-u"}, /* View output */ - {XCTRL ('o'), CK_ShowCommandLine, "C-o"}, - {ALT ('.'), CK_ToggleShowHidden, "M-."}, - {ALT (','), CK_TogglePanelsSplit, "M-,"}, - {XCTRL ('x'), CK_StartExtMap1, "C-x"}, + {XCTRL ('o'), CK_Shell, "C-o"}, + {ALT ('.'), CK_ShowHidden, "M-."}, + {ALT (','), CK_SplitVertHoriz, "M-,"}, + {XCTRL ('x'), CK_ExtendedKeyMap, "C-x"}, /* Select/unselect group */ - {KEY_KP_ADD, CK_SelectCmd, "+"}, - {KEY_KP_SUBTRACT, CK_UnselectCmd, "-"}, - {ALT ('*'), CK_ReverseSelectionCmd, "*"}, + {KEY_KP_ADD, CK_Select, "+"}, + {KEY_KP_SUBTRACT, CK_Unselect, "-"}, + {ALT ('*'), CK_SelectInvert, "*"}, - {ALT ('`'), CK_DialogListCmd, "M-`"}, - {ALT ('}'), CK_DialogNextCmd, "M-}"}, - {ALT ('{'), CK_DialogPrevCmd, "M-{"}, + {ALT ('`'), CK_ScreenList, "M-`"}, + {ALT ('}'), CK_ScreenNext, "M-}"}, + {ALT ('{'), CK_ScreenPrev, "M-{"}, {0, CK_Ignore_Key, ""} }; const global_keymap_t default_main_x_map[] = { - {'d', CK_CompareDirsCmd, "d"}, + {'d', CK_CompareDirs, "d"}, #ifdef USE_DIFF_VIEW - {XCTRL ('d'), CK_DiffViewCmd, "C-d"}, + {XCTRL ('d'), CK_CompareFiles, "C-d"}, #endif /* USE_DIFF_VIEW */ #ifdef ENABLE_VFS - {'a', CK_ReselectVfs, "a"}, + {'a', CK_VfsList, "a"}, #endif /* ENABLE_VFS */ - {'p', CK_CopyCurrentPathname, "p"}, - {XCTRL ('p'), CK_CopyOtherPathname, "C-p"}, - {'t', CK_CopyCurrentTagged, "t"}, - {XCTRL ('t'), CK_CopyOtherTagged, "C-t"}, - {'c', CK_ChmodCmd, "c"}, - {'o', CK_ChownCmd, "o"}, - {'r', CK_CopyCurrentReadlink, "r"}, - {XCTRL ('r'), CK_CopyOtherReadlink, "C-r"}, - {'l', CK_LinkCmd, "l"}, - {'s', CK_SymlinkCmd, "s"}, - {'v', CK_RelativeSymlinkCmd, "v"}, - {XCTRL ('s'), CK_EditSymlinkCmd, "C-s"}, - {'i', CK_InfoCmd, "i"}, - {'q', CK_QuickViewCmd, "q"}, - {'h', CK_AddHotlist, "h"}, + {'p', CK_PutCurrentPath, "p"}, + {XCTRL ('p'), CK_PutOtherPath, "C-p"}, + {'t', CK_PutCurrentTagged, "t"}, + {XCTRL ('t'), CK_PutOtherTagged, "C-t"}, + {'c', CK_ChangeMode, "c"}, + {'o', CK_ChangeOwn, "o"}, + {'r', CK_PutCurrentLink, "r"}, + {XCTRL ('r'), CK_PutOtherLink, "C-r"}, + {'l', CK_Link, "l"}, + {'s', CK_LinkSymbolic, "s"}, + {'v', CK_LinkSymbolicRelative, "v"}, + {XCTRL ('s'), CK_LinkSymbolicEdit, "C-s"}, + {'i', CK_PanelInfo, "i"}, + {'q', CK_PanelQuickView, "q"}, + {'h', CK_HotListAdd, "h"}, {'!', CK_ExternalPanelize, "!"}, #ifdef WITH_BACKGROUND - {'j', CK_JobsCmd, "j"}, + {'j', CK_Jobs, "j"}, #endif /* WITH_BACKGROUND */ {0, CK_Ignore_Key, ""} }; /* panel */ const global_keymap_t default_panel_keymap[] = { - {ALT ('o'), CK_PanelChdirOtherPanel, "M-o"}, - {ALT ('l'), CK_PanelChdirToReadlink, "M-l"}, - {KEY_F (15), CK_PanelCmdCopyLocal, "S-F5"}, - {KEY_F (18), CK_PanelCmdDeleteLocal, "S-F8"}, - {KEY_ENTER, CK_PanelCmdDoEnter, "Enter"}, - {'\n', CK_PanelCmdDoEnter, "Enter"}, - {KEY_F (14), CK_PanelCmdEditNew, "S-F4"}, - {KEY_F (16), CK_PanelCmdRenameLocal, "S-F6"}, - {ALT ('*'), CK_PanelCmdReverseSelection, "M-*"}, - {KEY_KP_ADD, CK_PanelCmdSelect, "M-+"}, - {KEY_KP_SUBTRACT, CK_PanelCmdUnselect, "M--"}, - {KEY_F (13), CK_PanelCmdViewSimple, "S-F3"}, - {KEY_M_CTRL | KEY_NPAGE, CK_PanelGotoChildDir, "C-PgDn"}, - {KEY_M_CTRL | KEY_PPAGE, CK_PanelGotoParentDir, "C-PgUp"}, - {ALT ('H'), CK_PanelDirectoryHistoryList, "M-H"}, - {ALT ('u'), CK_PanelDirectoryHistoryNext, "M-u"}, - {ALT ('y'), CK_PanelDirectoryHistoryPrev, "M-y"}, - {ALT ('j'), CK_PanelGotoBottomFile, "M-j"}, - {ALT ('r'), CK_PanelGotoMiddleFile, "M-r"}, - {ALT ('g'), CK_PanelGotoTopFile, "M-g"}, - {KEY_IC, CK_PanelMarkFile, "Insert"}, - {KEY_UP, CK_PanelMoveUp, "Up"}, - {KEY_DOWN, CK_PanelMoveDown, "Down"}, - {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, "A1"}, - {KEY_NPAGE, CK_PanelNextPage, "PgDn"}, - {KEY_PPAGE, CK_PanelPrevPage, "PgUp"}, - {ALT ('e'), CK_PanelSetPanelEncoding, "M-e"}, - {XCTRL ('s'), CK_PanelStartSearch, "C-s"}, - {ALT ('s'), CK_PanelStartSearch, "M-s"}, - {ALT ('i'), CK_PanelSyncOtherPanel, "M-i"}, + {ALT ('o'), CK_PanelOtherCd, "M-o"}, + {ALT ('l'), CK_PanelOtherCdLink, "M-l"}, + {KEY_F (15), CK_CopySingle, "S-F5"}, + {KEY_F (18), CK_DeleteSingle, "S-F8"}, + {KEY_ENTER, CK_Enter, "Enter"}, + {'\n', CK_Enter, "Enter"}, + {KEY_F (14), CK_EditNew, "S-F4"}, + {KEY_F (16), CK_MoveSingle, "S-F6"}, + {ALT ('*'), CK_SelectInvert, "M-*"}, + {KEY_KP_ADD, CK_Select, "M-+"}, + {KEY_KP_SUBTRACT, CK_Unselect, "M--"}, + {KEY_F (13), CK_ViewRaw, "S-F3"}, + {KEY_M_CTRL | KEY_NPAGE, CK_CdChild, "C-PgDn"}, + {KEY_M_CTRL | KEY_PPAGE, CK_CdParent, "C-PgUp"}, + {ALT ('H'), CK_History, "M-H"}, + {ALT ('u'), CK_HistoryNext, "M-u"}, + {ALT ('y'), CK_HistoryPrev, "M-y"}, + {ALT ('j'), CK_BottomOnScreen, "M-j"}, + {ALT ('r'), CK_MiddleOnScreen, "M-r"}, + {ALT ('g'), CK_TopOnScreen, "M-g"}, + {KEY_IC, CK_Mark, "Insert"}, + {KEY_M_SHIFT | KEY_UP, CK_MarkDown, "S-Down"}, + {KEY_M_SHIFT | KEY_DOWN, CK_MarkUp, "S-Up"}, + {KEY_UP, CK_Up, "Up"}, + {KEY_DOWN, CK_Down, "Down"}, + {KEY_LEFT, CK_Left, "Left"}, + {KEY_RIGHT, CK_Right, "Right"}, + {KEY_END, CK_Bottom, "End"}, + {KEY_C1, CK_Bottom, "C1"}, + {KEY_HOME, CK_Top, "Home"}, + {KEY_A1, CK_Top, "A1"}, + {KEY_NPAGE, CK_PageDown, "PgDn"}, + {KEY_PPAGE, CK_PageUp, "PgUp"}, +#ifdef HAVE_CHARSET + {ALT ('e'), CK_SelectCodepage, "M-e"}, +#endif + {XCTRL ('s'), CK_Search, "C-s"}, + {ALT ('s'), CK_Search, "M-s"}, + {ALT ('i'), CK_PanelOtherSync, "M-i"}, {0, CK_Ignore_Key, ""} }; /* dialog */ const global_keymap_t default_dialog_keymap[] = { - {'\n', CK_DialogOK, "Enter"}, - {KEY_ENTER, CK_DialogOK, "Enter"}, - {ESC_CHAR, CK_DialogCancel, "Esc"}, - {XCTRL ('g'), CK_DialogCancel, "C-g"}, - {KEY_F (10), CK_DialogCancel, "F10"}, - {KEY_LEFT, CK_DialogPrevItem, "Left"}, - {KEY_UP, CK_DialogPrevItem, "Up"}, - {KEY_RIGHT, CK_DialogNextItem, "Right"}, - {KEY_DOWN, CK_DialogNextItem, "Down"}, - {KEY_F (1), CK_DialogHelp, "F1"}, - {XCTRL ('z'), CK_DialogSuspend, "C-z"}, - {XCTRL ('l'), CK_DialogRefresh, "C-l"}, + {'\n', CK_Ok, "Enter"}, + {KEY_ENTER, CK_Ok, "Enter"}, + {ESC_CHAR, CK_Cancel, "Esc"}, + {XCTRL ('g'), CK_Cancel, "C-g"}, + {KEY_F (10), CK_Cancel, "F10"}, + {KEY_LEFT, CK_Left, "Left"}, + {KEY_UP, CK_Up, "Up"}, + {KEY_RIGHT, CK_Right, "Right"}, + {KEY_DOWN, CK_Down, "Down"}, + {KEY_F (1), CK_Help, "F1"}, + {XCTRL ('z'), CK_Suspend, "C-z"}, + {XCTRL ('l'), CK_Refresh, "C-l"}, {0, CK_Ignore_Key, ""} }; const global_keymap_t default_input_keymap[] = { /* Motion */ - {XCTRL ('a'), CK_InputBol, "C-a"}, - {KEY_HOME, CK_InputBol, "Home"}, - {KEY_A1, CK_InputBol, "A1"}, - {ALT ('<'), CK_InputBol, "M-<"}, - {XCTRL ('e'), CK_InputEol, "C-e"}, - {KEY_END, 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"}, - {KEY_M_CTRL | KEY_RIGHT, CK_InputWordRight, "C-Right"}, - - {XCTRL ('b'), CK_InputBackwardChar, "C-b"}, - {ALT ('b'), CK_InputBackwardWord, "M-b"}, - {XCTRL ('f'), CK_InputForwardChar, "C-f"}, - {ALT ('f'), CK_InputForwardWord, "M-f"}, + {XCTRL ('a'), CK_Home, "C-a"}, + {KEY_HOME, CK_Home, "Home"}, + {KEY_A1, CK_Home, "A1"}, + {ALT ('<'), CK_Home, "M-<"}, + {XCTRL ('e'), CK_End, "C-e"}, + {KEY_END, CK_End, "End"}, + {ALT ('>'), CK_End, "M->"}, + {KEY_C1, CK_End, "C1"}, + {KEY_LEFT, CK_Left, "Left"}, + {XCTRL ('b'), CK_Left, "C-b"}, + {KEY_RIGHT, CK_Right, "Right"}, + {XCTRL ('f'), CK_Right, "C-f"}, + {KEY_M_CTRL | KEY_LEFT, CK_WordLeft, "C-Left"}, + {ALT ('b'), CK_WordLeft, "M-b"}, + {KEY_M_CTRL | KEY_RIGHT, CK_WordRight, "C-Right"}, + {ALT ('f'), CK_WordRight, "M-f"}, + {KEY_M_SHIFT | KEY_M_CTRL | KEY_LEFT, CK_MarkToWordBegin, "C-S-Left"}, + {KEY_M_SHIFT | KEY_M_CTRL | KEY_RIGHT, CK_MarkToWordEnd, "C-S-Right"}, + {KEY_M_SHIFT | KEY_HOME, CK_MarkToHome, "S-Home"}, + {KEY_M_SHIFT | KEY_END, CK_MarkToEnd, "S-End"}, /* Editing */ - {KEY_BACKSPACE, CK_InputBackwardDelete, "BackSpace"}, - {KEY_BACKSPACE, CK_InputBackwardDelete, "C-h"}, - {KEY_DC, CK_InputDeleteChar, "Delete"}, - {KEY_DC, CK_InputDeleteChar, "C-d"}, - {ALT ('d'), CK_InputKillWord, "M-d"}, - {ALT (KEY_BACKSPACE), CK_InputBackwardKillWord, "M-BackSpace"}, + {KEY_BACKSPACE, CK_BackSpace, "BackSpace"}, + {KEY_BACKSPACE, CK_BackSpace, "C-h"}, + {KEY_DC, CK_Delete, "Delete"}, + {KEY_DC, CK_Delete, "C-d"}, + {ALT ('d'), CK_DeleteToWordEnd, "M-d"}, + {ALT (KEY_BACKSPACE), CK_DeleteToWordBegin, "M-BackSpace"}, /* Region manipulation */ - {XCTRL ('w'), CK_InputKillRegion, "C-w"}, - {ALT ('w'), CK_InputKillSave, "M-w"}, - {XCTRL ('y'), CK_InputYank, "C-y"}, - {XCTRL ('k'), CK_InputKillLine, "C-k"}, + {XCTRL ('w'), CK_Remove, "C-w"}, + {ALT ('w'), CK_Store, "M-w"}, + {XCTRL ('y'), CK_Yank, "C-y"}, + {XCTRL ('k'), CK_DeleteToEnd, "C-k"}, /* History */ - {ALT ('p'), CK_InputHistoryPrev, "M-p"}, - {ALT ('n'), CK_InputHistoryNext, "M-n"}, - {ALT ('h'), CK_InputHistoryShow, "M-h"}, + {ALT ('p'), CK_HistoryPrev, "M-p"}, + {ALT ('n'), CK_HistoryNext, "M-n"}, + {ALT ('h'), CK_History, "M-h"}, /* Completion */ - {ALT ('\t'), CK_InputComplete, "M-tab"}, + {ALT ('\t'), CK_Complete, "M-tab"}, {0, CK_Ignore_Key, ""} }; const global_keymap_t default_listbox_keymap[] = { - {KEY_UP, CK_ListboxMoveUp, "Up"}, - {XCTRL ('p'), CK_ListboxMoveUp, "C-p"}, - {KEY_DOWN, CK_ListboxMoveDown, "Down"}, - {XCTRL ('n'), CK_ListboxMoveDown, "C-n"}, - {KEY_HOME, CK_ListboxMoveHome, "Home"}, - {ALT ('<'), CK_ListboxMoveHome, "M-<"}, - {KEY_A1, CK_ListboxMoveHome, "A1"}, - {KEY_END, CK_ListboxMoveEnd, "End"}, - {ALT ('>'), CK_ListboxMoveEnd, "M->"}, - {KEY_C1, CK_ListboxMoveEnd, "C1"}, - {KEY_PPAGE, CK_ListboxMovePgUp, "PgUp"}, - {ALT ('v'), CK_ListboxMovePgUp, "M-v"}, - {KEY_NPAGE, CK_ListboxMovePgDn, "PgDn"}, - {XCTRL ('v'), CK_ListboxMovePgDn, "C-v"}, - {KEY_DC, CK_ListboxDeleteItem, "Delete"}, - {'d', CK_ListboxDeleteItem, "d"}, - {KEY_M_SHIFT | KEY_DC, CK_ListboxDeleteAll, "S-Delete"}, - {'D', CK_ListboxDeleteAll, "D"}, + {KEY_UP, CK_Up, "Up"}, + {XCTRL ('p'), CK_Up, "C-p"}, + {KEY_DOWN, CK_Down, "Down"}, + {XCTRL ('n'), CK_Down, "C-n"}, + {KEY_HOME, CK_Top, "Home"}, + {ALT ('<'), CK_Top, "M-<"}, + {KEY_A1, CK_Top, "A1"}, + {KEY_END, CK_Bottom, "End"}, + {ALT ('>'), CK_Bottom, "M->"}, + {KEY_C1, CK_Bottom, "C1"}, + {KEY_PPAGE, CK_PageUp, "PgUp"}, + {ALT ('v'), CK_PageUp, "M-v"}, + {KEY_NPAGE, CK_PageDown, "PgDn"}, + {XCTRL ('v'), CK_PageDown, "C-v"}, + {KEY_DC, CK_Delete, "Delete"}, + {'d', CK_Delete, "d"}, + {KEY_M_SHIFT | KEY_DC, CK_Clear, "S-Delete"}, + {'D', CK_Clear, "D"}, {0, CK_Ignore_Key, ""} }; /* tree */ const global_keymap_t default_tree_keymap[] = { - {KEY_F (1), CK_TreeHelp, "F1"}, - {KEY_F (2), CK_TreeRescan, "F2"}, - {KEY_F (3), CK_TreeForget, "F3"}, - {KEY_F (4), CK_TreeToggleNav, "F4"}, - {KEY_F (5), CK_TreeCopy, "F5"}, - {KEY_F (6), CK_TreeMove, "F6"}, + {KEY_F (1), CK_Help, "F1"}, + {KEY_F (2), CK_Reread, "F2"}, + {KEY_F (3), CK_Forget, "F3"}, + {KEY_F (4), CK_ToggleNavigation, "F4"}, + {KEY_F (5), CK_Copy, "F5"}, + {KEY_F (6), CK_Move, "F6"}, #if 0 - {KEY_F (7), CK_TreeMake, "F7"}, + {KEY_F (7), CK_MakeDir, "F7"}, #endif - {KEY_F (8), CK_TreeRemove, "F8"}, - {KEY_UP, CK_TreeMoveUp, "Up"}, - {XCTRL ('p'), CK_TreeMoveUp, "C-p"}, - {KEY_DOWN, CK_TreeMoveDown, "Down"}, - {XCTRL ('n'), CK_TreeMoveDown, "C-n"}, - {KEY_LEFT, CK_TreeMoveLeft, "Left"}, - {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"}, - {XCTRL ('v'), CK_TreeMovePgDn, "C-v"}, - {'\n', CK_TreeOpen, "Enter"}, - {KEY_ENTER, CK_TreeOpen, "Enter"}, - {XCTRL ('r'), CK_TreeRescan, "C-r"}, - {XCTRL ('s'), CK_TreeStartSearch, "C-s"}, - {ALT ('s'), CK_TreeStartSearch, "M-s"}, - {KEY_DC, CK_TreeRemove, "Delete"}, + {KEY_F (8), CK_Delete, "F8"}, + {KEY_UP, CK_Up, "Up"}, + {XCTRL ('p'), CK_Up, "C-p"}, + {KEY_DOWN, CK_Down, "Down"}, + {XCTRL ('n'), CK_Down, "C-n"}, + {KEY_LEFT, CK_Left, "Left"}, + {KEY_RIGHT, CK_Right, "Right"}, + {KEY_HOME, CK_Top, "Home"}, + {ALT ('<'), CK_Top, "M-<"}, + {KEY_A1, CK_Top, "A1"}, + {KEY_END, CK_Bottom, "End"}, + {ALT ('>'), CK_Bottom, "M->"}, + {KEY_C1, CK_Bottom, "C1"}, + {KEY_PPAGE, CK_PageUp, "PgUp"}, + {ALT ('v'), CK_PageUp, "M-v"}, + {KEY_NPAGE, CK_PageDown, "PgDn"}, + {XCTRL ('v'), CK_PageDown, "C-v"}, + {'\n', CK_Enter, "Enter"}, + {KEY_ENTER, CK_Enter, "Enter"}, + {XCTRL ('r'), CK_Reread, "C-r"}, + {XCTRL ('s'), CK_Search, "C-s"}, + {ALT ('s'), CK_Search, "M-s"}, + {KEY_DC, CK_Delete, "Delete"}, {0, CK_Ignore_Key, ""} }; /* help */ const global_keymap_t default_help_keymap[] = { - {KEY_F (1), CK_HelpHelp, "F1"}, - {KEY_F (2), CK_HelpIndex, "F2"}, - {KEY_F (3), CK_HelpBack, "F3"}, - {KEY_F (10), CK_HelpQuit, "F10"}, - {KEY_LEFT, CK_HelpBack, "Left"}, - {'l', CK_HelpBack, "l"}, - {KEY_DOWN, CK_HelpMoveDown, "Down"}, - {XCTRL ('n'), CK_HelpMoveDown, "C-n"}, - {KEY_UP, CK_HelpMoveUp, "Up"}, - {XCTRL ('p'), CK_HelpMoveUp, "C-p"}, - {KEY_NPAGE, CK_HelpMovePgDn, "PgDn"}, - {XCTRL ('v'), CK_HelpMovePgDn, "C-v"}, - {'f', CK_HelpMovePgDn, "f"}, - {' ', CK_HelpMovePgDn, "Space"}, - {KEY_PPAGE, CK_HelpMovePgUp, "PgUp"}, - {ALT ('v'), CK_HelpMovePgUp, "M-v"}, - {'b', CK_HelpMovePgUp, "b"}, - {KEY_BACKSPACE, CK_HelpMovePgUp, "BackSpace"}, - {'d', CK_HelpMoveHalfPgDn, "d"}, - {'u', CK_HelpMoveHalfPgUp, "u"}, - {KEY_HOME, CK_HelpMoveTop, "Home"}, - {KEY_M_CTRL | KEY_HOME, CK_HelpMoveTop, "C-Home"}, - {KEY_M_CTRL | KEY_PPAGE, CK_HelpMoveTop, "C-PgUp"}, - {KEY_A1, CK_HelpMoveTop, "A1"}, - {ALT ('<'), CK_HelpMoveTop, "M-<"}, - {'g', CK_HelpMoveTop, "g"}, - {KEY_END, CK_HelpMoveBottom, "End"}, - {KEY_M_CTRL | KEY_END, CK_HelpMoveBottom, "C-End"}, - {KEY_M_CTRL | KEY_NPAGE, CK_HelpMoveBottom, "C-PgDn"}, - {KEY_C1, CK_HelpMoveBottom, "C1"}, - {ALT ('>'), CK_HelpMoveBottom, "M->"}, - {'G', CK_HelpMoveBottom, "G"}, - {KEY_RIGHT, CK_HelpSelectLink, "Right"}, - {KEY_ENTER, CK_HelpSelectLink, "Enter"}, - {'\n', CK_HelpSelectLink, "Enter"}, - {'\t', CK_HelpNextLink, "Tab"}, - {ALT ('\t'), CK_HelpPrevLink, "M-Tab"}, - {'n', CK_HelpNextNode, "n"}, - {'p', CK_HelpPrevNode, "p"}, - {ESC_CHAR, CK_HelpQuit, "Esc"}, - {XCTRL ('g'), CK_HelpQuit, "C-g"}, + {KEY_F (1), CK_Help, "F1"}, + {KEY_F (2), CK_Index, "F2"}, + {KEY_F (3), CK_Back, "F3"}, + {KEY_F (10), CK_Quit, "F10"}, + {KEY_LEFT, CK_Back, "Left"}, + {'l', CK_Back, "l"}, + {KEY_DOWN, CK_Down, "Down"}, + {XCTRL ('n'), CK_Down, "C-n"}, + {KEY_UP, CK_Up, "Up"}, + {XCTRL ('p'), CK_Up, "C-p"}, + {KEY_NPAGE, CK_PageDown, "PgDn"}, + {XCTRL ('v'), CK_PageDown, "C-v"}, + {'f', CK_PageDown, "f"}, + {' ', CK_PageDown, "Space"}, + {KEY_PPAGE, CK_PageUp, "PgUp"}, + {ALT ('v'), CK_PageUp, "M-v"}, + {'b', CK_PageUp, "b"}, + {KEY_BACKSPACE, CK_PageUp, "BackSpace"}, + {'d', CK_HalfPageDown, "d"}, + {'u', CK_HalfPageUp, "u"}, + {KEY_HOME, CK_Top, "Home"}, + {KEY_M_CTRL | KEY_HOME, CK_Top, "C-Home"}, + {KEY_M_CTRL | KEY_PPAGE, CK_Top, "C-PgUp"}, + {KEY_A1, CK_Top, "A1"}, + {ALT ('<'), CK_Top, "M-<"}, + {'g', CK_Top, "g"}, + {KEY_END, CK_Bottom, "End"}, + {KEY_M_CTRL | KEY_END, CK_Bottom, "C-End"}, + {KEY_M_CTRL | KEY_NPAGE, CK_Bottom, "C-PgDn"}, + {KEY_C1, CK_Bottom, "C1"}, + {ALT ('>'), CK_Bottom, "M->"}, + {'G', CK_Bottom, "G"}, + {KEY_RIGHT, CK_Enter, "Right"}, + {KEY_ENTER, CK_Enter, "Enter"}, + {'\n', CK_Enter, "Enter"}, + {'\t', CK_LinkNext, "Tab"}, + {ALT ('\t'), CK_LinkPrev, "M-Tab"}, + {'n', CK_NodeNext, "n"}, + {'p', CK_NodePrev, "p"}, + {ESC_CHAR, CK_Quit, "Esc"}, + {XCTRL ('g'), CK_Quit, "C-g"}, {0, CK_Ignore_Key, ""} }; @@ -368,19 +375,19 @@ const global_keymap_t default_editor_keymap[] = { {KEY_F (4), CK_Replace, "F4"}, {KEY_F (5), CK_Copy, "F5"}, {KEY_F (6), CK_Move, "F6"}, - {KEY_F (7), CK_Find, "F7"}, + {KEY_F (7), CK_Search, "F7"}, {KEY_F (8), CK_Remove, "F8"}, {KEY_F (9), CK_Menu, "F9"}, {KEY_F (10), CK_Quit, "F10"}, /* edit user menu */ - {KEY_F (11), CK_User_Menu, "S-F1"}, - {KEY_F (12), CK_Save_As, "S-F2"}, - {KEY_F (13), CK_Column_Mark, "S-F3"}, - {KEY_F (14), CK_Replace_Again, "S-F4"}, - {KEY_F (15), CK_Insert_File, "S-F5"}, - {KEY_F (17), CK_Find_Again, "S-F7"}, + {KEY_F (11), CK_UserMenu, "S-F1"}, + {KEY_F (12), CK_SaveAs, "S-F2"}, + {KEY_F (13), CK_MarkColumn, "S-F3"}, + {KEY_F (14), CK_ReplaceContinue, "S-F4"}, + {KEY_F (15), CK_InsertFile, "S-F5"}, + {KEY_F (17), CK_SearchContinue, "S-F7"}, /* C formatter */ - {KEY_F (19), CK_Pipe_Block (0), "S-F9"}, + {KEY_F (19), CK_PipeBlock (0), "S-F9"}, {ESC_CHAR, CK_Quit, "Esc"}, {KEY_BACKSPACE, CK_BackSpace, "BackSpace"}, @@ -390,265 +397,266 @@ const global_keymap_t default_editor_keymap[] = { {KEY_DOWN, CK_Down, "Down"}, {KEY_END, CK_End, "End"}, {KEY_HOME, CK_Home, "Home"}, - {KEY_IC, CK_Toggle_Insert, "Insert"}, + {KEY_IC, CK_InsertOverwrite, "Insert"}, {KEY_LEFT, CK_Left, "Left"}, - {KEY_NPAGE, CK_Page_Down, "PgDn"}, - {KEY_PPAGE, CK_Page_Up, "PgUp"}, + {KEY_NPAGE, CK_PageDown, "PgDn"}, + {KEY_PPAGE, CK_PageUp, "PgUp"}, {KEY_RIGHT, CK_Right, "Right"}, {KEY_UP, CK_Up, "Up"}, /* Ctrl */ - {KEY_M_CTRL | (KEY_F (2)), CK_Save_As, "C-F2"}, - {KEY_M_CTRL | (KEY_F (4)), CK_Replace_Again, "C-F4"}, - {KEY_M_CTRL | (KEY_F (7)), CK_Find_Again, "C-F7"}, + {KEY_M_CTRL | (KEY_F (2)), CK_SaveAs, "C-F2"}, + {KEY_M_CTRL | (KEY_F (4)), CK_ReplaceContinue, "C-F4"}, + {KEY_M_CTRL | (KEY_F (7)), CK_SearchContinue, "C-F7"}, {KEY_M_CTRL | KEY_BACKSPACE, CK_Undo, "C-BackSpace"}, - {KEY_M_CTRL | KEY_NPAGE, CK_End_Of_Text, "C-PgDn"}, - {KEY_M_CTRL | KEY_PPAGE, CK_Beginning_Of_Text, "C-PgUp"}, - {KEY_M_CTRL | KEY_HOME, CK_Beginning_Of_Text, "C-Home"}, - {KEY_M_CTRL | KEY_END, CK_End_Of_Text, "C-End"}, - {KEY_M_CTRL | KEY_UP, CK_Scroll_Up, "C-Up"}, - {KEY_M_CTRL | KEY_DOWN, CK_Scroll_Down, "C-Down"}, - {KEY_M_CTRL | KEY_LEFT, CK_Word_Left, "C-Left"}, - {XCTRL ('z'), CK_Word_Left, "C-z"}, - {KEY_M_CTRL | KEY_RIGHT, CK_Word_Right, "C-Right"}, - {XCTRL ('x'), CK_Word_Right, "C-x"}, - {KEY_M_CTRL | KEY_IC, CK_XStore, "C-Insert"}, + {KEY_M_CTRL | KEY_NPAGE, CK_Bottom, "C-PgDn"}, + {KEY_M_CTRL | KEY_PPAGE, CK_Top, "C-PgUp"}, + {KEY_M_CTRL | KEY_HOME, CK_Top, "C-Home"}, + {KEY_M_CTRL | KEY_END, CK_Bottom, "C-End"}, + {KEY_M_CTRL | KEY_UP, CK_ScrollUp, "C-Up"}, + {KEY_M_CTRL | KEY_DOWN, CK_ScrollDown, "C-Down"}, + {KEY_M_CTRL | KEY_LEFT, CK_WordLeft, "C-Left"}, + {XCTRL ('z'), CK_WordLeft, "C-z"}, + {KEY_M_CTRL | KEY_RIGHT, CK_WordRight, "C-Right"}, + {XCTRL ('x'), CK_WordRight, "C-x"}, + {KEY_M_CTRL | KEY_IC, CK_Store, "C-Insert"}, {KEY_M_CTRL | KEY_DC, CK_Remove, "C-Delete"}, - {XCTRL ('n'), CK_New, "C-n"}, - {XCTRL ('k'), CK_Delete_To_Line_End, "C-k"}, + {XCTRL ('n'), CK_EditNew, "C-n"}, + {XCTRL ('k'), CK_DeleteToEnd, "C-k"}, {XCTRL ('l'), CK_Refresh, "C-l"}, {XCTRL ('o'), CK_Shell, "C-o"}, - {XCTRL ('s'), CK_Toggle_Syntax, "C-s"}, + {XCTRL ('s'), CK_SyntaxOnOff, "C-s"}, {XCTRL ('u'), CK_Undo, "C-u"}, {ALT ('r'), CK_Redo, "M-r"}, +#ifdef HAVE_CHARSET {ALT ('e'), CK_SelectCodepage, "M-e"}, - {XCTRL ('q'), CK_Insert_Literal, "C-q"}, - {XCTRL ('r'), CK_Begin_End_Macro, "C-r"}, - {XCTRL ('r'), CK_Begin_Record_Macro, "C-r"}, - {XCTRL ('r'), CK_End_Record_Macro, "C-r"}, - {XCTRL ('f'), CK_Save_Block, "C-f"}, +#endif + {XCTRL ('f'), CK_BlockSave, "C-f"}, /* Spell check */ - {XCTRL ('p'), CK_Pipe_Block (1), "C-p"}, - {XCTRL ('y'), CK_Delete_Line, "C-y"}, + {XCTRL ('p'), CK_PipeBlock (1), "C-p"}, + {XCTRL ('y'), CK_DeleteLine, "C-y"}, /* Shift */ - {KEY_M_SHIFT | KEY_NPAGE, CK_Page_Down_Highlight, "S-PgDn"}, - {KEY_M_SHIFT | KEY_PPAGE, CK_Page_Up_Highlight, "S-PgUp"}, - {KEY_M_SHIFT | KEY_LEFT, CK_Left_Highlight, "S-Left"}, - {KEY_M_SHIFT | KEY_RIGHT, CK_Right_Highlight, "S-Right"}, - {KEY_M_SHIFT | KEY_UP, CK_Up_Highlight, "S-Up"}, - {KEY_M_SHIFT | KEY_DOWN, CK_Down_Highlight, "S-Down"}, - {KEY_M_SHIFT | KEY_HOME, CK_Home_Highlight, "S-Home"}, - {KEY_M_SHIFT | KEY_END, CK_End_Highlight, "S-End"}, - {KEY_M_SHIFT | KEY_IC, CK_XPaste, "S-Insert"}, - {KEY_M_SHIFT | KEY_DC, CK_XCut, "S-Delete"}, + {KEY_M_SHIFT | KEY_NPAGE, CK_MarkPageDown, "S-PgDn"}, + {KEY_M_SHIFT | KEY_PPAGE, CK_MarkPageUp, "S-PgUp"}, + {KEY_M_SHIFT | KEY_LEFT, CK_MarkLeft, "S-Left"}, + {KEY_M_SHIFT | KEY_RIGHT, CK_MarkRight, "S-Right"}, + {KEY_M_SHIFT | KEY_UP, CK_MarkUp, "S-Up"}, + {KEY_M_SHIFT | KEY_DOWN, CK_MarkDown, "S-Down"}, + {KEY_M_SHIFT | KEY_HOME, CK_MarkToHome, "S-Home"}, + {KEY_M_SHIFT | KEY_END, CK_MarkToEnd, "S-End"}, + {KEY_M_SHIFT | KEY_IC, CK_Paste, "S-Insert"}, + {KEY_M_SHIFT | KEY_DC, CK_Cut, "S-Delete"}, /* useful for pasting multiline text */ {KEY_M_SHIFT | '\n', CK_Return, "S-Enter"}, /* Ctrl + Shift */ - {KEY_M_SHIFT | KEY_M_CTRL | KEY_NPAGE, CK_End_Of_Text_Highlight, "C-S-PgDn"}, - {KEY_M_SHIFT | KEY_M_CTRL | KEY_PPAGE, CK_Beginning_Of_Text_Highlight, "C-S-PgUp"}, - {KEY_M_SHIFT | KEY_M_CTRL | KEY_LEFT, CK_Word_Left_Highlight, "C-S-Left"}, - {KEY_M_SHIFT | KEY_M_CTRL | KEY_RIGHT, CK_Word_Right_Highlight, "C-S-Right"}, - {KEY_M_SHIFT | KEY_M_CTRL | KEY_UP, CK_Scroll_Up_Highlight, "C-S-Up"}, - {KEY_M_SHIFT | KEY_M_CTRL | KEY_DOWN, CK_Scroll_Down_Highlight, "C-S-Down"}, + {KEY_M_SHIFT | KEY_M_CTRL | KEY_PPAGE, CK_MarkToFileBegin, "C-S-PgUp"}, + {KEY_M_SHIFT | KEY_M_CTRL | KEY_NPAGE, CK_MarkToFileEnd, "C-S-PgDn"}, + {KEY_M_SHIFT | KEY_M_CTRL | KEY_LEFT, CK_MarkToWordBegin, "C-S-Left"}, + {KEY_M_SHIFT | KEY_M_CTRL | KEY_RIGHT, CK_MarkToWordEnd, "C-S-Right"}, + {KEY_M_SHIFT | KEY_M_CTRL | KEY_UP, CK_MarkScrollUp, "C-S-Up"}, + {KEY_M_SHIFT | KEY_M_CTRL | KEY_DOWN, CK_MarkScrollDown, "C-S-Down"}, - /* Alt */ - {KEY_M_ALT | KEY_NPAGE, CK_Page_Down_Alt_Highlight, "M-PgDn"}, - {KEY_M_ALT | KEY_PPAGE, CK_Page_Up_Alt_Highlight, "M-PgUp"}, - {KEY_M_ALT | KEY_LEFT, CK_Left_Alt_Highlight, "M-Left"}, - {KEY_M_ALT | KEY_RIGHT, CK_Right_Alt_Highlight, "M-Right"}, - {KEY_M_ALT | KEY_UP, CK_Up_Alt_Highlight, "M-Up"}, - {KEY_M_ALT | KEY_DOWN, CK_Down_Alt_Highlight, "M-Down"}, - {KEY_M_ALT | KEY_HOME, CK_Home_Highlight, "M-Home"}, - {KEY_M_ALT | KEY_END, CK_End_Alt_Highlight, "M-End"}, + /* column mark commands */ + {KEY_M_ALT | KEY_PPAGE, CK_MarkColumnPageUp, "M-PgUp"}, + {KEY_M_ALT | KEY_NPAGE, CK_MarkColumnPageDown, "M-PgDn"}, + {KEY_M_ALT | KEY_LEFT, CK_MarkColumnLeft, "M-Left"}, + {KEY_M_ALT | KEY_RIGHT, CK_MarkColumnRight, "M-Right"}, + {KEY_M_ALT | KEY_UP, CK_MarkColumnUp, "M-Up"}, + {KEY_M_ALT | KEY_DOWN, CK_MarkColumnDown, "M-Down"}, + {KEY_M_ALT | KEY_HOME, CK_MarkToHome, "M-Home"}, - {ALT ('\n'), CK_Find_Definition, "M-Enter"}, - {ALT ('\t'), CK_Complete_Word, "M-Tab"}, + {ALT ('\n'), CK_Find, "M-Enter"}, + {ALT ('\t'), CK_Complete, "M-Tab"}, {ALT ('l'), CK_Goto, "M-l"}, {ALT ('L'), CK_Goto, "M-L"}, - {ALT ('p'), CK_Paragraph_Format, "M-p"}, + {ALT ('p'), CK_ParagraphFormat, "M-p"}, {ALT ('t'), CK_Sort, "M-t"}, - {ALT ('u'), CK_ExtCmd, "M-u"}, - {ALT ('<'), CK_Beginning_Of_Text, "M-<"}, - {ALT ('>'), CK_End_Of_Text, "M->"}, - {ALT ('-'), CK_Load_Prev_File, "M--"}, - {ALT ('+'), CK_Load_Next_File, "M-+"}, - {ALT ('d'), CK_Delete_Word_Right, "M-d"}, - {ALT (KEY_BACKSPACE), CK_Delete_Word_Left, "M-BackSpace"}, - {ALT ('n'), CK_Toggle_Line_State, "M-n"}, - {ALT ('_'), CK_Toggle_Tab_TWS, "M-_"}, - {ALT ('k'), CK_Toggle_Bookmark, "M-k"}, - {ALT ('i'), CK_Prev_Bookmark, "M-i"}, - {ALT ('j'), CK_Next_Bookmark, "M-j"}, - {ALT ('o'), CK_Flush_Bookmarks, "M-o"}, - {ALT ('b'), CK_Match_Bracket, "M-b"}, + {ALT ('u'), CK_ExternalCommand, "M-u"}, + {ALT ('<'), CK_Top, "M-<"}, + {ALT ('>'), CK_Bottom, "M->"}, + {ALT ('-'), CK_FilePrev, "M--"}, + {ALT ('+'), CK_FileNext, "M-+"}, + {ALT ('d'), CK_DeleteToWordEnd, "M-d"}, + {ALT (KEY_BACKSPACE), CK_DeleteToWordBegin, "M-BackSpace"}, + {ALT ('n'), CK_ShowNumbers, "M-n"}, + {ALT ('_'), CK_ShowTabTws, "M-_"}, + {ALT ('k'), CK_Bookmark, "M-k"}, + {ALT ('i'), CK_BookmarkPrev, "M-i"}, + {ALT ('j'), CK_BookmarkNext, "M-j"}, + {ALT ('o'), CK_BookmarkFlush, "M-o"}, + {ALT ('b'), CK_MatchBracket, "M-b"}, {ALT ('m'), CK_Mail, "M-m"}, - {XCTRL ('x'), CK_Ext_Mode, "C-x"}, + {XCTRL ('x'), CK_ExtendedKeyMap, "C-x"}, {0, CK_Ignore_Key, ""} }; /* emacs keyboard layout emulation */ const global_keymap_t default_editor_x_keymap[] = { - {'k', CK_New, "k"}, + {'k', CK_EditNew, "k"}, {0, CK_Ignore_Key, ""} }; #endif /* USE_INTERNAL_EDIT */ /* viewer/actions_cmd.c */ const global_keymap_t default_viewer_keymap[] = { - {KEY_F (1), CK_ViewHelp, "F1"}, - {KEY_F (2), CK_ViewToggleWrapMode, "F2"}, - {KEY_F (3), CK_ViewQuit, "F3"}, - {KEY_F (4), CK_ViewToggleHexMode, "F4"}, - {KEY_F (5), CK_ViewGoto, "F5"}, - {KEY_F (7), CK_ViewSearch, "F7"}, - {KEY_F (8), CK_ViewToggleMagicMode, "F8"}, - {KEY_F (9), CK_ViewToggleNroffMode, "F9"}, - {KEY_F (10), CK_ViewQuit, "F10"}, + {KEY_F (1), CK_Help, "F1"}, + {KEY_F (2), CK_WrapMode, "F2"}, + {KEY_F (3), CK_Quit, "F3"}, + {KEY_F (4), CK_HexMode, "F4"}, + {KEY_F (5), CK_Goto, "F5"}, + {KEY_F (7), CK_Search, "F7"}, + {KEY_F (8), CK_MagicMode, "F8"}, + {KEY_F (9), CK_NroffMode, "F9"}, + {KEY_F (10), CK_Quit, "F10"}, - {'?', CK_ViewSearch, "?"}, - {'/', CK_ViewSearch, "/"}, - {XCTRL ('r'), CK_ViewContinueSearch, "C-r"}, - {XCTRL ('s'), CK_ViewContinueSearch, "C-s"}, - {KEY_F (17), CK_ViewContinueSearch, "S-F7"}, - {'n', CK_ViewContinueSearch, "n"}, - {ALT ('r'), CK_ViewToggleRuler, "M-r"}, + {'?', CK_Search, "?"}, + {'/', CK_Search, "/"}, + {XCTRL ('r'), CK_SearchContinue, "C-r"}, + {XCTRL ('s'), CK_SearchContinue, "C-s"}, + {KEY_F (17), CK_SearchContinue, "S-F7"}, + {'n', CK_SearchContinue, "n"}, + {ALT ('r'), CK_Ruler, "M-r"}, - {XCTRL ('a'), CK_ViewMoveToBol, "C-a"}, - {XCTRL ('e'), CK_ViewMoveToEol, "C-e"}, + {XCTRL ('a'), CK_Home, "C-a"}, + {XCTRL ('e'), CK_End, "C-e"}, - {'h', CK_ViewMoveLeft, "h"}, - {KEY_LEFT, CK_ViewMoveLeft, "Left"}, + {'h', CK_Left, "h"}, + {KEY_LEFT, CK_Left, "Left"}, - {'l', CK_ViewMoveRight, "l"}, - {KEY_RIGHT, CK_ViewMoveRight, "Right"}, + {'l', CK_Right, "l"}, + {KEY_RIGHT, CK_Right, "Right"}, - {KEY_M_CTRL | KEY_LEFT, CK_ViewMoveLeft10, "C-Left"}, - {KEY_M_CTRL | KEY_RIGHT, CK_ViewMoveRight10, "C-Right"}, + {KEY_M_CTRL | KEY_LEFT, CK_LeftQuick, "C-Left"}, + {KEY_M_CTRL | KEY_RIGHT, CK_RightQuick, "C-Right"}, - {'k', CK_ViewMoveUp, "k"}, - {'y', CK_ViewMoveUp, "y"}, - {XCTRL ('p'), CK_ViewMoveUp, "C-p"}, - {KEY_IC, CK_ViewMoveUp, "Insert"}, - {KEY_UP, CK_ViewMoveUp, "Up"}, + {'k', CK_Up, "k"}, + {'y', CK_Up, "y"}, + {XCTRL ('p'), CK_Up, "C-p"}, + {KEY_IC, CK_Up, "Insert"}, + {KEY_UP, CK_Up, "Up"}, + {XCTRL ('n'), CK_Up, "C-n"}, - {'j', CK_ViewMoveDown, "j"}, - {'e', CK_ViewMoveDown, "e"}, - {XCTRL ('n'), CK_ViewMoveUp, "C-n"}, - {KEY_DOWN, CK_ViewMoveDown, "Down"}, - {KEY_DC, CK_ViewMoveDown, "Delete"}, - {'\n', CK_ViewMoveDown, "Endter"}, + {'j', CK_Down, "j"}, + {'e', CK_Down, "e"}, + {KEY_DOWN, CK_Down, "Down"}, + {KEY_DC, CK_Down, "Delete"}, + {'\n', CK_Down, "Endter"}, - {' ', CK_ViewMovePgDn, "Space"}, - {'f', CK_ViewMovePgDn, "f"}, - {KEY_NPAGE, CK_ViewMovePgDn, "PgDn"}, - {XCTRL ('v'), CK_ViewMovePgDn, "C-v"}, + {' ', CK_PageDown, "Space"}, + {'f', CK_PageDown, "f"}, + {KEY_NPAGE, CK_PageDown, "PgDn"}, + {XCTRL ('v'), CK_PageDown, "C-v"}, - {'b', CK_ViewMovePgUp, "b"}, - {KEY_PPAGE, CK_ViewMovePgUp, "PgUp"}, - {ALT ('v'), CK_ViewMovePgUp, "M-v"}, - {KEY_BACKSPACE, CK_ViewMovePgUp, "BackSpace"}, + {'b', CK_PageUp, "b"}, + {KEY_PPAGE, CK_PageUp, "PgUp"}, + {ALT ('v'), CK_PageUp, "M-v"}, + {KEY_BACKSPACE, CK_PageUp, "BackSpace"}, - {'d', CK_ViewMoveHalfPgDn, "d"}, - {'u', CK_ViewMoveHalfPgUp, "u"}, + {'d', CK_HalfPageDown, "d"}, + {'u', CK_HalfPageUp, "u"}, - {KEY_HOME, CK_ViewMoveTop, "Home"}, - {KEY_M_CTRL | KEY_HOME, CK_ViewMoveTop, "C-Home"}, - {KEY_M_CTRL | KEY_PPAGE, CK_ViewMoveTop, "C-PgUp"}, - {KEY_A1, CK_ViewMoveTop, "A1"}, - {ALT ('<'), CK_ViewMoveTop, "M-<"}, - {'g', CK_ViewMoveTop, "g"}, + {KEY_HOME, CK_Top, "Home"}, + {KEY_M_CTRL | KEY_HOME, CK_Top, "C-Home"}, + {KEY_M_CTRL | KEY_PPAGE, CK_Top, "C-PgUp"}, + {KEY_A1, CK_Top, "A1"}, + {ALT ('<'), CK_Top, "M-<"}, + {'g', CK_Top, "g"}, - {KEY_END, CK_ViewMoveBottom, "End"}, - {KEY_M_CTRL | KEY_END, CK_ViewMoveBottom, "C-End"}, - {KEY_M_CTRL | KEY_NPAGE, CK_ViewMoveBottom, "C-PgDn"}, - {KEY_C1, CK_ViewMoveBottom, "C1"}, - {ALT ('>'), CK_ViewMoveBottom, "M->"}, - {'G', CK_ViewMoveBottom, "G"}, + {KEY_END, CK_Bottom, "End"}, + {KEY_M_CTRL | KEY_END, CK_Bottom, "C-End"}, + {KEY_M_CTRL | KEY_NPAGE, CK_Bottom, "C-PgDn"}, + {KEY_C1, CK_Bottom, "C1"}, + {ALT ('>'), CK_Bottom, "M->"}, + {'G', CK_Bottom, "G"}, - {'m', CK_ViewGotoBookmark, "m"}, - {'r', CK_ViewNewBookmark, "r"}, + {'m', CK_BookmarkGoto, "m"}, + {'r', CK_Bookmark, "r"}, - {XCTRL ('f'), CK_ViewNextFile, "C-f"}, - {XCTRL ('b'), CK_ViewPrevFile, "C-b"}, + {XCTRL ('f'), CK_FileNext, "C-f"}, + {XCTRL ('b'), CK_FilePrev, "C-b"}, - {'q', CK_ViewQuit, "q"}, - {XCTRL ('g'), CK_ViewQuit, "C-g"}, - {ESC_CHAR, CK_ViewQuit, "Esc"}, + {'q', CK_Quit, "q"}, + {XCTRL ('g'), CK_Quit, "C-g"}, + {ESC_CHAR, CK_Quit, "Esc"}, +#ifdef HAVE_CHARSET {ALT ('e'), CK_SelectCodepage, "M-e"}, - {XCTRL ('o'), CK_ShowCommandLine, "C-o"}, +#endif + {XCTRL ('o'), CK_Shell, "C-o"}, {0, CK_Ignore_Key, ""} }; const global_keymap_t default_viewer_hex_keymap[] = { - {KEY_F (1), CK_ViewHelp, "F1"}, - {KEY_F (2), CK_ViewToggleHexEditMode, "F2"}, - {KEY_F (3), CK_ViewQuit, "F3"}, - {KEY_F (4), CK_ViewToggleHexMode, "F4"}, - {KEY_F (5), CK_ViewGoto, "F5"}, - {KEY_F (6), CK_ViewHexEditSave, "F6"}, - {KEY_F (7), CK_ViewSearch, "F7"}, - {KEY_F (8), CK_ViewToggleMagicMode, "F8"}, - {KEY_F (9), CK_ViewToggleNroffMode, "F9"}, - {KEY_F (10), CK_ViewQuit, "F10"}, + {KEY_F (1), CK_Help, "F1"}, + {KEY_F (2), CK_HexEditMode, "F2"}, + {KEY_F (3), CK_Quit, "F3"}, + {KEY_F (4), CK_HexMode, "F4"}, + {KEY_F (5), CK_Goto, "F5"}, + {KEY_F (6), CK_Save, "F6"}, + {KEY_F (7), CK_Search, "F7"}, + {KEY_F (8), CK_MagicMode, "F8"}, + {KEY_F (9), CK_NroffMode, "F9"}, + {KEY_F (10), CK_Quit, "F10"}, - {'?', CK_ViewSearch, "?"}, - {'/', CK_ViewSearch, "/"}, - {XCTRL ('r'), CK_ViewContinueSearch, "C-r"}, - {XCTRL ('s'), CK_ViewContinueSearch, "C-s"}, - {KEY_F (17), CK_ViewContinueSearch, "S-F7"}, - {'n', CK_ViewContinueSearch, "n"}, + {'?', CK_Search, "?"}, + {'/', CK_Search, "/"}, + {XCTRL ('r'), CK_SearchContinue, "C-r"}, + {XCTRL ('s'), CK_SearchContinue, "C-s"}, + {KEY_F (17), CK_SearchContinue, "S-F7"}, + {'n', CK_SearchContinue, "n"}, - {'\t', CK_ViewToggleHexNavMode, "Tab"}, - {XCTRL ('a'), CK_ViewMoveToBol, "C-a"}, - {XCTRL ('e'), CK_ViewMoveToEol, "C-e"}, + {'\t', CK_ToggleNavigation, "Tab"}, + {KEY_HOME, CK_Home, "Home"}, + {KEY_END, CK_End, "End"}, + {XCTRL ('a'), CK_Home, "C-a"}, + {XCTRL ('e'), CK_End, "C-e"}, - {'b', CK_ViewMoveLeft, "b"}, - {KEY_LEFT, CK_ViewMoveLeft, "Left"}, + {'b', CK_Left, "b"}, + {KEY_LEFT, CK_Left, "Left"}, - {'f', CK_ViewMoveRight, "f"}, - {KEY_RIGHT, CK_ViewMoveRight, "Right"}, + {'f', CK_Right, "f"}, + {KEY_RIGHT, CK_Right, "Right"}, - {'k', CK_ViewMoveUp, "k"}, - {'y', CK_ViewMoveUp, "y"}, - {KEY_UP, CK_ViewMoveUp, "Up"}, + {'k', CK_Up, "k"}, + {'y', CK_Up, "y"}, + {KEY_UP, CK_Up, "Up"}, - {'j', CK_ViewMoveDown, "j"}, - {KEY_DOWN, CK_ViewMoveDown, "Down"}, - {KEY_DC, CK_ViewMoveDown, "Delete"}, + {'j', CK_Down, "j"}, + {KEY_DOWN, CK_Down, "Down"}, + {KEY_DC, CK_Down, "Delete"}, - {KEY_NPAGE, CK_ViewMovePgDn, "PgDn"}, - {XCTRL ('v'), CK_ViewMovePgDn, "C-v"}, + {KEY_NPAGE, CK_PageDown, "PgDn"}, + {XCTRL ('v'), CK_PageDown, "C-v"}, - {KEY_PPAGE, CK_ViewMovePgUp, "PgUp"}, - {ALT ('v'), CK_ViewMovePgUp, "M-v"}, + {KEY_PPAGE, CK_PageUp, "PgUp"}, + {ALT ('v'), CK_PageUp, "M-v"}, - {KEY_HOME, CK_ViewMoveTop, "Home"}, - {KEY_M_CTRL | KEY_HOME, CK_ViewMoveTop, "C-Home"}, - {KEY_M_CTRL | KEY_PPAGE, CK_ViewMoveTop, "C-PgUp"}, - {KEY_A1, CK_ViewMoveTop, "A1"}, - {ALT ('<'), CK_ViewMoveTop, "M-<"}, - {'g', CK_ViewMoveTop, "g"}, + {KEY_M_CTRL | KEY_HOME, CK_Top, "C-Home"}, + {KEY_M_CTRL | KEY_PPAGE, CK_Top, "C-PgUp"}, + {KEY_A1, CK_Top, "A1"}, + {ALT ('<'), CK_Top, "M-<"}, + {'g', CK_Top, "g"}, - {KEY_END, CK_ViewMoveBottom, "End"}, - {KEY_M_CTRL | KEY_END, CK_ViewMoveBottom, "C-End"}, - {KEY_M_CTRL | KEY_NPAGE, CK_ViewMoveBottom, "C-PgDn"}, - {KEY_C1, CK_ViewMoveBottom, "C1"}, - {ALT ('>'), CK_ViewMoveBottom, "M->"}, - {'G', CK_ViewMoveBottom, "G"}, + {KEY_M_CTRL | KEY_END, CK_Bottom, "C-End"}, + {KEY_M_CTRL | KEY_NPAGE, CK_Bottom, "C-PgDn"}, + {KEY_C1, CK_Bottom, "C1"}, + {ALT ('>'), CK_Bottom, "M->"}, + {'G', CK_Bottom, "G"}, - {'q', CK_ViewQuit, "q"}, - {XCTRL ('g'), CK_ViewQuit, "C-g"}, - {ESC_CHAR, CK_ViewQuit, "Esc"}, + {'q', CK_Quit, "q"}, + {XCTRL ('g'), CK_Quit, "C-g"}, + {ESC_CHAR, CK_Quit, "Esc"}, +#ifdef HAVE_CHARSET {ALT ('e'), CK_SelectCodepage, "M-e"}, - {XCTRL ('o'), CK_ShowCommandLine, "C-o"}, +#endif + {XCTRL ('o'), CK_Shell, "C-o"}, {0, CK_Ignore_Key, ""} }; @@ -657,48 +665,48 @@ const global_keymap_t default_viewer_hex_keymap[] = { #ifdef USE_DIFF_VIEW /* diff viewer */ const global_keymap_t default_diff_keymap[] = { - {'s', CK_DiffDisplaySymbols, "s"}, - {'l', CK_DiffDisplayNumbers, "l"}, - {'f', CK_DiffFull, "f"}, - {'=', CK_DiffEqual, "="}, - {'>', CK_DiffSplitMore, ">"}, - {'<', CK_DiffSplitLess, "<"}, - {'2', CK_DiffSetTab2, "2"}, - {'3', CK_DiffSetTab3, "3"}, - {'4', CK_DiffSetTab4, "4"}, - {'8', CK_DiffSetTab8, "8"}, - {XCTRL ('u'), CK_DiffSwapPanel, "C-u"}, - {XCTRL ('r'), CK_DiffRedo, "C-r"}, - {XCTRL ('o'), CK_ShowCommandLine, "C-o"}, - {'n', CK_DiffNextHunk, "n"}, - {'p', CK_DiffPrevHunk, "p"}, - {'g', CK_DiffGoto, "g"}, - {'G', CK_DiffGoto, "G"}, - {KEY_M_CTRL | KEY_HOME, CK_DiffBOF, "C-Home"}, - {KEY_M_CTRL | KEY_END, CK_DiffEOF, "C-End"}, - {KEY_DOWN, CK_DiffDown, "Down"}, - {KEY_UP, CK_DiffUp, "Up"}, - {KEY_M_CTRL | KEY_LEFT, CK_DiffQuickLeft, "C-Left"}, - {KEY_M_CTRL | KEY_RIGHT, CK_DiffQuickRight, "C-Right"}, - {KEY_LEFT, CK_DiffLeft, "Left"}, - {KEY_RIGHT, CK_DiffRight, "Right"}, - {KEY_NPAGE, CK_DiffPageDown, "Down"}, - {KEY_PPAGE, CK_DiffPageUp, "Up"}, - {KEY_HOME, CK_DiffHome, "Home"}, - {KEY_END, CK_DiffEnd, "End"}, - {'q', CK_DiffQuit, "q"}, - {'Q', CK_DiffQuit, "Q"}, - {XCTRL ('g'), CK_DiffQuit, "C-g"}, - {ESC_CHAR, CK_DiffQuit, "Esc"}, + {'s', CK_ShowSymbols, "s"}, + {'l', CK_ShowNumbers, "l"}, + {'f', CK_SplitFull, "f"}, + {'=', CK_SplitEqual, "="}, + {'>', CK_SplitMore, ">"}, + {'<', CK_SplitLess, "<"}, + {'2', CK_Tab2, "2"}, + {'3', CK_Tab3, "3"}, + {'4', CK_Tab4, "4"}, + {'8', CK_Tab8, "8"}, + {XCTRL ('u'), CK_Swap, "C-u"}, + {XCTRL ('r'), CK_Redo, "C-r"}, + {XCTRL ('o'), CK_Shell, "C-o"}, + {'n', CK_HunkNext, "n"}, + {'p', CK_HunkPrev, "p"}, + {'g', CK_Goto, "g"}, + {'G', CK_Goto, "G"}, + {KEY_M_CTRL | KEY_HOME, CK_Top, "C-Home"}, + {KEY_M_CTRL | KEY_END, CK_Bottom, "C-End"}, + {KEY_DOWN, CK_Down, "Down"}, + {KEY_UP, CK_Up, "Up"}, + {KEY_M_CTRL | KEY_LEFT, CK_LeftQuick, "C-Left"}, + {KEY_M_CTRL | KEY_RIGHT, CK_RightQuick, "C-Right"}, + {KEY_LEFT, CK_Left, "Left"}, + {KEY_RIGHT, CK_Right, "Right"}, + {KEY_NPAGE, CK_PageDown, "PgDn"}, + {KEY_PPAGE, CK_PageUp, "PgUp"}, + {KEY_HOME, CK_Home, "Home"}, + {KEY_END, CK_End, "End"}, + {'q', CK_Quit, "q"}, + {'Q', CK_Quit, "Q"}, + {XCTRL ('g'), CK_Quit, "C-g"}, + {ESC_CHAR, CK_Quit, "Esc"}, - {KEY_F (1), CK_DiffHelp, "F1"}, - {KEY_F (4), CK_DiffEditCurrent, "F4"}, - {KEY_F (5), CK_DiffMergeCurrentHunk, "F5"}, - {KEY_F (7), CK_DiffSearch, "F7"}, - {KEY_F (17), CK_DiffContinueSearch, "S-F7"}, - {KEY_F (9), CK_DiffOptions, "F9"}, - {KEY_F (10), CK_DiffQuit, "F10"}, - {KEY_F (14), CK_DiffEditOther, "S-F4"}, + {KEY_F (1), CK_Help, "F1"}, + {KEY_F (4), CK_Edit, "F4"}, + {KEY_F (5), CK_Merge, "F5"}, + {KEY_F (7), CK_Search, "F7"}, + {KEY_F (17), CK_SearchContinue, "S-F7"}, + {KEY_F (9), CK_Options, "F9"}, + {KEY_F (10), CK_Quit, "F10"}, + {KEY_F (14), CK_EditOther, "S-F4"}, {0, CK_Ignore_Key, ""} }; diff --git a/src/viewer/actions_cmd.c b/src/viewer/actions_cmd.c index 68bba803d..fe0c3cc94 100644 --- a/src/viewer/actions_cmd.c +++ b/src/viewer/actions_cmd.c @@ -249,22 +249,22 @@ mcview_execute_cmd (mcview_t * view, unsigned long command) switch (command) { - case CK_ViewHelp: + case CK_Help: interactive_display (NULL, "[Internal File Viewer]"); break; - case CK_ViewToggleWrapMode: + case CK_WrapMode: /* Toggle between wrapped and unwrapped view */ mcview_toggle_wrap_mode (view); break; - case CK_ViewToggleHexEditMode: + case CK_HexEditMode: /* Toggle between hexview and hexedit mode */ mcview_toggle_hexedit_mode (view); break; - case CK_ViewToggleHexMode: + case CK_HexMode: /* Toggle between hex view and text view */ mcview_toggle_hex_mode (view); break; - case CK_ViewGoto: + case CK_Goto: { off_t addr; @@ -280,100 +280,102 @@ mcview_execute_cmd (mcview_t * view, unsigned long command) } break; } - case CK_ViewHexEditSave: + case CK_Save: mcview_hexedit_save_changes (view); break; - case CK_ViewSearch: + case CK_Search: mcview_search (view); break; - case CK_ViewToggleMagicMode: + case CK_MagicMode: mcview_toggle_magic_mode (view); break; - case CK_ViewToggleNroffMode: + case CK_NroffMode: mcview_toggle_nroff_mode (view); break; - case CK_ViewToggleHexNavMode: + case CK_ToggleNavigation: view->hexview_in_text = !view->hexview_in_text; view->dirty++; break; - case CK_ViewMoveToBol: + case CK_Home: mcview_moveto_bol (view); break; - case CK_ViewMoveToEol: + case CK_End: mcview_moveto_eol (view); break; - case CK_ViewMoveLeft: + case CK_Left: mcview_move_left (view, 1); break; - case CK_ViewMoveRight: + case CK_Right: mcview_move_right (view, 1); break; - case CK_ViewMoveLeft10: + case CK_LeftQuick: if (!view->hex_mode) mcview_move_left (view, 10); break; - case CK_ViewMoveRight10: + case CK_RightQuick: if (!view->hex_mode) mcview_move_right (view, 10); break; - case CK_ViewContinueSearch: + case CK_SearchContinue: mcview_continue_search_cmd (view); break; - case CK_ViewToggleRuler: + case CK_Ruler: mcview_display_toggle_ruler (view); break; - case CK_ViewMoveUp: + case CK_Up: mcview_move_up (view, 1); break; - case CK_ViewMoveDown: + case CK_Down: mcview_move_down (view, 1); break; - case CK_ViewMoveHalfPgUp: + case CK_HalfPageUp: mcview_move_up (view, (view->data_area.height + 1) / 2); break; - case CK_ViewMoveHalfPgDn: + case CK_HalfPageDown: mcview_move_down (view, (view->data_area.height + 1) / 2); break; - case CK_ViewMovePgUp: + case CK_PageUp: mcview_move_up (view, view->data_area.height); break; - case CK_ViewMovePgDn: + case CK_PageDown: mcview_move_down (view, view->data_area.height); break; - case CK_ViewMoveTop: + case CK_Top: mcview_moveto_top (view); break; - case CK_ViewMoveBottom: + case CK_Bottom: mcview_moveto_bottom (view); break; - case CK_ShowCommandLine: + case CK_Shell: view_other_cmd (); break; - /* - // Unlike Ctrl-O, run a new shell if the subshell is not running - case '!': - exec_shell (); - return MSG_HANDLED; - */ - case CK_ViewGotoBookmark: +#if 0 + /* Unlike Ctrl-O, run a new shell if the subshell is not running */ + case '!': + exec_shell (); + return MSG_HANDLED; +#endif + case CK_BookmarkGoto: view->marks[view->marker] = view->dpy_start; break; - case CK_ViewNewBookmark: + case CK_Bookmark: view->dpy_start = view->marks[view->marker]; view->dirty++; break; +#ifdef HAVE_CHARSET case CK_SelectCodepage: mcview_select_encoding (view); view->dirty++; break; - case CK_ViewNextFile: - case CK_ViewPrevFile: +#endif + case CK_FileNext: + case CK_FilePrev: /* Use to indicate parent that we want to see the next/previous file */ /* Does not work in panel mode */ if (!mcview_is_in_panel (view)) - view->move_dir = (command == CK_ViewNextFile) ? 1 : -1; + view->move_dir = (command == CK_FileNext) ? 1 : -1; /* fallthrough */ - case CK_ViewQuit: + case CK_Quit: if (!mcview_is_in_panel (view)) dlg_stop (view->widget.owner); break; diff --git a/src/viewer/lib.c b/src/viewer/lib.c index 330ab4e47..7cdcbe769 100644 --- a/src/viewer/lib.c +++ b/src/viewer/lib.c @@ -315,9 +315,7 @@ mcview_select_encoding (mcview_t * view) { #ifdef HAVE_CHARSET if (do_select_codepage ()) - { mcview_set_codeset (view); - } #else (void) view; #endif From 1374340aa2982b9ff0e53a61980a06f359dd46b9 Mon Sep 17 00:00:00 2001 From: Andrew Borodin Date: Fri, 18 Mar 2011 11:58:33 +0300 Subject: [PATCH 3/9] Fixup of shift-arrow mark in editor. Signed-off-by: Andrew Borodin --- src/editor/edit.c | 32 ++++++++++++++++++++++++++------ 1 file changed, 26 insertions(+), 6 deletions(-) diff --git a/src/editor/edit.c b/src/editor/edit.c index 97596f91d..fb4e173f7 100644 --- a/src/editor/edit.c +++ b/src/editor/edit.c @@ -3441,18 +3441,38 @@ edit_execute_cmd (WEdit * edit, unsigned long command, int char_for_insertion) if (edit->found_len || edit->column_highlight) edit->force |= REDRAW_PAGE; - if (command / 100 == 6) - { /* a highlight command like shift-arrow */ + switch (command) + { + /* a mark command with shift-arrow */ + case CK_MarkLeft: + case CK_MarkRight: + case CK_MarkToWordBegin: + case CK_MarkToWordEnd: + case CK_MarkToHome: + case CK_MarkToEnd: + case CK_MarkUp: + case CK_MarkDown: + case CK_MarkPageUp: + case CK_MarkPageDown: + case CK_MarkToFileBegin: + case CK_MarkToFileEnd: + case CK_MarkToPageBegin: + case CK_MarkToPageEnd: + case CK_MarkScrollUp: + case CK_MarkScrollDown: + case CK_MarkParagraphUp: + case CK_MarkParagraphDown: edit->column_highlight = 0; - if (!edit->highlight || (edit->mark2 != -1 && edit->mark1 != edit->mark2)) + if (edit->highlight == 0 || (edit->mark2 != -1 && edit->mark1 != edit->mark2)) { edit_mark_cmd (edit, 1); /* clear */ edit_mark_cmd (edit, 0); /* marking on */ } edit->highlight = 1; - } - else - { /* any other command */ + break; + + /* any other command */ + default: if (edit->highlight) edit_mark_cmd (edit, 0); /* clear */ edit->highlight = 0; From 722121a57505c6cf9fd98ba16fa1c0778ad8fca1 Mon Sep 17 00:00:00 2001 From: Andrew Borodin Date: Sun, 20 Feb 2011 18:23:32 +0300 Subject: [PATCH 4/9] Define keybind numbers using enum. Signed-off-by: Andrew Borodin --- doc/man/mcedit.1.in | 10 +- lib/keybind.c | 10 +- lib/keybind.h | 570 ++++++++++++++++++------------------- lib/widget/buttonbar.c | 4 +- lib/widget/dialog.c | 2 +- lib/widget/input.c | 4 +- lib/widget/listbox.c | 2 +- lib/widget/menu.c | 16 +- src/diffviewer/ydiff.c | 2 +- src/editor/editcmd.c | 2 +- src/editor/editkeys.c | 8 +- src/filemanager/midnight.c | 4 +- src/help.c | 2 +- src/keybind-defaults.c | 26 +- src/viewer/actions_cmd.c | 4 +- 15 files changed, 331 insertions(+), 335 deletions(-) diff --git a/doc/man/mcedit.1.in b/doc/man/mcedit.1.in index 22261e3d5..1acdc00cf 100644 --- a/doc/man/mcedit.1.in +++ b/doc/man/mcedit.1.in @@ -117,18 +117,18 @@ like following: .PP .nf [editor] -ctrl\-W=EditPipeBlock:25; +ctrl\-W=ExecuteScript:25; .fi .PP This means that ctrl\-W hotkey initiates the -.I EditPipeBlock(25) -action, next the editor handler translates this into execution of +.I ExecuteScript(25) +action, then editor handler translates this into execution of .B ~/.local/share/mc/mcedit/macros.d/macro.25.sh shell script. .PP -External scripts stored into +External scripts are stored in .B ~/.local/share/mc/mcedit/macros.d/ -directory and must named +directory and must be named as .B macro.XXXX.sh where .B XXXX diff --git a/lib/keybind.c b/lib/keybind.c index e81938765..1cdba94cc 100644 --- a/lib/keybind.c +++ b/lib/keybind.c @@ -301,6 +301,8 @@ static name_keymap_t command_names[] = { {"ShowMargin", CK_ShowMargin}, {"OptionsSaveMode", CK_OptionsSaveMode}, {"About", CK_About}, + /* An action to run external script from macro */ + {"ExecuteScript", CK_PipeBlock (0)}, #endif /* USE_INTERNAL_EDIT */ /* viewer */ @@ -329,7 +331,7 @@ static name_keymap_t command_names[] = { {"Merge", CK_Merge}, #endif /* USE_DIFF_VIEW */ - {NULL, CK_Ignore_Key} + {NULL, CK_IgnoreKey} }; static const size_t num_command_names = G_N_ELEMENTS (command_names) - 1; @@ -366,7 +368,7 @@ sort_command_names (void) static void keymap_add (GArray * keymap, long key, unsigned long cmd, const char *caption) { - if (key != 0 && cmd != CK_Ignore_Key) + if (key != 0 && cmd != CK_IgnoreKey) { global_keymap_t new_bind; @@ -405,7 +407,7 @@ keybind_lookup_action (const char *name) res = bsearch (&key, command_names, num_command_names, sizeof (command_names[0]), name_keymap_comparator); - return (res != NULL) ? res->val : CK_Ignore_Key; + return (res != NULL) ? res->val : CK_IgnoreKey; } /* --------------------------------------------------------------------------------------------- */ @@ -447,7 +449,7 @@ keybind_lookup_keymap_command (const global_keymap_t * keymap, long key) if (keymap[i].key == key) return keymap[i].command; - return CK_Ignore_Key; + return CK_IgnoreKey; } /* --------------------------------------------------------------------------------------------- */ diff --git a/lib/keybind.h b/lib/keybind.h index 0d3598fb0..3532d77d8 100644 --- a/lib/keybind.h +++ b/lib/keybind.h @@ -10,299 +10,293 @@ #define KEYMAP_SHORTCUT_LENGTH 32 /* FIXME: is 32 bytes enough for shortcut? */ -/* special commands */ -#define CK_Insert_Char -1 -#define CK_Ignore_Key 0 - -/* common */ -#define CK_Enter 3 -#define CK_Up 10 -#define CK_Down 11 -#define CK_Left 6 -#define CK_Right 7 -#define CK_Home 12 -#define CK_End 13 -#define CK_LeftQuick 9027 -#define CK_RightQuick 9028 -#define CK_PageUp 4 -#define CK_PageDown 5 -#define CK_HalfPageUp 1015 -#define CK_HalfPageDown 1014 -#define CK_Top 17 -#define CK_Bottom 18 -#define CK_TopOnScreen 8019 -#define CK_MiddleOnScreen 8018 -#define CK_BottomOnScreen 8017 -#define CK_WordLeft 8 -#define CK_WordRight 9 -#define CK_Copy 202 -#define CK_Move 203 -#define CK_Delete 2 -#define CK_MakeDir 7045 -#define CK_ChangeMode 7003 -#define CK_ChangeOwn 7005 -#define CK_ChangeOwnAdvanced 7004 -#define CK_Remove 204 -#define CK_BackSpace 1 -#define CK_Redo 16 -#define CK_Clear 4026 -#define CK_Menu 123 -#define CK_MenuLastSelected 7044 -#define CK_UserMenu 425 -#define CK_EditUserMenu 7026 -#define CK_Search 8032 -#define CK_SearchContinue 5011 -#define CK_Replace 303 -#define CK_ReplaceContinue 304 -#define CK_SearchStop 8033 -#define CK_Help 404 -#define CK_Edit 7020 -#define CK_Shell 801 -#ifdef HAVE_CHARSET -#define CK_SelectCodepage 2002 -#endif -#define CK_History 4021 -#define CK_HistoryNext 4022 -#define CK_HistoryPrev 4023 -#define CK_Complete 305 -#define CK_SaveAs 104 -#define CK_Goto 407 -#define CK_Reread 7053 -#define CK_Refresh 406 -#define CK_Suspend 7060 -#define CK_Swap 7061 -#define CK_HotList 7048 -#define CK_ScreenList 7079 -#define CK_ScreenNext 7080 -#define CK_ScreenPrev 7081 -#define CK_FilePrev 111 -#define CK_FileNext 112 -#define CK_DeleteToWordBegin 24 -#define CK_DeleteToWordEnd 25 -#define CK_ShowNumbers 490 -#define CK_Store 701 -#define CK_Cut 702 -#define CK_Paste 703 -#define CK_Mark 201 -#define CK_MarkLeft 606 -#define CK_MarkRight 607 -#define CK_MarkUp 8021 -#define CK_MarkDown 8022 -#define CK_MarkToWordBegin 608 -#define CK_MarkToWordEnd 609 -#define CK_MarkToHome 612 -#define CK_MarkToEnd 613 -#define CK_ToggleNavigation 5027 -#define CK_Sort 412 -#define CK_Options 7007 -#define CK_LearnKeys 7037 -#define CK_Bookmark 5013 -#define CK_Quit 402 -#define CK_QuitQuiet 7050 -/* C-x or similar */ -#define CK_ExtendedKeyMap 820 - -/* main commands */ -#ifdef USE_INTERNAL_EDIT -#define CK_EditForceInternal 7082 -#endif -#define CK_View 7071 -#define CK_ViewRaw 8011 -#define CK_ViewFile 7072 -#define CK_ViewFiltered 7029 -#define CK_Find 419 -#define CK_DirSize 7058 -#define CK_HotListAdd 7001 -#define CK_PanelListingChange 7002 -#define CK_CompareDirs 7006 -#define CK_OptionsVfs 7008 -#define CK_OptionsConfirm 7009 -#define CK_PutCurrentLink 7012 -#define CK_PutOtherLink 7015 -#define CK_OptionsDisplayBits 7019 -#define CK_EditExtensionsFile 7021 -#define CK_EditFileHighlightFile 7022 -#define CK_LinkSymbolicEdit 7024 -#define CK_ExternalPanelize 7027 -#define CK_Filter 7028 -#define CK_ConnectFish 7031 -#define CK_ConnectFtp 7032 -#define CK_ConnectSmb 7059 -#define CK_PanelInfo 7034 -#define CK_Jobs 7035 -#define CK_OptionsLayout 7036 -#define CK_Link 7038 -#define CK_PanelListing 7039 -#define CK_ListMode 7042 -#define CK_CdQuick 7047 -#define CK_PanelQuickView 7049 -#define CK_VfsList 7054 -#define CK_SaveSetup 7056 -#define CK_LinkSymbolic 7062 -#define CK_PanelListingSwitch 7063 -#define CK_ShowHidden 7064 -#define CK_PanelTree 7065 -#define CK_Tree 7066 -#define CK_Undelete 7067 -#define CK_SplitVertHoriz 7075 -#ifdef USE_DIFF_VIEW -#define CK_CompareFiles 7076 -#endif /* USE_DIFF_VIEW */ -#define CK_OptionsPanel 7077 -#define CK_LinkSymbolicRelative 7078 -#define CK_PutCurrentPath 7011 -#define CK_PutOtherPath 7014 -#define CK_PutCurrentTagged 7013 -#define CK_PutOtherTagged 7016 -#define CK_Select 7057 -#define CK_Unselect 7068 -#define CK_SelectInvert 7055 - -/* panels */ -#define CK_PanelOtherCd 8001 -#define CK_PanelOtherCdLink 8002 -#define CK_CopySingle 8003 -#define CK_MoveSingle 8007 -#define CK_DeleteSingle 8004 -#define CK_CdChild 8012 -#define CK_CdParent 8013 -#define CK_CdParentSmart 8043 -#define CK_PanelOtherSync 8034 -#define CK_SortNext 8035 -#define CK_SortPrev 8036 -#define CK_SortReverse 8038 -#define CK_SortByName 8039 -#define CK_SortByExt 8040 -#define CK_SortBySize 8041 -#define CK_SortByMTime 8042 - -/* dialog */ -#define CK_Ok 3001 -#define CK_Cancel 3002 - -/* input */ -#define CK_Yank 4018 - -/* help */ -#define CK_Index 1002 -#define CK_Back 1003 -#define CK_LinkNext 1008 -#define CK_LinkPrev 1009 -#define CK_NodeNext 1010 -#define CK_NodePrev 1011 - -/* tree */ -#define CK_Forget 6003 - -#ifdef USE_INTERNAL_EDIT -/* cursor movements */ -#define CK_Tab 14 -#define CK_Undo 15 -#define CK_ScrollUp 19 -#define CK_ScrollDown 20 -#define CK_Return 21 -#define CK_ParagraphUp 26 -#define CK_ParagraphDown 27 -/* file commands */ -#define CK_Save 101 -#define CK_EditFile 102 -#define CK_EditNew 103 -#define CK_EditSyntaxFile 121 -/* block commands */ -#define CK_Unmark 206 -#define CK_BlockSave 207 -#define CK_MarkColumn 208 -#define CK_BlockShiftLeft 211 -#define CK_BlockShiftRight 212 -#define CK_MarkAll 213 -#define CK_MarkWord 214 -#define CK_MarkLine 215 -#define CK_InsertFile 401 -#define CK_InsertOverwrite 403 -#define CK_Date 405 -#define CK_DeleteLine 408 -#define CK_DeleteToHome 409 -#define CK_DeleteToEnd 410 -#define CK_Mail 413 -#define CK_ParagraphFormat 416 -#define CK_MatchBracket 421 -#define CK_ExternalCommand 424 -#define CK_OptionsSaveMode 428 -#define CK_About 430 -#define CK_ShowMargin 460 -#define CK_ShowTabTws 470 -#define CK_SyntaxOnOff 480 -#define CK_SyntaxChoose 429 -#define CK_InsertLiteral 851 -/* bookmarks */ -#define CK_BookmarkFlush 551 -#define CK_BookmarkNext 552 -#define CK_BookmarkPrev 553 -/* mark commands */ -#define CK_MarkPageUp 604 -#define CK_MarkPageDown 605 -#define CK_MarkToFileBegin 614 -#define CK_MarkToFileEnd 615 -#define CK_MarkToPageBegin 616 -#define CK_MarkToPageEnd 617 -#define CK_MarkScrollUp 618 -#define CK_MarkScrollDown 619 -#define CK_MarkParagraphUp 620 -#define CK_MarkParagraphDown 621 -/* column mark commands */ -#define CK_MarkColumnPageUp 654 -#define CK_MarkColumnPageDown 655 -#define CK_MarkColumnLeft 656 -#define CK_MarkColumnRight 657 -#define CK_MarkColumnUp 660 -#define CK_MarkColumnDown 661 -#define CK_MarkColumnScrollUp 668 -#define CK_MarkColumnScrollDown 669 -#define CK_MarkColumnParagraphUp 670 -#define CK_MarkColumnParagraphDown 671 -/* macros */ -#define CK_MacroStartRecord 501 -#define CK_MacroStopRecord 502 -#define CK_MacroStartStopRecord 853 -#define CK_MacroExecute 852 -#define CK_MacroDelete 503 -#define CK_RepeatStartStopRecord 854 -#define CK_RepeatStartRecord 855 -#define CK_RepeatStopRecord 856 -#endif /* USE_INTERNAL_EDIT */ - -/* viewer */ -#define CK_WrapMode 5002 -#define CK_HexEditMode 5003 -#define CK_HexMode 5004 -#define CK_MagicMode 5008 -#define CK_NroffMode 5009 -#define CK_BookmarkGoto 5012 -#define CK_Ruler 5026 - -#ifdef USE_DIFF_VIEW -/* diff viewer */ -#define CK_ShowSymbols 9001 -#define CK_SplitFull 9003 -#define CK_SplitEqual 9004 -#define CK_SplitMore 9005 -#define CK_SplitLess 9006 -#define CK_Tab2 9009 -#define CK_Tab3 9010 -#define CK_Tab4 9011 -#define CK_Tab8 9012 -#define CK_HunkNext 9015 -#define CK_HunkPrev 9016 -#define CK_EditOther 9019 -#define CK_Merge 9035 -#endif /* USE_DIFF_VIEW */ - #define CK_PipeBlock(i) (10000+(i)) #define CK_Macro(i) (20000+(i)) -#define CK_Last_Macro CK_Macro(0x7FFF) +#define CK_MacroLast CK_Macro(0x7FFF) /*** enums ***************************************************************************************/ +enum +{ + /* special commands */ + CK_InsertChar = -1, + CK_IgnoreKey = 0, + + /* common */ + CK_Enter = 1, + CK_Up, + CK_Down, + CK_Left, + CK_Right, + CK_Home, + CK_End, + CK_LeftQuick, + CK_RightQuick, + CK_PageUp, + CK_PageDown, + CK_HalfPageUp, + CK_HalfPageDown, + CK_Top, + CK_Bottom, + CK_TopOnScreen, + CK_MiddleOnScreen, + CK_BottomOnScreen, + CK_WordLeft, + CK_WordRight, + CK_Copy, + CK_Move, + CK_Delete, + CK_MakeDir, + CK_ChangeMode, + CK_ChangeOwn, + CK_ChangeOwnAdvanced, + CK_Remove, + CK_BackSpace, + CK_Redo, + CK_Clear, + CK_Menu, + CK_MenuLastSelected, + CK_UserMenu, + CK_EditUserMenu, + CK_Search, + CK_SearchContinue, + CK_Replace, + CK_ReplaceContinue, + CK_SearchStop, + CK_Help, + CK_Edit, + CK_Shell, + CK_SelectCodepage, + CK_History, + CK_HistoryNext, + CK_HistoryPrev, + CK_Complete, + CK_SaveAs, + CK_Goto, + CK_Reread, + CK_Refresh, + CK_Suspend, + CK_Swap, + CK_Mark, + CK_HotList, + CK_ScreenList, + CK_ScreenNext, + CK_ScreenPrev, + CK_FilePrev, + CK_FileNext, + CK_DeleteToWordBegin, + CK_DeleteToWordEnd, + CK_ShowNumbers, + CK_Store, + CK_Cut, + CK_Paste, + CK_MarkLeft, + CK_MarkRight, + CK_MarkUp, + CK_MarkDown, + CK_MarkToWordBegin, + CK_MarkToWordEnd, + CK_MarkToHome, + CK_MarkToEnd, + CK_ToggleNavigation, + CK_Sort, + CK_Options, + CK_LearnKeys, + CK_Bookmark, + CK_Quit, + CK_QuitQuiet, + /* C-x or similar */ + CK_ExtendedKeyMap, + + /* main commands */ + CK_EditForceInternal = 100, + CK_View, + CK_ViewRaw, + CK_ViewFile, + CK_ViewFiltered, + CK_Find, + CK_DirSize, + CK_HotListAdd, + CK_PanelListingChange, + CK_CompareDirs, + CK_OptionsVfs, + CK_OptionsConfirm, + CK_PutCurrentLink, + CK_PutOtherLink, + CK_OptionsDisplayBits, + CK_EditExtensionsFile, + CK_EditFileHighlightFile, + CK_LinkSymbolicEdit, + CK_ExternalPanelize, + CK_Filter, + CK_ConnectFish, + CK_ConnectFtp, + CK_ConnectSmb, + CK_PanelInfo, + CK_Jobs, + CK_OptionsLayout, + CK_Link, + CK_PanelListing, + CK_ListMode, + CK_CdQuick, + CK_PanelQuickView, + CK_VfsList, + CK_SaveSetup, + CK_LinkSymbolic, + CK_PanelListingSwitch, + CK_ShowHidden, + CK_PanelTree, + CK_Tree, + CK_Undelete, + CK_SplitVertHoriz, + CK_CompareFiles, + CK_OptionsPanel, + CK_LinkSymbolicRelative, + CK_PutCurrentPath, + CK_PutOtherPath, + CK_PutCurrentTagged, + CK_PutOtherTagged, + CK_Select, + CK_Unselect, + CK_SelectInvert, + + /* panels */ + CK_PanelOtherCd = 200, + CK_PanelOtherCdLink, + CK_CopySingle, + CK_MoveSingle, + CK_DeleteSingle, + CK_CdChild, + CK_CdParent, + CK_CdParentSmart, + CK_PanelOtherSync, + CK_SortNext, + CK_SortPrev, + CK_SortReverse, + CK_SortByName, + CK_SortByExt, + CK_SortBySize, + CK_SortByMTime, + + /* dialog */ + CK_Ok = 300, + CK_Cancel, + + /* input */ + CK_Yank = 350, + + /* help */ + CK_Index = 400, + CK_Back, + CK_LinkNext, + CK_LinkPrev, + CK_NodeNext, + CK_NodePrev, + + /* tree */ + CK_Forget = 450, + + /* editor */ + /* cursor movements */ + CK_Tab = 500, + CK_Undo, + CK_ScrollUp, + CK_ScrollDown, + CK_Return, + CK_ParagraphUp, + CK_ParagraphDown, + /* file commands */ + CK_Save, + CK_EditFile, + CK_EditNew, + CK_InsertFile, + CK_EditSyntaxFile, + /* block commands */ + CK_BlockSave, + CK_BlockShiftLeft, + CK_BlockShiftRight, + CK_DeleteLine, + CK_DeleteToHome, + CK_DeleteToEnd, + /* bookmarks */ + CK_BookmarkFlush, + CK_BookmarkNext, + CK_BookmarkPrev, + /* mark commands */ + CK_MarkColumn, + CK_MarkWord, + CK_MarkLine, + CK_MarkAll, + CK_Unmark, + CK_MarkPageUp, + CK_MarkPageDown, + CK_MarkToFileBegin, + CK_MarkToFileEnd, + CK_MarkToPageBegin, + CK_MarkToPageEnd, + CK_MarkScrollUp, + CK_MarkScrollDown, + CK_MarkParagraphUp, + CK_MarkParagraphDown, + /* column mark commands */ + CK_MarkColumnPageUp, + CK_MarkColumnPageDown, + CK_MarkColumnLeft, + CK_MarkColumnRight, + CK_MarkColumnUp, + CK_MarkColumnDown, + CK_MarkColumnScrollUp, + CK_MarkColumnScrollDown, + CK_MarkColumnParagraphUp, + CK_MarkColumnParagraphDown, + /* macros */ + CK_MacroStartRecord, + CK_MacroStopRecord, + CK_MacroStartStopRecord, + CK_MacroDelete, + CK_RepeatStartRecord, + CK_RepeatStopRecord, + CK_RepeatStartStopRecord, + /* misc commands */ + CK_InsertOverwrite, + CK_ParagraphFormat, + CK_MatchBracket, + CK_OptionsSaveMode, + CK_About, + CK_ShowMargin, + CK_ShowTabTws, + CK_SyntaxOnOff, + CK_SyntaxChoose, + CK_InsertLiteral, + CK_ExternalCommand, + CK_Date, + CK_Mail, + + /* viewer */ + CK_WrapMode = 600, + CK_MagicMode, + CK_NroffMode, + CK_HexMode, + CK_HexEditMode, + CK_BookmarkGoto, + CK_Ruler, + + /* diff viewer */ + CK_ShowSymbols = 700, + CK_SplitFull, + CK_SplitEqual, + CK_SplitMore, + CK_SplitLess, + CK_Tab2, + CK_Tab3, + CK_Tab4, + CK_Tab8, + CK_HunkNext, + CK_HunkPrev, + CK_EditOther, + CK_Merge +}; + /*** structures declarations (and typedefs of structures)*****************************************/ typedef struct name_keymap_t diff --git a/lib/widget/buttonbar.c b/lib/widget/buttonbar.c index 18cf7a05b..8cbc2aa84 100644 --- a/lib/widget/buttonbar.c +++ b/lib/widget/buttonbar.c @@ -146,7 +146,7 @@ buttonbar_call (WButtonBar * bb, int i) { cb_ret_t ret = MSG_NOT_HANDLED; - if ((bb != NULL) && (bb->labels[i].command != CK_Ignore_Key)) + if ((bb != NULL) && (bb->labels[i].command != CK_IgnoreKey)) ret = bb->widget.owner->callback (bb->widget.owner, (Widget *) bb, DLG_ACTION, bb->labels[i].command, bb->labels[i].receiver); @@ -256,7 +256,7 @@ buttonbar_set_label (WButtonBar * bb, int idx, const char *text, { if ((bb != NULL) && (idx >= 1) && (idx <= BUTTONBAR_LABELS_NUM)) { - unsigned long command = CK_Ignore_Key; + unsigned long command = CK_IgnoreKey; if (keymap != NULL) command = keybind_lookup_keymap_command (keymap, KEY_F (idx)); diff --git a/lib/widget/dialog.c b/lib/widget/dialog.c index cbc210010..4181da4c1 100644 --- a/lib/widget/dialog.c +++ b/lib/widget/dialog.c @@ -310,7 +310,7 @@ dlg_handle_key (Dlg_head * h, int d_key) { unsigned long command; command = keybind_lookup_keymap_command (dialog_map, d_key); - if ((command == CK_Ignore_Key) || (dlg_execute_cmd (h, command) == MSG_NOT_HANDLED)) + if ((command == CK_IgnoreKey) || (dlg_execute_cmd (h, command) == MSG_NOT_HANDLED)) return MSG_NOT_HANDLED; else return MSG_HANDLED; diff --git a/lib/widget/input.c b/lib/widget/input.c index 6b697bbc4..ddd3afd88 100644 --- a/lib/widget/input.c +++ b/lib/widget/input.c @@ -1115,7 +1115,7 @@ input_handle_char (WInput * in, int key) command = keybind_lookup_keymap_command (input_map, key); - if (command == CK_Ignore_Key) + if (command == CK_IgnoreKey) { if (key > 255) return MSG_NOT_HANDLED; @@ -1151,7 +1151,7 @@ input_key_is_in_map (WInput * in, int key) (void) in; command = keybind_lookup_keymap_command (input_map, key); - if (command == CK_Ignore_Key) + if (command == CK_IgnoreKey) return 0; return (command == CK_Complete) ? 2 : 1; diff --git a/lib/widget/listbox.c b/lib/widget/listbox.c index 497368bda..fa0c23d2b 100644 --- a/lib/widget/listbox.c +++ b/lib/widget/listbox.c @@ -308,7 +308,7 @@ listbox_key (WListbox * l, int key) } command = keybind_lookup_keymap_command (listbox_map, key); - if (command == CK_Ignore_Key) + if (command == CK_IgnoreKey) return MSG_NOT_HANDLED; return listbox_execute_cmd (l, command); } diff --git a/lib/widget/menu.c b/lib/widget/menu.c index f449324fe..ad513cf72 100644 --- a/lib/widget/menu.c +++ b/lib/widget/menu.c @@ -36,7 +36,7 @@ #include "lib/widget.h" /* TODO: these includes should be removed! */ -#include "src/keybind-defaults.h" /* CK_Ignore_Key */ +#include "src/keybind-defaults.h" /* CK_IgnoreKey */ #include "src/help.h" #include "src/filemanager/midnight.h" /* is_right */ @@ -294,7 +294,7 @@ menubar_execute (WMenuBar * menubar) const Menu *menu = g_list_nth_data (menubar->menu, menubar->selected); const menu_entry_t *entry = g_list_nth_data (menu->entries, menu->selected); - if ((entry != NULL) && (entry->command != CK_Ignore_Key)) + if ((entry != NULL) && (entry->command != CK_IgnoreKey)) { is_right = (menubar->selected != 0); menubar_finish (menubar); @@ -320,7 +320,7 @@ menubar_down (WMenuBar * menubar) menu->selected = (menu->selected + 1) % len; entry = (menu_entry_t *) g_list_nth_data (menu->entries, menu->selected); } - while ((entry == NULL) || (entry->command == CK_Ignore_Key)); + while ((entry == NULL) || (entry->command == CK_IgnoreKey)); menubar_paint_idx (menubar, menu->selected, MENU_SELECTED_COLOR); } @@ -344,7 +344,7 @@ menubar_up (WMenuBar * menubar) menu->selected--; entry = (menu_entry_t *) g_list_nth_data (menu->entries, menu->selected); } - while ((entry == NULL) || (entry->command == CK_Ignore_Key)); + while ((entry == NULL) || (entry->command == CK_IgnoreKey)); menubar_paint_idx (menubar, menu->selected, MENU_SELECTED_COLOR); } @@ -368,7 +368,7 @@ menubar_first (WMenuBar * menubar) { entry = (menu_entry_t *) g_list_nth_data (menu->entries, menu->selected); - if ((entry == NULL) || (entry->command == CK_Ignore_Key)) + if ((entry == NULL) || (entry->command == CK_IgnoreKey)) menu->selected++; else break; @@ -398,7 +398,7 @@ menubar_last (WMenuBar * menubar) menu->selected--; entry = (menu_entry_t *) g_list_nth_data (menu->entries, menu->selected); } - while ((entry == NULL) || (entry->command == CK_Ignore_Key)); + while ((entry == NULL) || (entry->command == CK_IgnoreKey)); menubar_paint_idx (menubar, menu->selected, MENU_SELECTED_COLOR); } @@ -474,7 +474,7 @@ menubar_handle_key (WMenuBar * menubar, int key) { const menu_entry_t *entry = i->data; - if ((entry != NULL) && (entry->command != CK_Ignore_Key) + if ((entry != NULL) && (entry->command != CK_IgnoreKey) && (entry->text.hotkey != NULL) && (key == g_ascii_tolower (entry->text.hotkey[0]))) { menu->selected = g_list_position (menu->entries, i); @@ -686,7 +686,7 @@ menubar_event (Gpm_Event * event, void *data) if ((pos < 0) || (pos >= bottom_y - 3)) return MOU_NORMAL; - if ((entry != NULL) && (entry->command != CK_Ignore_Key)) + if ((entry != NULL) && (entry->command != CK_IgnoreKey)) { menubar_paint_idx (menubar, menu->selected, MENU_ENTRY_COLOR); menu->selected = pos; diff --git a/src/diffviewer/ydiff.c b/src/diffviewer/ydiff.c index f34381b6d..dde6457a9 100644 --- a/src/diffviewer/ydiff.c +++ b/src/diffviewer/ydiff.c @@ -3144,7 +3144,7 @@ dview_handle_key (WDiff * dview, int key) key = convert_from_input_c (key); command = keybind_lookup_keymap_command (diff_map, key); - if ((command != CK_Ignore_Key) && (dview_execute_cmd (dview, command) == MSG_HANDLED)) + if ((command != CK_IgnoreKey) && (dview_execute_cmd (dview, command) == MSG_HANDLED)) return MSG_HANDLED; /* Key not used */ diff --git a/src/editor/editcmd.c b/src/editor/editcmd.c index d1fa746b8..f537db5fc 100644 --- a/src/editor/editcmd.c +++ b/src/editor/editcmd.c @@ -2901,7 +2901,7 @@ edit_print_string (WEdit * e, const char *s) { size_t i = 0; while (s[i] != '\0') - edit_execute_cmd (e, CK_Insert_Char, (unsigned char) s[i++]); + edit_execute_cmd (e, CK_InsertChar, (unsigned char) s[i++]); e->force |= REDRAW_COMPLETELY; edit_update_screen (e); return i; diff --git a/src/editor/editkeys.c b/src/editor/editkeys.c index 0de8a5ce0..9a945473c 100644 --- a/src/editor/editkeys.c +++ b/src/editor/editkeys.c @@ -75,7 +75,7 @@ int edit_translate_key (WEdit * edit, long x_key, int *cmd, int *ch) { - unsigned long command = (unsigned long) CK_Insert_Char; + unsigned long command = (unsigned long) CK_InsertChar; int char_for_insertion = -1; int c; @@ -190,14 +190,14 @@ edit_translate_key (WEdit * edit, long x_key, int *cmd, int *ch) else command = keybind_lookup_keymap_command (editor_map, x_key); - if (command == CK_Ignore_Key) - command = CK_Insert_Char; + if (command == CK_IgnoreKey) + command = CK_InsertChar; fin: *cmd = (int) command; /* FIXME */ *ch = char_for_insertion; - return (command == (unsigned long) CK_Insert_Char && char_for_insertion == -1) ? 0 : 1; + return (command == (unsigned long) CK_InsertChar && char_for_insertion == -1) ? 0 : 1; } /* --------------------------------------------------------------------------------------------- */ diff --git a/src/filemanager/midnight.c b/src/filemanager/midnight.c index 169b893ca..d0f22128f 100644 --- a/src/filemanager/midnight.c +++ b/src/filemanager/midnight.c @@ -1334,7 +1334,7 @@ midnight_callback (Dlg_head * h, Widget * sender, dlg_msg_t msg, int parm, void { ctl_x_map_enabled = FALSE; command = keybind_lookup_keymap_command (main_x_map, parm); - if (command != CK_Ignore_Key) + if (command != CK_IgnoreKey) return midnight_execute_cmd (NULL, command); } @@ -1455,7 +1455,7 @@ midnight_callback (Dlg_head * h, Widget * sender, dlg_msg_t msg, int parm, void else command = keybind_lookup_keymap_command (main_map, parm); - return (command == CK_Ignore_Key) ? MSG_NOT_HANDLED : midnight_execute_cmd (NULL, command); + return (command == CK_IgnoreKey) ? MSG_NOT_HANDLED : midnight_execute_cmd (NULL, command); case DLG_POST_KEY: if (!the_menubar->is_active) diff --git a/src/help.c b/src/help.c index 6fa619b9d..e10b8697f 100644 --- a/src/help.c +++ b/src/help.c @@ -919,7 +919,7 @@ help_handle_key (Dlg_head * h, int c) unsigned long command; command = keybind_lookup_keymap_command (help_map, c); - if ((command == CK_Ignore_Key) || (help_execute_cmd (command) == MSG_NOT_HANDLED)) + if ((command == CK_IgnoreKey) || (help_execute_cmd (command) == MSG_NOT_HANDLED)) return MSG_NOT_HANDLED; help_callback (h, NULL, DLG_DRAW, 0, NULL); diff --git a/src/keybind-defaults.c b/src/keybind-defaults.c index a6bda692b..be7b02d09 100644 --- a/src/keybind-defaults.c +++ b/src/keybind-defaults.c @@ -116,7 +116,7 @@ const global_keymap_t default_main_map[] = { {ALT ('}'), CK_ScreenNext, "M-}"}, {ALT ('{'), CK_ScreenPrev, "M-{"}, - {0, CK_Ignore_Key, ""} + {0, CK_IgnoreKey, ""} }; const global_keymap_t default_main_x_map[] = { @@ -146,7 +146,7 @@ const global_keymap_t default_main_x_map[] = { #ifdef WITH_BACKGROUND {'j', CK_Jobs, "j"}, #endif /* WITH_BACKGROUND */ - {0, CK_Ignore_Key, ""} + {0, CK_IgnoreKey, ""} }; /* panel */ @@ -190,7 +190,7 @@ const global_keymap_t default_panel_keymap[] = { {XCTRL ('s'), CK_Search, "C-s"}, {ALT ('s'), CK_Search, "M-s"}, {ALT ('i'), CK_PanelOtherSync, "M-i"}, - {0, CK_Ignore_Key, ""} + {0, CK_IgnoreKey, ""} }; /* dialog */ @@ -207,7 +207,7 @@ const global_keymap_t default_dialog_keymap[] = { {KEY_F (1), CK_Help, "F1"}, {XCTRL ('z'), CK_Suspend, "C-z"}, {XCTRL ('l'), CK_Refresh, "C-l"}, - {0, CK_Ignore_Key, ""} + {0, CK_IgnoreKey, ""} }; const global_keymap_t default_input_keymap[] = { @@ -255,7 +255,7 @@ const global_keymap_t default_input_keymap[] = { /* Completion */ {ALT ('\t'), CK_Complete, "M-tab"}, - {0, CK_Ignore_Key, ""} + {0, CK_IgnoreKey, ""} }; const global_keymap_t default_listbox_keymap[] = { @@ -277,7 +277,7 @@ const global_keymap_t default_listbox_keymap[] = { {'d', CK_Delete, "d"}, {KEY_M_SHIFT | KEY_DC, CK_Clear, "S-Delete"}, {'D', CK_Clear, "D"}, - {0, CK_Ignore_Key, ""} + {0, CK_IgnoreKey, ""} }; /* tree */ @@ -314,7 +314,7 @@ const global_keymap_t default_tree_keymap[] = { {XCTRL ('s'), CK_Search, "C-s"}, {ALT ('s'), CK_Search, "M-s"}, {KEY_DC, CK_Delete, "Delete"}, - {0, CK_Ignore_Key, ""} + {0, CK_IgnoreKey, ""} }; /* help */ @@ -360,7 +360,7 @@ const global_keymap_t default_help_keymap[] = { {'p', CK_NodePrev, "p"}, {ESC_CHAR, CK_Quit, "Esc"}, {XCTRL ('g'), CK_Quit, "C-g"}, - {0, CK_Ignore_Key, ""} + {0, CK_IgnoreKey, ""} }; #ifdef USE_INTERNAL_EDIT @@ -492,13 +492,13 @@ const global_keymap_t default_editor_keymap[] = { {XCTRL ('x'), CK_ExtendedKeyMap, "C-x"}, - {0, CK_Ignore_Key, ""} + {0, CK_IgnoreKey, ""} }; /* emacs keyboard layout emulation */ const global_keymap_t default_editor_x_keymap[] = { {'k', CK_EditNew, "k"}, - {0, CK_Ignore_Key, ""} + {0, CK_IgnoreKey, ""} }; #endif /* USE_INTERNAL_EDIT */ @@ -589,7 +589,7 @@ const global_keymap_t default_viewer_keymap[] = { #endif {XCTRL ('o'), CK_Shell, "C-o"}, - {0, CK_Ignore_Key, ""} + {0, CK_IgnoreKey, ""} }; const global_keymap_t default_viewer_hex_keymap[] = { @@ -658,7 +658,7 @@ const global_keymap_t default_viewer_hex_keymap[] = { #endif {XCTRL ('o'), CK_Shell, "C-o"}, - {0, CK_Ignore_Key, ""} + {0, CK_IgnoreKey, ""} }; @@ -708,7 +708,7 @@ const global_keymap_t default_diff_keymap[] = { {KEY_F (10), CK_Quit, "F10"}, {KEY_F (14), CK_EditOther, "S-F4"}, - {0, CK_Ignore_Key, ""} + {0, CK_IgnoreKey, ""} }; #endif diff --git a/src/viewer/actions_cmd.c b/src/viewer/actions_cmd.c index fe0c3cc94..00e8cdbc6 100644 --- a/src/viewer/actions_cmd.c +++ b/src/viewer/actions_cmd.c @@ -400,12 +400,12 @@ mcview_handle_key (mcview_t * view, int key) return MSG_HANDLED; command = keybind_lookup_keymap_command (view->hex_map, key); - if ((command != CK_Ignore_Key) && (mcview_execute_cmd (view, command) == MSG_HANDLED)) + if ((command != CK_IgnoreKey) && (mcview_execute_cmd (view, command) == MSG_HANDLED)) return MSG_HANDLED; } command = keybind_lookup_keymap_command (view->plain_map, key); - if ((command != CK_Ignore_Key) && (mcview_execute_cmd (view, command) == MSG_HANDLED)) + if ((command != CK_IgnoreKey) && (mcview_execute_cmd (view, command) == MSG_HANDLED)) return MSG_HANDLED; #ifdef MC_ENABLE_DEBUGGING_CODE From 4fbdbd4456411fbc55f3449157897eba00a8df09 Mon Sep 17 00:00:00 2001 From: Andrew Borodin Date: Mon, 21 Feb 2011 13:49:45 +0300 Subject: [PATCH 5/9] Added --nokeymap command line option to disable load keybindings from file. Signed-off-by: Andrew Borodin Signed-off-by: Slava Zanko --- doc/man/mc.1.in | 3 +++ doc/man/ru/mc.1.in | 8 ++++++-- src/args.c | 12 +++++++++++- src/args.h | 1 + src/main.c | 2 +- src/setup.c | 8 ++++---- src/setup.h | 2 +- 7 files changed, 27 insertions(+), 9 deletions(-) diff --git a/doc/man/mc.1.in b/doc/man/mc.1.in index 7140edb1d..e4f1bd6dd 100644 --- a/doc/man/mc.1.in +++ b/doc/man/mc.1.in @@ -62,6 +62,9 @@ database. Only useful on HP terminals when the function keys don't work. .I \-K file Specify a name of keymap file in the command line. .TP +.I \-\-nokeymap +Don't load key bindings from any file, use default hardcoded keys. +.TP .I \-l file, \-\-ftplog=file Save the ftpfs dialog with the server in file. .TP diff --git a/doc/man/ru/mc.1.in b/doc/man/ru/mc.1.in index 6b38da033..ab246c5e0 100644 --- a/doc/man/ru/mc.1.in +++ b/doc/man/ru/mc.1.in @@ -73,8 +73,12 @@ termcap/terminfo. Этот ключ используется только на функциональные клавиши не работают. .TP .I \-K файл -Задаёт файл клавиатурных команд для переопределения привязки хоткеев -к действиям. +Задаёт файл клавиатурных команд для переопределения привязки клавиатурных +комбинаций к действиям. +.TP +.I \-\-nokeymap +Не загружать клавиатурные комбинации из файла, использовать определённые +в исходном коде. .TP .I \-l файл Сохранить диалог с ftp\-сервером, а также отладочную информацию smbfs в diff --git a/src/args.c b/src/args.c index 3f47e8e8c..9e4c81260 100644 --- a/src/args.c +++ b/src/args.c @@ -69,10 +69,13 @@ gboolean mc_args__disable_colors = FALSE; /* Force colors, only used by Slang */ gboolean mc_args__force_colors = FALSE; +/* Don't load keymap form file and use default one */ +gboolean mc_args__nokeymap = FALSE; + /* Line to start the editor on */ int mc_args__edit_start_line = 0; -/* Show in specified skin */ +/* Use the specified skin */ char *mc_args__skin = NULL; char *mc_args__last_wd_file = NULL; @@ -240,6 +243,13 @@ static const GOptionEntry argument_terminal_table[] = { "" }, + { + "nokeymap", '\0', ARGS_TERM_OPTIONS, G_OPTION_ARG_NONE, + &mc_args__nokeymap, + N_("Don't load definitions of key bindings from file, use defaults"), + NULL + }, + { NULL, '\0', 0, 0, NULL, NULL, NULL /* Complete struct initialization */ } diff --git a/src/args.h b/src/args.h index 66d458f48..4e892b3e9 100644 --- a/src/args.h +++ b/src/args.h @@ -17,6 +17,7 @@ extern gboolean mc_args__slow_terminal; extern gboolean mc_args__ugly_line_drawing; extern gboolean mc_args__disable_colors; extern gboolean mc_args__force_colors; +extern gboolean mc_args__nokeymap; extern char *mc_args__skin; extern gboolean mc_args__version; extern int mc_args__edit_start_line; diff --git a/src/main.c b/src/main.c index ba10e1780..caf2af4b4 100644 --- a/src/main.c +++ b/src/main.c @@ -485,7 +485,7 @@ main (int argc, char *argv[]) /* Removing this from the X code let's us type C-c */ load_key_defs (); - load_keymap_defs (); + load_keymap_defs (!mc_args__nokeymap); macros_list = g_array_new (TRUE, FALSE, sizeof (macros_t)); diff --git a/src/setup.c b/src/setup.c index d396a458b..7cb9250ca 100644 --- a/src/setup.c +++ b/src/setup.c @@ -689,7 +689,6 @@ load_setup_get_keymap_profile_config (void) g_free (fname); /* 4) main config; [Midnight Commander] -> keymap */ - fname2 = mc_config_get_string (mc_main_config, CONFIG_APP_SECTION, "keymap", GLOBAL_KEYMAP_FILE); fname = load_setup_get_full_config_name (NULL, fname2); @@ -1155,15 +1154,16 @@ load_anon_passwd (void) /* --------------------------------------------------------------------------------------------- */ void -load_keymap_defs (void) +load_keymap_defs (gboolean load_from_file) { /* * Load keymap from GLOBAL_KEYMAP_FILE before ${XDG_DATA_HOME}/mc/keymap, so that the user * definitions override global settings. */ - mc_config_t *mc_global_keymap; + mc_config_t *mc_global_keymap = NULL; - mc_global_keymap = load_setup_get_keymap_profile_config (); + if (load_from_file) + mc_global_keymap = load_setup_get_keymap_profile_config (); if (mc_global_keymap != NULL) { diff --git a/src/setup.h b/src/setup.h index 960bdf915..eace2f7d6 100644 --- a/src/setup.h +++ b/src/setup.h @@ -109,7 +109,7 @@ void load_key_defs (void); char *load_anon_passwd (void); #endif /* ENABLE_VFS_FTP */ -void load_keymap_defs (void); +void load_keymap_defs (gboolean load_from_file); void free_keymap_defs (void); void panel_load_setup (WPanel * panel, const char *section); From 35b429f6253897261ab56a28df00fed33f8183e3 Mon Sep 17 00:00:00 2001 From: Andrew Borodin Date: Wed, 23 Feb 2011 12:12:41 +0300 Subject: [PATCH 6/9] Prepare to merge default and user-defined keymaps. default_main_map and default_main_x_map renamed to default_main_keymap and default_main_x_keymap respectively to unified variable names. Editor: setup keymaps only once for all editors. Viewer: share single keymap array for all viewers. Signed-off-by: Andrew Borodin --- src/editor/edit.c | 14 -------------- src/keybind-defaults.c | 6 ++++-- src/keybind-defaults.h | 6 ++++-- src/setup.c | 22 ++++++++++++++++++++-- src/viewer/actions_cmd.c | 4 ++-- src/viewer/display.c | 3 ++- src/viewer/internal.h | 4 ---- src/viewer/mcviewer.c | 15 --------------- 8 files changed, 32 insertions(+), 42 deletions(-) diff --git a/src/editor/edit.c b/src/editor/edit.c index fb4e173f7..8513a9261 100644 --- a/src/editor/edit.c +++ b/src/editor/edit.c @@ -558,19 +558,6 @@ edit_purge_widget (WEdit * edit) /* --------------------------------------------------------------------------------------------- */ -static void -edit_set_keymap (void) -{ - editor_map = default_editor_keymap; - if (editor_keymap && editor_keymap->len > 0) - editor_map = (global_keymap_t *) editor_keymap->data; - - editor_x_map = default_editor_x_keymap; - if (editor_x_keymap && editor_x_keymap->len > 0) - editor_x_map = (global_keymap_t *) editor_x_keymap->data; -} - -/* --------------------------------------------------------------------------------------------- */ /* TODO: if the user undos until the stack bottom, and the stack has not wrapped, then the file should be as it was when he loaded up. Then set edit->modified to 0. @@ -2206,7 +2193,6 @@ edit_init (WEdit * edit, int lines, int columns, const char *filename, long line edit_move_to_line (edit, line - 1); } - edit_set_keymap (); edit_load_macro_cmd (edit); return edit; } diff --git a/src/keybind-defaults.c b/src/keybind-defaults.c index be7b02d09..8de77f621 100644 --- a/src/keybind-defaults.c +++ b/src/keybind-defaults.c @@ -61,6 +61,8 @@ const global_keymap_t *help_map; const global_keymap_t *editor_map; const global_keymap_t *editor_x_map; #endif +const global_keymap_t *viewer_map; +const global_keymap_t *viewer_hex_map; #ifdef USE_DIFF_VIEW const global_keymap_t *diff_map; #endif @@ -68,7 +70,7 @@ const global_keymap_t *diff_map; /*** global variables ****************************************************************************/ /* midnight */ -const global_keymap_t default_main_map[] = { +const global_keymap_t default_main_keymap[] = { {KEY_F (1), CK_Help, "F1"}, {KEY_F (2), CK_UserMenu, "F2"}, {KEY_F (3), CK_View, "F3"}, @@ -119,7 +121,7 @@ const global_keymap_t default_main_map[] = { {0, CK_IgnoreKey, ""} }; -const global_keymap_t default_main_x_map[] = { +const global_keymap_t default_main_x_keymap[] = { {'d', CK_CompareDirs, "d"}, #ifdef USE_DIFF_VIEW {XCTRL ('d'), CK_CompareFiles, "C-d"}, diff --git a/src/keybind-defaults.h b/src/keybind-defaults.h index 45a5a17de..9914e3cf1 100644 --- a/src/keybind-defaults.h +++ b/src/keybind-defaults.h @@ -43,14 +43,16 @@ extern const global_keymap_t *help_map; extern const global_keymap_t *editor_map; extern const global_keymap_t *editor_x_map; #endif +extern const global_keymap_t *viewer_map; +extern const global_keymap_t *viewer_hex_map; #ifdef USE_DIFF_VIEW extern const global_keymap_t *diff_map; #endif /* main.c */ -extern const global_keymap_t default_main_map[]; -extern const global_keymap_t default_main_x_map[]; +extern const global_keymap_t default_main_keymap[]; +extern const global_keymap_t default_main_x_keymap[]; /* screen.c */ extern const global_keymap_t default_panel_keymap[]; /* dialog.c */ diff --git a/src/setup.c b/src/setup.c index 7cb9250ca..4c9b7fb40 100644 --- a/src/setup.c +++ b/src/setup.c @@ -1210,11 +1210,11 @@ load_keymap_defs (gboolean load_from_file) mc_config_deinit (mc_global_keymap); } - main_map = default_main_map; + main_map = default_main_keymap; if (main_keymap && main_keymap->len > 0) main_map = (global_keymap_t *) main_keymap->data; - main_x_map = default_main_x_map; + main_x_map = default_main_x_keymap; if (main_x_keymap && main_x_keymap->len > 0) main_x_map = (global_keymap_t *) main_x_keymap->data; @@ -1242,6 +1242,24 @@ load_keymap_defs (gboolean load_from_file) if (help_keymap && help_keymap->len > 0) help_map = (global_keymap_t *) help_keymap->data; +#ifdef USE_INTERNAL_EDIT + editor_map = default_editor_keymap; + if (editor_keymap && editor_keymap->len > 0) + editor_map = (global_keymap_t *) editor_keymap->data; + + editor_x_map = default_editor_x_keymap; + if (editor_x_keymap && editor_x_keymap->len > 0) + editor_x_map = (global_keymap_t *) editor_x_keymap->data; +#endif + + viewer_map = default_viewer_keymap; + if (viewer_keymap && viewer_keymap->len > 0) + viewer_map = (global_keymap_t *) viewer_keymap->data; + + viewer_hex_map = default_viewer_hex_keymap; + if (viewer_hex_keymap && viewer_hex_keymap->len > 0) + viewer_hex_map = (global_keymap_t *) viewer_hex_keymap->data; + #ifdef USE_DIFF_VIEW diff_map = default_diff_keymap; if (diff_keymap && diff_keymap->len > 0) diff --git a/src/viewer/actions_cmd.c b/src/viewer/actions_cmd.c index 00e8cdbc6..4f8925006 100644 --- a/src/viewer/actions_cmd.c +++ b/src/viewer/actions_cmd.c @@ -399,12 +399,12 @@ mcview_handle_key (mcview_t * view, int key) if (view->hexedit_mode && (mcview_handle_editkey (view, key) == MSG_HANDLED)) return MSG_HANDLED; - command = keybind_lookup_keymap_command (view->hex_map, key); + command = keybind_lookup_keymap_command (viewer_hex_map, key); if ((command != CK_IgnoreKey) && (mcview_execute_cmd (view, command) == MSG_HANDLED)) return MSG_HANDLED; } - command = keybind_lookup_keymap_command (view->plain_map, key); + command = keybind_lookup_keymap_command (viewer_map, key); if ((command != CK_IgnoreKey) && (mcview_execute_cmd (view, command) == MSG_HANDLED)) return MSG_HANDLED; diff --git a/src/viewer/display.c b/src/viewer/display.c index a1491fbb5..7e68b9aea 100644 --- a/src/viewer/display.c +++ b/src/viewer/display.c @@ -51,6 +51,7 @@ #include "src/setup.h" /* panels_options */ #include "src/main.h" +#include "src/keybind-defaults.h" #include "internal.h" #include "mcviewer.h" @@ -81,7 +82,7 @@ mcview_set_buttonbar (mcview_t * view) { Dlg_head *h = view->widget.owner; WButtonBar *b = find_buttonbar (h); - const global_keymap_t *keymap = view->hex_mode ? view->hex_map : view->plain_map; + const global_keymap_t *keymap = view->hex_mode ? viewer_hex_map : viewer_map; buttonbar_set_label (b, 1, Q_ ("ButtonBar|Help"), keymap, (Widget *) view); diff --git a/src/viewer/internal.h b/src/viewer/internal.h index a30909769..8c078583f 100644 --- a/src/viewer/internal.h +++ b/src/viewer/internal.h @@ -175,10 +175,6 @@ typedef struct mcview_struct /* converter for translation of text */ GIConv converter; - /* keymaps */ - const global_keymap_t *plain_map; - const global_keymap_t *hex_map; - /* handle of search engine */ mc_search_t *search; gchar *last_search_string; diff --git a/src/viewer/mcviewer.c b/src/viewer/mcviewer.c index 58dd88237..aed360a02 100644 --- a/src/viewer/mcviewer.c +++ b/src/viewer/mcviewer.c @@ -186,19 +186,6 @@ mcview_real_event (Gpm_Event * event, void *x) return result; } -/* --------------------------------------------------------------------------------------------- */ - -static void -mcview_set_keymap (mcview_t * view) -{ - view->plain_map = default_viewer_keymap; - if (viewer_keymap && viewer_keymap->len > 0) - view->plain_map = (global_keymap_t *) viewer_keymap->data; - - view->hex_map = default_viewer_hex_keymap; - if (viewer_hex_keymap && viewer_hex_keymap->len > 0) - view->hex_map = (global_keymap_t *) viewer_hex_keymap->data; -} /* --------------------------------------------------------------------------------------------- */ /*** public functions ****************************************************************************/ @@ -211,8 +198,6 @@ mcview_new (int y, int x, int lines, int cols, gboolean is_panel) init_widget (&view->widget, y, x, lines, cols, mcview_callback, mcview_real_event); - mcview_set_keymap (view); - view->hex_mode = FALSE; view->hexedit_mode = FALSE; view->locked = FALSE; From 6484b1dce724a5743d1ca91ae82e25178e94595d Mon Sep 17 00:00:00 2001 From: Andrew Borodin Date: Wed, 23 Feb 2011 15:19:37 +0300 Subject: [PATCH 7/9] Allow remove key with empty value from target config. Signed-off-by: Andrew Borodin --- lib/filehighlight/ini-file-read.c | 2 +- lib/mcconfig.h | 3 ++- lib/mcconfig/common.c | 19 +++++++++++-------- src/setup.c | 2 +- 4 files changed, 15 insertions(+), 11 deletions(-) diff --git a/lib/filehighlight/ini-file-read.c b/lib/filehighlight/ini-file-read.c index 6ffcfa9f4..a82eb7e45 100644 --- a/lib/filehighlight/ini-file-read.c +++ b/lib/filehighlight/ini-file-read.c @@ -187,7 +187,7 @@ mc_fhl_read_ini_file (mc_fhl_t * fhl, const gchar * filename) return FALSE; if (fhl->config != NULL) - return mc_config_read_file (fhl->config, filename); + return mc_config_read_file (fhl->config, filename, FALSE); fhl->config = mc_config_init (filename); return (fhl->config != NULL); diff --git a/lib/mcconfig.h b/lib/mcconfig.h index 316ee498b..f3f754405 100644 --- a/lib/mcconfig.h +++ b/lib/mcconfig.h @@ -34,7 +34,8 @@ gboolean mc_config_del_group (mc_config_t *, const char *); gboolean mc_config_has_param (mc_config_t *, const char *, const gchar *); gboolean mc_config_has_group (mc_config_t *, const char *); -gboolean mc_config_read_file (mc_config_t *, const gchar *); +gboolean mc_config_read_file (mc_config_t * mc_config, const gchar * ini_path, + gboolean remove_empty); gboolean mc_config_save_file (mc_config_t * config, GError ** error); diff --git a/lib/mcconfig/common.c b/lib/mcconfig/common.c index a4c97318a..a411af0ca 100644 --- a/lib/mcconfig/common.c +++ b/lib/mcconfig/common.c @@ -194,7 +194,7 @@ mc_config_del_group (mc_config_t * mc_config, const char *group) /* - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - */ gboolean -mc_config_read_file (mc_config_t * mc_config, const gchar * ini_path) +mc_config_read_file (mc_config_t * mc_config, const gchar * ini_path, gboolean remove_empty) { mc_config_t *tmp_config; gchar **groups, **curr_grp; @@ -202,9 +202,7 @@ mc_config_read_file (mc_config_t * mc_config, const gchar * ini_path) gchar *value; if (mc_config == NULL) - { return FALSE; - } tmp_config = mc_config_init (ini_path); if (tmp_config == NULL) @@ -224,11 +222,16 @@ mc_config_read_file (mc_config_t * mc_config, const gchar * ini_path) for (curr_key = keys; *curr_key != NULL; curr_key++) { value = g_key_file_get_value (tmp_config->handle, *curr_grp, *curr_key, NULL); - if (value == NULL) - continue; - - g_key_file_set_value (mc_config->handle, *curr_grp, *curr_key, value); - g_free (value); + if (value != NULL) + { + if (*value == '\0' && remove_empty) + g_key_file_remove_key (mc_config->handle, *curr_grp, *curr_key, NULL); + else + g_key_file_set_value (mc_config->handle, *curr_grp, *curr_key, value); + g_free (value); + } + else if (remove_empty) + g_key_file_remove_key (mc_config->handle, *curr_grp, *curr_key, NULL); } g_strfreev (keys); } diff --git a/src/setup.c b/src/setup.c index 4c9b7fb40..c32a5e935 100644 --- a/src/setup.c +++ b/src/setup.c @@ -529,7 +529,7 @@ load_setup_init_config_from_file (mc_config_t ** config, const char *fname) if (exist_file (fname)) { if (*config != NULL) - mc_config_read_file (*config, fname); + mc_config_read_file (*config, fname, TRUE); else *config = mc_config_init (fname); } From b3d0a9237ba65547a4b687b81b43e71388307f01 Mon Sep 17 00:00:00 2001 From: Andrew Borodin Date: Fri, 25 Feb 2011 14:31:30 +0300 Subject: [PATCH 8/9] Change hardcoded definitions of default keymap. Now default key bindings are hardcoded as strings like values in keymap file. Such presentation of key bindings allows simplify keymaps merge when new bindings are added, replaced or removed old ones during MC initialization. Previously, to rebind some keys, used must redefine the entire section where that bindings are in. New merge algorithm doesn't require the redefinition of entire section in user's keymap file. Signed-off-by: Andrew Borodin --- lib/keybind.c | 14 +- src/keybind-defaults.c | 1047 +++++++++++++++++----------------------- src/keybind-defaults.h | 31 +- src/setup.c | 79 +-- 4 files changed, 486 insertions(+), 685 deletions(-) diff --git a/lib/keybind.c b/lib/keybind.c index 1cdba94cc..be5e01580 100644 --- a/lib/keybind.c +++ b/lib/keybind.c @@ -431,9 +431,10 @@ keybind_lookup_keymap_shortcut (const global_keymap_t * keymap, unsigned long ac { size_t i; - for (i = 0; keymap[i].key != 0; i++) - if (keymap[i].command == action) - return (keymap[i].caption[0] != '\0') ? keymap[i].caption : NULL; + if (keymap != NULL) + for (i = 0; keymap[i].key != 0; i++) + if (keymap[i].command == action) + return (keymap[i].caption[0] != '\0') ? keymap[i].caption : NULL; return NULL; } @@ -445,9 +446,10 @@ keybind_lookup_keymap_command (const global_keymap_t * keymap, long key) { size_t i; - for (i = 0; keymap[i].key != 0; i++) - if (keymap[i].key == key) - return keymap[i].command; + if (keymap != NULL) + for (i = 0; keymap[i].key != 0; i++) + if (keymap[i].key == key) + return keymap[i].command; return CK_IgnoreKey; } diff --git a/src/keybind-defaults.c b/src/keybind-defaults.c index 8de77f621..d4ca0ee41 100644 --- a/src/keybind-defaults.c +++ b/src/keybind-defaults.c @@ -1,8 +1,9 @@ /* - Copyright (C) 2009 The Free Software Foundation, Inc. + Copyright (C) 2009, 2010, 2011 The Free Software Foundation, Inc. Written by: 2005 Vitja Makarov - 2009 Ilia Maslakov + 2009, 2010 Ilia Maslakov + 2010, 2011 Andrew Borodin This file is part of the Midnight Commander. @@ -25,7 +26,6 @@ #include #include "lib/global.h" -#include "lib/tty/key.h" #include "keybind-defaults.h" @@ -49,668 +49,489 @@ GArray *viewer_hex_keymap = NULL; GArray *diff_keymap = NULL; #endif -const global_keymap_t *main_map; -const global_keymap_t *main_x_map; -const global_keymap_t *panel_map; -const global_keymap_t *dialog_map; -const global_keymap_t *input_map; -const global_keymap_t *listbox_map; -const global_keymap_t *tree_map; -const global_keymap_t *help_map; +const global_keymap_t *main_map = NULL; +const global_keymap_t *main_x_map = NULL; +const global_keymap_t *panel_map = NULL; +const global_keymap_t *dialog_map = NULL; +const global_keymap_t *input_map = NULL; +const global_keymap_t *listbox_map = NULL; +const global_keymap_t *tree_map = NULL; +const global_keymap_t *help_map = NULL; #ifdef USE_INTERNAL_EDIT -const global_keymap_t *editor_map; -const global_keymap_t *editor_x_map; +const global_keymap_t *editor_map = NULL; +const global_keymap_t *editor_x_map = NULL; #endif -const global_keymap_t *viewer_map; -const global_keymap_t *viewer_hex_map; +const global_keymap_t *viewer_map = NULL; +const global_keymap_t *viewer_hex_map = NULL; #ifdef USE_DIFF_VIEW -const global_keymap_t *diff_map; +const global_keymap_t *diff_map = NULL; #endif -/*** global variables ****************************************************************************/ +/*** file scope macro definitions ****************************************************************/ + +/*** file scope type declarations ****************************************************************/ + +/* default keymaps in ini (key=value) format */ +typedef struct global_keymap_ini_t +{ + const char *key; + const char *value; +} global_keymap_ini_t; + +/*** file scope variables ************************************************************************/ /* midnight */ -const global_keymap_t default_main_keymap[] = { - {KEY_F (1), CK_Help, "F1"}, - {KEY_F (2), CK_UserMenu, "F2"}, - {KEY_F (3), CK_View, "F3"}, - {KEY_F (4), CK_Edit, "F4"}, - {KEY_F (5), CK_Copy, "F5"}, - {KEY_F (6), CK_Move, "F6"}, - {KEY_F (7), CK_MakeDir, "F7"}, - {KEY_F (8), CK_Delete, "F8"}, - {KEY_F (9), CK_Menu, "F9"}, - {KEY_F (10), CK_Quit, "F10"}, - {KEY_F (13), CK_ViewFile, "S-F3"}, - {KEY_F (19), CK_MenuLastSelected, "S-F9"}, - {KEY_F (20), CK_QuitQuiet, "S-10"}, - {ALT ('h'), CK_History, "M-h"}, - {XCTRL ('@'), CK_DirSize, "C-Space"}, +static const global_keymap_ini_t default_main_keymap[] = { + {"Help", "f1"}, + {"UserMenu", "f2"}, + {"View", "f3"}, + {"Edit", "f4"}, + {"Copy", "f5"}, + {"Move", "f6"}, + {"MakeDir", "f7"}, + {"Delete", "f8"}, + {"Menu", "f9"}, + {"Quit", "f10"}, + {"ViewFile", "f13"}, + {"MenuLastSelected", "f19"}, + {"QuitQuiet", "f20"}, + {"History", "alt-h"}, + {"DirSize", "ctrl-space"}, /* Copy useful information to the command line */ - {ALT ('a'), CK_PutCurrentPath, "M-a"}, - {ALT ('A'), CK_PutOtherPath, "M-A"}, - {ALT ('c'), CK_CdQuick, "M-c"}, + {"PutCurrentPath", "alt-a"}, + {"PutOtherPath", "alt-shift-a"}, + {"CdQuick", "alt-c"}, /* To access the directory hotlist */ - {XCTRL ('\\'), CK_HotList, "C-\\"}, + {"HotList", "ctrl-backspace"}, /* Suspend */ - {XCTRL ('z'), CK_Suspend, "C-z"}, + {"Suspend", "ctrl-z"}, /* The filtered view command */ - {ALT ('!'), CK_ViewFiltered, "M-!"}, + {"ViewFiltered", "alt-exclamation"}, /* Find file */ - {ALT ('?'), CK_Find, "M-?"}, + {"Find", "alt-question"}, /* Panel refresh */ - {XCTRL ('r'), CK_Reread, "C-r"}, + {"Reread", "ctrl-r"}, /* Switch listing between long, user defined and full formats */ - {ALT ('t'), CK_PanelListingSwitch, "M-t"}, + {"PanelListingSwitch", "alt-t"}, /* Swap panels */ - {XCTRL ('u'), CK_Swap, "C-u"}, + {"Swap", "ctrl-u"}, /* View output */ - {XCTRL ('o'), CK_Shell, "C-o"}, - {ALT ('.'), CK_ShowHidden, "M-."}, - {ALT (','), CK_SplitVertHoriz, "M-,"}, - {XCTRL ('x'), CK_ExtendedKeyMap, "C-x"}, + {"Shell", "ctrl-o"}, + {"ShowHidden", "alt-dot"}, + {"SplitVertHoriz", "alt-comma"}, + {"ExtendedKeyMap", "ctrl-x"}, /* Select/unselect group */ - {KEY_KP_ADD, CK_Select, "+"}, - {KEY_KP_SUBTRACT, CK_Unselect, "-"}, - {ALT ('*'), CK_SelectInvert, "*"}, - - {ALT ('`'), CK_ScreenList, "M-`"}, - {ALT ('}'), CK_ScreenNext, "M-}"}, - {ALT ('{'), CK_ScreenPrev, "M-{"}, - - {0, CK_IgnoreKey, ""} + {"Select", "kpplus"}, + {"Unselect", "kpminus"}, + {"SelectInvert", "kpasterisk"}, + /* List of screens */ + {"ScreenList", "alt-prime"}, + {NULL, NULL} }; -const global_keymap_t default_main_x_keymap[] = { - {'d', CK_CompareDirs, "d"}, +static const global_keymap_ini_t default_main_x_keymap[] = { + {"CompareDirs", "d"}, #ifdef USE_DIFF_VIEW - {XCTRL ('d'), CK_CompareFiles, "C-d"}, + {"CompareFiles", "ctrl-d"}, #endif /* USE_DIFF_VIEW */ #ifdef ENABLE_VFS - {'a', CK_VfsList, "a"}, + {"VfsList", "a"}, #endif /* ENABLE_VFS */ - {'p', CK_PutCurrentPath, "p"}, - {XCTRL ('p'), CK_PutOtherPath, "C-p"}, - {'t', CK_PutCurrentTagged, "t"}, - {XCTRL ('t'), CK_PutOtherTagged, "C-t"}, - {'c', CK_ChangeMode, "c"}, - {'o', CK_ChangeOwn, "o"}, - {'r', CK_PutCurrentLink, "r"}, - {XCTRL ('r'), CK_PutOtherLink, "C-r"}, - {'l', CK_Link, "l"}, - {'s', CK_LinkSymbolic, "s"}, - {'v', CK_LinkSymbolicRelative, "v"}, - {XCTRL ('s'), CK_LinkSymbolicEdit, "C-s"}, - {'i', CK_PanelInfo, "i"}, - {'q', CK_PanelQuickView, "q"}, - {'h', CK_HotListAdd, "h"}, - {'!', CK_ExternalPanelize, "!"}, + {"PutCurrentPath", "p"}, + {"PutOtherPath", "ctrl-p"}, + {"PutCurrentTagged", "t"}, + {"PutOtherTagged", "ctrl-t"}, + {"ChangeMode", "c"}, + {"ChangeOwn", "o"}, + {"PutCurrentLink", "r"}, + {"PutOtherLink", "ctrl-r"}, + {"Link", "l"}, + {"LinkSymbolic", "s"}, + {"LinkSymbolicRelative", "v"}, + {"LinkSymbolicEdit", "ctrl-s"}, + {"PanelInfo", "i"}, + {"PanelQuickView", "q"}, + {"HotListAdd", "h"}, #ifdef WITH_BACKGROUND - {'j', CK_Jobs, "j"}, + {"Jobs", "j"}, #endif /* WITH_BACKGROUND */ - {0, CK_IgnoreKey, ""} + {"ExternalPanelize", "!"}, + {NULL, NULL} }; /* panel */ -const global_keymap_t default_panel_keymap[] = { - {ALT ('o'), CK_PanelOtherCd, "M-o"}, - {ALT ('l'), CK_PanelOtherCdLink, "M-l"}, - {KEY_F (15), CK_CopySingle, "S-F5"}, - {KEY_F (18), CK_DeleteSingle, "S-F8"}, - {KEY_ENTER, CK_Enter, "Enter"}, - {'\n', CK_Enter, "Enter"}, - {KEY_F (14), CK_EditNew, "S-F4"}, - {KEY_F (16), CK_MoveSingle, "S-F6"}, - {ALT ('*'), CK_SelectInvert, "M-*"}, - {KEY_KP_ADD, CK_Select, "M-+"}, - {KEY_KP_SUBTRACT, CK_Unselect, "M--"}, - {KEY_F (13), CK_ViewRaw, "S-F3"}, - {KEY_M_CTRL | KEY_NPAGE, CK_CdChild, "C-PgDn"}, - {KEY_M_CTRL | KEY_PPAGE, CK_CdParent, "C-PgUp"}, - {ALT ('H'), CK_History, "M-H"}, - {ALT ('u'), CK_HistoryNext, "M-u"}, - {ALT ('y'), CK_HistoryPrev, "M-y"}, - {ALT ('j'), CK_BottomOnScreen, "M-j"}, - {ALT ('r'), CK_MiddleOnScreen, "M-r"}, - {ALT ('g'), CK_TopOnScreen, "M-g"}, - {KEY_IC, CK_Mark, "Insert"}, - {KEY_M_SHIFT | KEY_UP, CK_MarkDown, "S-Down"}, - {KEY_M_SHIFT | KEY_DOWN, CK_MarkUp, "S-Up"}, - {KEY_UP, CK_Up, "Up"}, - {KEY_DOWN, CK_Down, "Down"}, - {KEY_LEFT, CK_Left, "Left"}, - {KEY_RIGHT, CK_Right, "Right"}, - {KEY_END, CK_Bottom, "End"}, - {KEY_C1, CK_Bottom, "C1"}, - {KEY_HOME, CK_Top, "Home"}, - {KEY_A1, CK_Top, "A1"}, - {KEY_NPAGE, CK_PageDown, "PgDn"}, - {KEY_PPAGE, CK_PageUp, "PgUp"}, +static const global_keymap_ini_t default_panel_keymap[] = { + {"PanelOtherCd", "alt-o"}, + {"PanelOtherCdLink", "alt-l"}, + {"CopySingle", "f15"}, + {"DeleteSingle", "f18"}, + {"Enter", "enter"}, + {"EditNew", "f14"}, + {"MoveSingle", "f16"}, + {"SelectInvert", "alt-asterisk"}, + {"Select", "alt-plus"}, + {"Unselect", "alt-minus"}, + {"ViewRaw", "f13"}, + {"CdChild", "ctrl-pgdn"}, + {"CdParent", "ctrl-pgup"}, + {"History", "alt-shift-h"}, + {"HistoryNext", "alt-u"}, + {"HistoryPrev", "alt-y"}, + {"BottomOnScreen", "alt-j"}, + {"MiddleOnScreen", "alt-r"}, + {"TopOnScreen", "alt-g"}, + {"Mark", "insert; ctrl-t"}, + {"MarkDown", "shift-down"}, + {"MarkUp", "shift-up"}, + {"Up", "up; ctrl-p"}, + {"Down", "down; ctrl-n"}, + {"Left", "left"}, + {"Right", "right"}, + {"Top", "alt-lt; home; a1"}, + {"Bottom", "alt-gt; end; c1"}, + {"PageDown", "pgdn; ctrl-v"}, + {"PageUp", "pgup; alt-v"}, #ifdef HAVE_CHARSET - {ALT ('e'), CK_SelectCodepage, "M-e"}, + {"SelectCodepage", "alt-e"}, #endif - {XCTRL ('s'), CK_Search, "C-s"}, - {ALT ('s'), CK_Search, "M-s"}, - {ALT ('i'), CK_PanelOtherSync, "M-i"}, - {0, CK_IgnoreKey, ""} + {"Search", "ctrl-s; alt-s"}, + {"PanelOtherSync", "alt-i"}, + {NULL, NULL} }; /* dialog */ -const global_keymap_t default_dialog_keymap[] = { - {'\n', CK_Ok, "Enter"}, - {KEY_ENTER, CK_Ok, "Enter"}, - {ESC_CHAR, CK_Cancel, "Esc"}, - {XCTRL ('g'), CK_Cancel, "C-g"}, - {KEY_F (10), CK_Cancel, "F10"}, - {KEY_LEFT, CK_Left, "Left"}, - {KEY_UP, CK_Up, "Up"}, - {KEY_RIGHT, CK_Right, "Right"}, - {KEY_DOWN, CK_Down, "Down"}, - {KEY_F (1), CK_Help, "F1"}, - {XCTRL ('z'), CK_Suspend, "C-z"}, - {XCTRL ('l'), CK_Refresh, "C-l"}, - {0, CK_IgnoreKey, ""} +static const global_keymap_ini_t default_dialog_keymap[] = { + {"Ok", "enter"}, + {"Cancel", "f10; esc; ctrl-g"}, + {"Up", "up; left"}, + {"Down", "down; right"}, +#if 0 + {"Left", "up; left"}, + {"Right", "down; right"}, +#endif + {"Help", "f1"}, + {"Suspend", "ctrl-z"}, + {"Refresh", "ctrl-l"}, + {"ScreenList", "alt-prime"}, + {"ScreenNext", "alt-rbrace"}, + {"ScreenPrev", "alt-lbrace"}, + {NULL, NULL} }; -const global_keymap_t default_input_keymap[] = { +/* input line */ +static const global_keymap_ini_t default_input_keymap[] = { /* Motion */ - {XCTRL ('a'), CK_Home, "C-a"}, - {KEY_HOME, CK_Home, "Home"}, - {KEY_A1, CK_Home, "A1"}, - {ALT ('<'), CK_Home, "M-<"}, - {XCTRL ('e'), CK_End, "C-e"}, - {KEY_END, CK_End, "End"}, - {ALT ('>'), CK_End, "M->"}, - {KEY_C1, CK_End, "C1"}, - {KEY_LEFT, CK_Left, "Left"}, - {XCTRL ('b'), CK_Left, "C-b"}, - {KEY_RIGHT, CK_Right, "Right"}, - {XCTRL ('f'), CK_Right, "C-f"}, - {KEY_M_CTRL | KEY_LEFT, CK_WordLeft, "C-Left"}, - {ALT ('b'), CK_WordLeft, "M-b"}, - {KEY_M_CTRL | KEY_RIGHT, CK_WordRight, "C-Right"}, - {ALT ('f'), CK_WordRight, "M-f"}, - {KEY_M_SHIFT | KEY_M_CTRL | KEY_LEFT, CK_MarkToWordBegin, "C-S-Left"}, - {KEY_M_SHIFT | KEY_M_CTRL | KEY_RIGHT, CK_MarkToWordEnd, "C-S-Right"}, - {KEY_M_SHIFT | KEY_HOME, CK_MarkToHome, "S-Home"}, - {KEY_M_SHIFT | KEY_END, CK_MarkToEnd, "S-End"}, - + {"Home", "ctrl-a; alt-lt; home; a1"}, + {"End", "ctrl-e; alt-gt; end; c1"}, + {"Left", "left; alt-left; ctrl-b"}, + {"Right", "right; alt-right; ctrl-f"}, + {"WordLeft", "ctrl-left; alt-b"}, + {"WordRight", "ctrl-right; alt-f"}, + /* Mark */ + {"MarkLeft", "shift-left"}, + {"MarkRight", "shift-right"}, + {"MarkToWordBegin", "ctrl-shift-left"}, + {"MarkToWordEnd", "ctrl-shift-right"}, + {"MarkToHome", "shift-home"}, + {"MarkToEnd", "shift-end"}, /* Editing */ - {KEY_BACKSPACE, CK_BackSpace, "BackSpace"}, - {KEY_BACKSPACE, CK_BackSpace, "C-h"}, - {KEY_DC, CK_Delete, "Delete"}, - {KEY_DC, CK_Delete, "C-d"}, - {ALT ('d'), CK_DeleteToWordEnd, "M-d"}, - {ALT (KEY_BACKSPACE), CK_DeleteToWordBegin, "M-BackSpace"}, - + {"Backspace", "backspace; ctrl-h"}, + {"Delete", "delete; ctrl-d"}, + {"DeleteToWordEnd", "alt-d"}, + {"DeleteToWordBegin", "alt-backspace"}, /* Region manipulation */ - {XCTRL ('w'), CK_Remove, "C-w"}, - {ALT ('w'), CK_Store, "M-w"}, - {XCTRL ('y'), CK_Yank, "C-y"}, - {XCTRL ('k'), CK_DeleteToEnd, "C-k"}, - + {"Remove", "ctrl-w"}, + {"Store", "alt-w"}, + {"Yank", "ctrl-y"}, + {"DeleteToEnd", "ctrl-k"}, /* History */ - {ALT ('p'), CK_HistoryPrev, "M-p"}, - {ALT ('n'), CK_HistoryNext, "M-n"}, - {ALT ('h'), CK_History, "M-h"}, - + {"History", "alt-h"}, + {"HistoryPrev", "alt-p; ctrl-down"}, + {"HistoryNext", "alt-n; ctrl-up"}, /* Completion */ - {ALT ('\t'), CK_Complete, "M-tab"}, - - {0, CK_IgnoreKey, ""} + {"Complete", "alt-tab"}, + {NULL, NULL} }; -const global_keymap_t default_listbox_keymap[] = { - {KEY_UP, CK_Up, "Up"}, - {XCTRL ('p'), CK_Up, "C-p"}, - {KEY_DOWN, CK_Down, "Down"}, - {XCTRL ('n'), CK_Down, "C-n"}, - {KEY_HOME, CK_Top, "Home"}, - {ALT ('<'), CK_Top, "M-<"}, - {KEY_A1, CK_Top, "A1"}, - {KEY_END, CK_Bottom, "End"}, - {ALT ('>'), CK_Bottom, "M->"}, - {KEY_C1, CK_Bottom, "C1"}, - {KEY_PPAGE, CK_PageUp, "PgUp"}, - {ALT ('v'), CK_PageUp, "M-v"}, - {KEY_NPAGE, CK_PageDown, "PgDn"}, - {XCTRL ('v'), CK_PageDown, "C-v"}, - {KEY_DC, CK_Delete, "Delete"}, - {'d', CK_Delete, "d"}, - {KEY_M_SHIFT | KEY_DC, CK_Clear, "S-Delete"}, - {'D', CK_Clear, "D"}, - {0, CK_IgnoreKey, ""} +/* listbox */ +static const global_keymap_ini_t default_listbox_keymap[] = { + {"Up", "up; ctrl-p"}, + {"Down", "down; ctrl-n"}, + {"Top", "home; alt-lt; a1"}, + {"Bottom", "end; alt-gt; c1"}, + {"PageUp", "pgup; alt-v"}, + {"PageDown", "pgdn; ctrl-v"}, + {"Delete", "delete; d"}, + {"Clear", "shift-delete; shift-d"}, + {NULL, NULL} }; /* tree */ -const global_keymap_t default_tree_keymap[] = { - {KEY_F (1), CK_Help, "F1"}, - {KEY_F (2), CK_Reread, "F2"}, - {KEY_F (3), CK_Forget, "F3"}, - {KEY_F (4), CK_ToggleNavigation, "F4"}, - {KEY_F (5), CK_Copy, "F5"}, - {KEY_F (6), CK_Move, "F6"}, +static const global_keymap_ini_t default_tree_keymap[] = { + {"Help = f1"}, + {"Rescan = f2; ctrl-r"}, + {"Forget = f3"}, + {"ToggleNavigation = f4"}, + {"Copy = f5"}, + {"Move = f6"}, #if 0 - {KEY_F (7), CK_MakeDir, "F7"}, + {"MakeDir", "f7"}, #endif - {KEY_F (8), CK_Delete, "F8"}, - {KEY_UP, CK_Up, "Up"}, - {XCTRL ('p'), CK_Up, "C-p"}, - {KEY_DOWN, CK_Down, "Down"}, - {XCTRL ('n'), CK_Down, "C-n"}, - {KEY_LEFT, CK_Left, "Left"}, - {KEY_RIGHT, CK_Right, "Right"}, - {KEY_HOME, CK_Top, "Home"}, - {ALT ('<'), CK_Top, "M-<"}, - {KEY_A1, CK_Top, "A1"}, - {KEY_END, CK_Bottom, "End"}, - {ALT ('>'), CK_Bottom, "M->"}, - {KEY_C1, CK_Bottom, "C1"}, - {KEY_PPAGE, CK_PageUp, "PgUp"}, - {ALT ('v'), CK_PageUp, "M-v"}, - {KEY_NPAGE, CK_PageDown, "PgDn"}, - {XCTRL ('v'), CK_PageDown, "C-v"}, - {'\n', CK_Enter, "Enter"}, - {KEY_ENTER, CK_Enter, "Enter"}, - {XCTRL ('r'), CK_Reread, "C-r"}, - {XCTRL ('s'), CK_Search, "C-s"}, - {ALT ('s'), CK_Search, "M-s"}, - {KEY_DC, CK_Delete, "Delete"}, - {0, CK_IgnoreKey, ""} + {"Delete", "f8; delete"}, + {"Up", "up; ctrl-p"}, + {"Down", "down; ctrl-n"}, + {"Left", "left"}, + {"Right", "right"}, + {"Top", "home; alt-lt; a1"}, + {"Bottom", "end; alt-gt; c1"}, + {"PageUp", "pgup; alt-v"}, + {"PageDown", "pgdn; ctrl-v"}, + {"Enter", "enter"}, + {"Search", "ctrl-s; alt-s"}, + {NULL, NULL} }; /* help */ -const global_keymap_t default_help_keymap[] = { - {KEY_F (1), CK_Help, "F1"}, - {KEY_F (2), CK_Index, "F2"}, - {KEY_F (3), CK_Back, "F3"}, - {KEY_F (10), CK_Quit, "F10"}, - {KEY_LEFT, CK_Back, "Left"}, - {'l', CK_Back, "l"}, - {KEY_DOWN, CK_Down, "Down"}, - {XCTRL ('n'), CK_Down, "C-n"}, - {KEY_UP, CK_Up, "Up"}, - {XCTRL ('p'), CK_Up, "C-p"}, - {KEY_NPAGE, CK_PageDown, "PgDn"}, - {XCTRL ('v'), CK_PageDown, "C-v"}, - {'f', CK_PageDown, "f"}, - {' ', CK_PageDown, "Space"}, - {KEY_PPAGE, CK_PageUp, "PgUp"}, - {ALT ('v'), CK_PageUp, "M-v"}, - {'b', CK_PageUp, "b"}, - {KEY_BACKSPACE, CK_PageUp, "BackSpace"}, - {'d', CK_HalfPageDown, "d"}, - {'u', CK_HalfPageUp, "u"}, - {KEY_HOME, CK_Top, "Home"}, - {KEY_M_CTRL | KEY_HOME, CK_Top, "C-Home"}, - {KEY_M_CTRL | KEY_PPAGE, CK_Top, "C-PgUp"}, - {KEY_A1, CK_Top, "A1"}, - {ALT ('<'), CK_Top, "M-<"}, - {'g', CK_Top, "g"}, - {KEY_END, CK_Bottom, "End"}, - {KEY_M_CTRL | KEY_END, CK_Bottom, "C-End"}, - {KEY_M_CTRL | KEY_NPAGE, CK_Bottom, "C-PgDn"}, - {KEY_C1, CK_Bottom, "C1"}, - {ALT ('>'), CK_Bottom, "M->"}, - {'G', CK_Bottom, "G"}, - {KEY_RIGHT, CK_Enter, "Right"}, - {KEY_ENTER, CK_Enter, "Enter"}, - {'\n', CK_Enter, "Enter"}, - {'\t', CK_LinkNext, "Tab"}, - {ALT ('\t'), CK_LinkPrev, "M-Tab"}, - {'n', CK_NodeNext, "n"}, - {'p', CK_NodePrev, "p"}, - {ESC_CHAR, CK_Quit, "Esc"}, - {XCTRL ('g'), CK_Quit, "C-g"}, - {0, CK_IgnoreKey, ""} +static const global_keymap_ini_t default_help_keymap[] = { + {"Help", "f1"}, + {"Index", "f2; c"}, + {"Back", "f3; left; l"}, + {"Quit", "f10; esc; ctrl-g"}, + {"Up", "up; ctrl-p"}, + {"Down", "down; ctrl-n"}, + {"PageDown", "f; space; pgdn; ctrl-v"}, + {"PageUp", "b; pgup; alt-v; backspace"}, + {"HalfPageDown", "d"}, + {"HalfPageUp", "u"}, + {"Top", "home; ctrl-home; ctrl-pgup; a1; alt-lt; g"}, + {"Bottom", "end; ctrl-end; ctrl-pgdn; c1; alt-gt; shift-g"}, + {"Enter", "right; enter"}, + {"LinkNext", "tab"}, + {"LinkPrev", "alt-tab"}, + {"NodeNext", "n"}, + {"NodePrev", "p"}, + {NULL, NULL} }; #ifdef USE_INTERNAL_EDIT -/* editor/editkeys.c */ -const global_keymap_t default_editor_keymap[] = { - {'\n', CK_Enter, "Enter"}, - {'\t', CK_Tab, "Tab"}, - - {KEY_F (1), CK_Help, "F1"}, - {KEY_F (2), CK_Save, "F2"}, - {KEY_F (3), CK_Mark, "F3"}, - {KEY_F (4), CK_Replace, "F4"}, - {KEY_F (5), CK_Copy, "F5"}, - {KEY_F (6), CK_Move, "F6"}, - {KEY_F (7), CK_Search, "F7"}, - {KEY_F (8), CK_Remove, "F8"}, - {KEY_F (9), CK_Menu, "F9"}, - {KEY_F (10), CK_Quit, "F10"}, - /* edit user menu */ - {KEY_F (11), CK_UserMenu, "S-F1"}, - {KEY_F (12), CK_SaveAs, "S-F2"}, - {KEY_F (13), CK_MarkColumn, "S-F3"}, - {KEY_F (14), CK_ReplaceContinue, "S-F4"}, - {KEY_F (15), CK_InsertFile, "S-F5"}, - {KEY_F (17), CK_SearchContinue, "S-F7"}, - /* C formatter */ - {KEY_F (19), CK_PipeBlock (0), "S-F9"}, - - {ESC_CHAR, CK_Quit, "Esc"}, - {KEY_BACKSPACE, CK_BackSpace, "BackSpace"}, - {KEY_BACKSPACE, CK_BackSpace, "C-h"}, - {KEY_DC, CK_Delete, "Delete"}, - {KEY_DC, CK_Delete, "C-d"}, - {KEY_DOWN, CK_Down, "Down"}, - {KEY_END, CK_End, "End"}, - {KEY_HOME, CK_Home, "Home"}, - {KEY_IC, CK_InsertOverwrite, "Insert"}, - {KEY_LEFT, CK_Left, "Left"}, - {KEY_NPAGE, CK_PageDown, "PgDn"}, - {KEY_PPAGE, CK_PageUp, "PgUp"}, - {KEY_RIGHT, CK_Right, "Right"}, - {KEY_UP, CK_Up, "Up"}, - - /* Ctrl */ - {KEY_M_CTRL | (KEY_F (2)), CK_SaveAs, "C-F2"}, - {KEY_M_CTRL | (KEY_F (4)), CK_ReplaceContinue, "C-F4"}, - {KEY_M_CTRL | (KEY_F (7)), CK_SearchContinue, "C-F7"}, - {KEY_M_CTRL | KEY_BACKSPACE, CK_Undo, "C-BackSpace"}, - {KEY_M_CTRL | KEY_NPAGE, CK_Bottom, "C-PgDn"}, - {KEY_M_CTRL | KEY_PPAGE, CK_Top, "C-PgUp"}, - {KEY_M_CTRL | KEY_HOME, CK_Top, "C-Home"}, - {KEY_M_CTRL | KEY_END, CK_Bottom, "C-End"}, - {KEY_M_CTRL | KEY_UP, CK_ScrollUp, "C-Up"}, - {KEY_M_CTRL | KEY_DOWN, CK_ScrollDown, "C-Down"}, - {KEY_M_CTRL | KEY_LEFT, CK_WordLeft, "C-Left"}, - {XCTRL ('z'), CK_WordLeft, "C-z"}, - {KEY_M_CTRL | KEY_RIGHT, CK_WordRight, "C-Right"}, - {XCTRL ('x'), CK_WordRight, "C-x"}, - {KEY_M_CTRL | KEY_IC, CK_Store, "C-Insert"}, - {KEY_M_CTRL | KEY_DC, CK_Remove, "C-Delete"}, - - {XCTRL ('n'), CK_EditNew, "C-n"}, - {XCTRL ('k'), CK_DeleteToEnd, "C-k"}, - {XCTRL ('l'), CK_Refresh, "C-l"}, - {XCTRL ('o'), CK_Shell, "C-o"}, - {XCTRL ('s'), CK_SyntaxOnOff, "C-s"}, - {XCTRL ('u'), CK_Undo, "C-u"}, - {ALT ('r'), CK_Redo, "M-r"}, +static const global_keymap_ini_t default_editor_keymap[] = { + {"Enter", "enter"}, + {"Return", "shift-enter"}, /* useful for pasting multiline text */ + {"Tab", "tab"}, + {"BackSpace", "backspace; ctrl-h"}, + {"Delete", "delete; ctrl-d"}, + {"Left", "left"}, + {"Right", "right"}, + {"Up", "up"}, + {"Down", "down"}, + {"Home", "home"}, + {"End", "end"}, + {"PageUp", "pgup"}, + {"PageDown", "pgdn"}, + {"WordLeft", "ctrl-left; ctrl-z"}, + {"WordRight", "ctrl-right; ctrl-x"}, + {"InsertOverwrite", "insert"}, + {"Help", "f1"}, + {"Save", "f2"}, + {"Mark", "f3"}, + {"Replace", "f4"}, + {"Copy", "f5"}, + {"Move", "f6"}, + {"Search", "f7"}, + {"Remove", "f8; ctrl-delete"}, + {"Menu", "f9"}, + {"Quit", "f10; esc"}, + {"UserMenu", "f11"}, + {"SaveAs", "f12; ctrl-f2"}, + {"MarkColumn", "f13"}, + {"ReplaceContinue", "f14; ctrl-f4"}, + {"InsertFile", "f15"}, + {"SearchContinue", "f17; ctrl-f7"}, + {"EditNew", "ctrl-n"}, + {"DeleteToWordBegin", "alt-backspace"}, + {"DeleteToWordEnd", "alt-d"}, + {"DeleteLine", "ctrl-y"}, + {"DeleteToEnd", "ctrl-k"}, + {"Undo", "ctrl-u; ctrl-backspace"}, + {"Redo", "alt-r"}, #ifdef HAVE_CHARSET - {ALT ('e'), CK_SelectCodepage, "M-e"}, + {"SelectCodepage", "alt-e"}, #endif - {XCTRL ('f'), CK_BlockSave, "C-f"}, - /* Spell check */ - {XCTRL ('p'), CK_PipeBlock (1), "C-p"}, - {XCTRL ('y'), CK_DeleteLine, "C-y"}, - - /* Shift */ - {KEY_M_SHIFT | KEY_NPAGE, CK_MarkPageDown, "S-PgDn"}, - {KEY_M_SHIFT | KEY_PPAGE, CK_MarkPageUp, "S-PgUp"}, - {KEY_M_SHIFT | KEY_LEFT, CK_MarkLeft, "S-Left"}, - {KEY_M_SHIFT | KEY_RIGHT, CK_MarkRight, "S-Right"}, - {KEY_M_SHIFT | KEY_UP, CK_MarkUp, "S-Up"}, - {KEY_M_SHIFT | KEY_DOWN, CK_MarkDown, "S-Down"}, - {KEY_M_SHIFT | KEY_HOME, CK_MarkToHome, "S-Home"}, - {KEY_M_SHIFT | KEY_END, CK_MarkToEnd, "S-End"}, - {KEY_M_SHIFT | KEY_IC, CK_Paste, "S-Insert"}, - {KEY_M_SHIFT | KEY_DC, CK_Cut, "S-Delete"}, - /* useful for pasting multiline text */ - {KEY_M_SHIFT | '\n', CK_Return, "S-Enter"}, - - /* Ctrl + Shift */ - {KEY_M_SHIFT | KEY_M_CTRL | KEY_PPAGE, CK_MarkToFileBegin, "C-S-PgUp"}, - {KEY_M_SHIFT | KEY_M_CTRL | KEY_NPAGE, CK_MarkToFileEnd, "C-S-PgDn"}, - {KEY_M_SHIFT | KEY_M_CTRL | KEY_LEFT, CK_MarkToWordBegin, "C-S-Left"}, - {KEY_M_SHIFT | KEY_M_CTRL | KEY_RIGHT, CK_MarkToWordEnd, "C-S-Right"}, - {KEY_M_SHIFT | KEY_M_CTRL | KEY_UP, CK_MarkScrollUp, "C-S-Up"}, - {KEY_M_SHIFT | KEY_M_CTRL | KEY_DOWN, CK_MarkScrollDown, "C-S-Down"}, - - /* column mark commands */ - {KEY_M_ALT | KEY_PPAGE, CK_MarkColumnPageUp, "M-PgUp"}, - {KEY_M_ALT | KEY_NPAGE, CK_MarkColumnPageDown, "M-PgDn"}, - {KEY_M_ALT | KEY_LEFT, CK_MarkColumnLeft, "M-Left"}, - {KEY_M_ALT | KEY_RIGHT, CK_MarkColumnRight, "M-Right"}, - {KEY_M_ALT | KEY_UP, CK_MarkColumnUp, "M-Up"}, - {KEY_M_ALT | KEY_DOWN, CK_MarkColumnDown, "M-Down"}, - {KEY_M_ALT | KEY_HOME, CK_MarkToHome, "M-Home"}, - - {ALT ('\n'), CK_Find, "M-Enter"}, - {ALT ('\t'), CK_Complete, "M-Tab"}, - {ALT ('l'), CK_Goto, "M-l"}, - {ALT ('L'), CK_Goto, "M-L"}, - {ALT ('p'), CK_ParagraphFormat, "M-p"}, - {ALT ('t'), CK_Sort, "M-t"}, - {ALT ('u'), CK_ExternalCommand, "M-u"}, - {ALT ('<'), CK_Top, "M-<"}, - {ALT ('>'), CK_Bottom, "M->"}, - {ALT ('-'), CK_FilePrev, "M--"}, - {ALT ('+'), CK_FileNext, "M-+"}, - {ALT ('d'), CK_DeleteToWordEnd, "M-d"}, - {ALT (KEY_BACKSPACE), CK_DeleteToWordBegin, "M-BackSpace"}, - {ALT ('n'), CK_ShowNumbers, "M-n"}, - {ALT ('_'), CK_ShowTabTws, "M-_"}, - {ALT ('k'), CK_Bookmark, "M-k"}, - {ALT ('i'), CK_BookmarkPrev, "M-i"}, - {ALT ('j'), CK_BookmarkNext, "M-j"}, - {ALT ('o'), CK_BookmarkFlush, "M-o"}, - {ALT ('b'), CK_MatchBracket, "M-b"}, - {ALT ('m'), CK_Mail, "M-m"}, - - {XCTRL ('x'), CK_ExtendedKeyMap, "C-x"}, - - {0, CK_IgnoreKey, ""} + {"Goto", "alt-l; alt-shift-l"}, + {"Refresh", "ctrl-l"}, + {"Shell", "ctrl-o"}, + {"Top", "ctrl-home; ctrl-pgup; alt-lt"}, + {"Bottom", "ctrl-end; ctrl-pgdn; alt-gt"}, + {"TopOnScreen", "ctrl-pgup"}, + {"BottomOnScreen", "ctrl-pgdn"}, + {"ScrollUp", "ctrl-up"}, + {"ScrollDown", "ctrl-down"}, + {"Store", "ctrl-insert"}, + {"Paste", "shift-insert"}, + {"Cut", "shift-delete"}, + {"BlockSave", "ctrl-f"}, + {"MarkLeft", "shift-left"}, + {"MarkRight", "shift-right"}, + {"MarkUp", "shift-up"}, + {"MarkDown", "shift-down"}, + {"MarkPageUp", "shift-pgup"}, + {"MarkPageDown", "shift-pgdn"}, + {"MarkToWordBegin", "ctrl-shift-left"}, + {"MarkToWordEnd", "ctrl-shift-right"}, + {"MarkToHome", "shift-home"}, + {"MarkToEnd", "shift-end"}, + {"MarkToFileBegin", "ctrl-shift-home"}, + {"MarkToFileEnd", "ctrl-shift-end"}, + {"MarkToPageBegin", "ctrl-shift-pgup"}, + {"MarkToPageEnd", "ctrl-shift-pgdn"}, + {"MarkScrollUp", "ctrl-shift-up"}, + {"MarkScrollDown", "ctrl-shift-down"}, + {"MarkColumnLeft", "alt-left"}, + {"MarkColumnRight", "alt-right"}, + {"MarkColumnUp", "alt-up"}, + {"MarkColumnDown", "alt-down"}, + {"MarkColumnPageUp", "alt-pgup"}, + {"MarkColumnPageDown", "alt-pgdn"}, + {"InsertLiteral", "ctrl-q"}, + {"Complete", "alt-tab"}, + {"MatchBracket", "alt-b"}, + {"ParagraphFormat", "alt-p"}, + {"Bookmark", "alt-k"}, + {"BookmarkFlush", "alt-o"}, + {"BookmarkNext", "alt-j"}, + {"BookmarkPrev", "alt-i"}, + {"MacroStartStopRecord", "ctrl-r"}, + {"MacroExecute", "ctrl-a"}, + {"ShowNumbers", "alt-n"}, + {"ShowTabTws", "alt-underline"}, + {"SyntaxOnOff", "ctrl-s"}, + {"Find", "alt-enter"}, + {"FilePrev", "alt-minus"}, + {"FileNext", "alt-plus"}, + {"Sort", "alt-t"}, + {"Mail", "alt-m"}, + {"ExternalCommand", "alt-u"}, + {"ExtendedKeyMap", "ctrl-x"}, + {NULL, NULL} }; /* emacs keyboard layout emulation */ -const global_keymap_t default_editor_x_keymap[] = { - {'k', CK_EditNew, "k"}, - {0, CK_IgnoreKey, ""} +static const global_keymap_ini_t default_editor_x_keymap[] = { + {NULL, NULL} }; #endif /* USE_INTERNAL_EDIT */ -/* viewer/actions_cmd.c */ -const global_keymap_t default_viewer_keymap[] = { - {KEY_F (1), CK_Help, "F1"}, - {KEY_F (2), CK_WrapMode, "F2"}, - {KEY_F (3), CK_Quit, "F3"}, - {KEY_F (4), CK_HexMode, "F4"}, - {KEY_F (5), CK_Goto, "F5"}, - {KEY_F (7), CK_Search, "F7"}, - {KEY_F (8), CK_MagicMode, "F8"}, - {KEY_F (9), CK_NroffMode, "F9"}, - {KEY_F (10), CK_Quit, "F10"}, - - {'?', CK_Search, "?"}, - {'/', CK_Search, "/"}, - {XCTRL ('r'), CK_SearchContinue, "C-r"}, - {XCTRL ('s'), CK_SearchContinue, "C-s"}, - {KEY_F (17), CK_SearchContinue, "S-F7"}, - {'n', CK_SearchContinue, "n"}, - {ALT ('r'), CK_Ruler, "M-r"}, - - {XCTRL ('a'), CK_Home, "C-a"}, - {XCTRL ('e'), CK_End, "C-e"}, - - {'h', CK_Left, "h"}, - {KEY_LEFT, CK_Left, "Left"}, - - {'l', CK_Right, "l"}, - {KEY_RIGHT, CK_Right, "Right"}, - - {KEY_M_CTRL | KEY_LEFT, CK_LeftQuick, "C-Left"}, - {KEY_M_CTRL | KEY_RIGHT, CK_RightQuick, "C-Right"}, - - {'k', CK_Up, "k"}, - {'y', CK_Up, "y"}, - {XCTRL ('p'), CK_Up, "C-p"}, - {KEY_IC, CK_Up, "Insert"}, - {KEY_UP, CK_Up, "Up"}, - {XCTRL ('n'), CK_Up, "C-n"}, - - {'j', CK_Down, "j"}, - {'e', CK_Down, "e"}, - {KEY_DOWN, CK_Down, "Down"}, - {KEY_DC, CK_Down, "Delete"}, - {'\n', CK_Down, "Endter"}, - - {' ', CK_PageDown, "Space"}, - {'f', CK_PageDown, "f"}, - {KEY_NPAGE, CK_PageDown, "PgDn"}, - {XCTRL ('v'), CK_PageDown, "C-v"}, - - {'b', CK_PageUp, "b"}, - {KEY_PPAGE, CK_PageUp, "PgUp"}, - {ALT ('v'), CK_PageUp, "M-v"}, - {KEY_BACKSPACE, CK_PageUp, "BackSpace"}, - - {'d', CK_HalfPageDown, "d"}, - {'u', CK_HalfPageUp, "u"}, - - {KEY_HOME, CK_Top, "Home"}, - {KEY_M_CTRL | KEY_HOME, CK_Top, "C-Home"}, - {KEY_M_CTRL | KEY_PPAGE, CK_Top, "C-PgUp"}, - {KEY_A1, CK_Top, "A1"}, - {ALT ('<'), CK_Top, "M-<"}, - {'g', CK_Top, "g"}, - - {KEY_END, CK_Bottom, "End"}, - {KEY_M_CTRL | KEY_END, CK_Bottom, "C-End"}, - {KEY_M_CTRL | KEY_NPAGE, CK_Bottom, "C-PgDn"}, - {KEY_C1, CK_Bottom, "C1"}, - {ALT ('>'), CK_Bottom, "M->"}, - {'G', CK_Bottom, "G"}, - - {'m', CK_BookmarkGoto, "m"}, - {'r', CK_Bookmark, "r"}, - - {XCTRL ('f'), CK_FileNext, "C-f"}, - {XCTRL ('b'), CK_FilePrev, "C-b"}, - - {'q', CK_Quit, "q"}, - {XCTRL ('g'), CK_Quit, "C-g"}, - {ESC_CHAR, CK_Quit, "Esc"}, - +/* viewer */ +static const global_keymap_ini_t default_viewer_keymap[] = { + {"Help", "f1"}, + {"WrapMode", "f2"}, + {"Quit", "f3; f10; q; esc; ctrl-g"}, + {"HexMode", "f4"}, + {"Goto", "f5"}, + {"Search", "f7; question; slash"}, + {"SearchContinue", "ctrl-r; ctrl-s; f17; n"}, + {"MagicMode", "f8"}, + {"NroffMode", "f9"}, + {"Home", "ctrl-a"}, + {"End", "ctrl-e"}, + {"Left", "h; left"}, + {"Right", "l; right"}, + {"LeftQuick", "ctrl-left"}, + {"RightQuick", "ctrl-right"}, + {"Up", "k; y; insert; up; ctrl-p"}, + {"Down", "j; e; delete; down; enter; ctrl-n"}, + {"PageDown", "f; space; pgdn; ctrl-v"}, + {"PageUp", "b; pgup; alt-v; backspace"}, + {"HalfPageDown", "d"}, + {"HalfPageUp", "u"}, + {"Top", "home; ctrl-home; ctrl-pgup; a1; alt-lt; g"}, + {"Bottom", "end; ctrl-end; ctrl-pgdn; c1; alt-gt; shift-g"}, + {"BookmarkGoto", "m"}, + {"Bookmark", "r"}, + {"FileNext", "ctrl-f"}, + {"FilePrev", "ctrl-b"}, #ifdef HAVE_CHARSET - {ALT ('e'), CK_SelectCodepage, "M-e"}, + {"SelectCodepage", "alt-e"}, #endif - {XCTRL ('o'), CK_Shell, "C-o"}, - - {0, CK_IgnoreKey, ""} + {"Shell", "ctrl-o"}, + {"Ruler", "alt-r"}, + {NULL, NULL} }; -const global_keymap_t default_viewer_hex_keymap[] = { - {KEY_F (1), CK_Help, "F1"}, - {KEY_F (2), CK_HexEditMode, "F2"}, - {KEY_F (3), CK_Quit, "F3"}, - {KEY_F (4), CK_HexMode, "F4"}, - {KEY_F (5), CK_Goto, "F5"}, - {KEY_F (6), CK_Save, "F6"}, - {KEY_F (7), CK_Search, "F7"}, - {KEY_F (8), CK_MagicMode, "F8"}, - {KEY_F (9), CK_NroffMode, "F9"}, - {KEY_F (10), CK_Quit, "F10"}, - - {'?', CK_Search, "?"}, - {'/', CK_Search, "/"}, - {XCTRL ('r'), CK_SearchContinue, "C-r"}, - {XCTRL ('s'), CK_SearchContinue, "C-s"}, - {KEY_F (17), CK_SearchContinue, "S-F7"}, - {'n', CK_SearchContinue, "n"}, - - {'\t', CK_ToggleNavigation, "Tab"}, - {KEY_HOME, CK_Home, "Home"}, - {KEY_END, CK_End, "End"}, - {XCTRL ('a'), CK_Home, "C-a"}, - {XCTRL ('e'), CK_End, "C-e"}, - - {'b', CK_Left, "b"}, - {KEY_LEFT, CK_Left, "Left"}, - - {'f', CK_Right, "f"}, - {KEY_RIGHT, CK_Right, "Right"}, - - {'k', CK_Up, "k"}, - {'y', CK_Up, "y"}, - {KEY_UP, CK_Up, "Up"}, - - {'j', CK_Down, "j"}, - {KEY_DOWN, CK_Down, "Down"}, - {KEY_DC, CK_Down, "Delete"}, - - {KEY_NPAGE, CK_PageDown, "PgDn"}, - {XCTRL ('v'), CK_PageDown, "C-v"}, - - {KEY_PPAGE, CK_PageUp, "PgUp"}, - {ALT ('v'), CK_PageUp, "M-v"}, - - {KEY_M_CTRL | KEY_HOME, CK_Top, "C-Home"}, - {KEY_M_CTRL | KEY_PPAGE, CK_Top, "C-PgUp"}, - {KEY_A1, CK_Top, "A1"}, - {ALT ('<'), CK_Top, "M-<"}, - {'g', CK_Top, "g"}, - - {KEY_M_CTRL | KEY_END, CK_Bottom, "C-End"}, - {KEY_M_CTRL | KEY_NPAGE, CK_Bottom, "C-PgDn"}, - {KEY_C1, CK_Bottom, "C1"}, - {ALT ('>'), CK_Bottom, "M->"}, - {'G', CK_Bottom, "G"}, - - {'q', CK_Quit, "q"}, - {XCTRL ('g'), CK_Quit, "C-g"}, - {ESC_CHAR, CK_Quit, "Esc"}, - +/* hex viewer */ +static const global_keymap_ini_t default_viewer_hex_keymap[] = { + {"Help", "f1"}, + {"HexEditMode", "f2"}, + {"Quit", "f3; f10; q; esc; ctrl-g"}, + {"HexMode", "f4"}, + {"Goto", "f5"}, + {"Save", "f6"}, + {"Search", "f7; question; slash"}, + {"SearchContinue", "ctrl-r; ctrl-s; f17; n"}, + {"MagicMode", "f8"}, + {"NroffMode", "f9"}, + {"ToggleNavigation", "tab"}, + {"Home", "ctrl-a; home"}, + {"End", "ctrl-e; end"}, + {"Left", "b; left"}, + {"Right", "f; right"}, + {"Up", "k; y; up"}, + {"Down", "j; delete; down"}, + {"PageDown", "pgdn; ctrl-v"}, + {"PageUp", "pgup; alt-v"}, + {"Top", "ctrl-home; ctrl-pgup; a1; alt-lt; g"}, + {"Bottom", "ctrl-end; ctrl-pgdn; c1; alt-gt; shift-g"}, #ifdef HAVE_CHARSET - {ALT ('e'), CK_SelectCodepage, "M-e"}, + {"SelectCodepage", "alt-e"}, #endif - {XCTRL ('o'), CK_Shell, "C-o"}, - - {0, CK_IgnoreKey, ""} + {"Shell", "ctrl-o"}, + {NULL, NULL} }; - #ifdef USE_DIFF_VIEW /* diff viewer */ -const global_keymap_t default_diff_keymap[] = { - {'s', CK_ShowSymbols, "s"}, - {'l', CK_ShowNumbers, "l"}, - {'f', CK_SplitFull, "f"}, - {'=', CK_SplitEqual, "="}, - {'>', CK_SplitMore, ">"}, - {'<', CK_SplitLess, "<"}, - {'2', CK_Tab2, "2"}, - {'3', CK_Tab3, "3"}, - {'4', CK_Tab4, "4"}, - {'8', CK_Tab8, "8"}, - {XCTRL ('u'), CK_Swap, "C-u"}, - {XCTRL ('r'), CK_Redo, "C-r"}, - {XCTRL ('o'), CK_Shell, "C-o"}, - {'n', CK_HunkNext, "n"}, - {'p', CK_HunkPrev, "p"}, - {'g', CK_Goto, "g"}, - {'G', CK_Goto, "G"}, - {KEY_M_CTRL | KEY_HOME, CK_Top, "C-Home"}, - {KEY_M_CTRL | KEY_END, CK_Bottom, "C-End"}, - {KEY_DOWN, CK_Down, "Down"}, - {KEY_UP, CK_Up, "Up"}, - {KEY_M_CTRL | KEY_LEFT, CK_LeftQuick, "C-Left"}, - {KEY_M_CTRL | KEY_RIGHT, CK_RightQuick, "C-Right"}, - {KEY_LEFT, CK_Left, "Left"}, - {KEY_RIGHT, CK_Right, "Right"}, - {KEY_NPAGE, CK_PageDown, "PgDn"}, - {KEY_PPAGE, CK_PageUp, "PgUp"}, - {KEY_HOME, CK_Home, "Home"}, - {KEY_END, CK_End, "End"}, - {'q', CK_Quit, "q"}, - {'Q', CK_Quit, "Q"}, - {XCTRL ('g'), CK_Quit, "C-g"}, - {ESC_CHAR, CK_Quit, "Esc"}, - - {KEY_F (1), CK_Help, "F1"}, - {KEY_F (4), CK_Edit, "F4"}, - {KEY_F (5), CK_Merge, "F5"}, - {KEY_F (7), CK_Search, "F7"}, - {KEY_F (17), CK_SearchContinue, "S-F7"}, - {KEY_F (9), CK_Options, "F9"}, - {KEY_F (10), CK_Quit, "F10"}, - {KEY_F (14), CK_EditOther, "S-F4"}, - - {0, CK_IgnoreKey, ""} +static const global_keymap_ini_t default_diff_keymap[] = { + {"ShowSymbols", "alt-s; s"}, + {"ShowNumbers", "alt-n; l"}, + {"SplitFull", "f"}, + {"SplitEqual", "equal"}, + {"SplitMore", "gt"}, + {"SplitLess", "lt"}, + {"Tab2", "2"}, + {"Tab3", "3"}, + {"Tab4", "4"}, + {"Tab8", "8"}, + {"Swap", "ctrl-u"}, + {"Redo", "ctrl-r"}, + {"HunkNext", "n; enter; space"}, + {"HunkPrev", "p; backspace"}, + {"Goto", "g; shift-g"}, + {"Save", "f2"}, + {"Edit", "f4"}, + {"EditOther", "f14"}, + {"Merge", "f5"}, + {"Search", "f7"}, + {"SearchContinue", "f17"}, + {"Options", "f9"}, + {"Top", "ctrl-home"}, + {"Bottom", "ctrl-end"}, + {"Down", "down"}, + {"Up", "up"}, + {"LeftQuick", "ctrl-left"}, + {"RightQuick", "ctrl-right"}, + {"Left", "left"}, + {"Right", "right"}, + {"PageDown", "pgdn"}, + {"PageUp", "pgup"}, + {"Home", "home"}, + {"End", "end"}, + {"Help", "f1"}, + {"Quit", "f10; q; shift-q; ctrl-g; esc"}, +#ifdef HAVE_CHARSET + {"SelectCodepage", "alt-e"}, +#endif + {"Shell", "ctrl-o"}, + {NULL, NULL} }; #endif @@ -723,6 +544,44 @@ const global_keymap_t default_diff_keymap[] = { /*** file scope functions ************************************************************************/ /* --------------------------------------------------------------------------------------------- */ +static void +create_default_keymap_section (mc_config_t *keymap, const char *section, + const global_keymap_ini_t *k) +{ + size_t i; + + for (i = 0; k[i].key != NULL; i++) + mc_config_set_string_raw (keymap, section, k[i].key, k[i].value); +} + /* --------------------------------------------------------------------------------------------- */ /*** public functions ****************************************************************************/ /* --------------------------------------------------------------------------------------------- */ + +mc_config_t * +create_default_keymap (void) +{ + mc_config_t *keymap; + + keymap = mc_config_init (NULL); + + create_default_keymap_section (keymap, "main", default_main_keymap); + create_default_keymap_section (keymap, "main:xmap", default_main_x_keymap); + create_default_keymap_section (keymap, "panel", default_panel_keymap); + create_default_keymap_section (keymap, "dialog", default_dialog_keymap); + create_default_keymap_section (keymap, "input", default_input_keymap); + create_default_keymap_section (keymap, "listbox", default_listbox_keymap); + create_default_keymap_section (keymap, "tree", default_tree_keymap); + create_default_keymap_section (keymap, "help", default_help_keymap); +#ifdef USE_INTERNAL_EDIT + create_default_keymap_section (keymap, "editor", default_editor_keymap); + create_default_keymap_section (keymap, "editor:xmap", default_editor_x_keymap); +#endif + create_default_keymap_section (keymap, "viewer", default_viewer_keymap); + create_default_keymap_section (keymap, "viewer:hex", default_viewer_hex_keymap); +#ifdef USE_DIFF_VIEW + create_default_keymap_section (keymap, "diffviewer", default_diff_keymap); +#endif + + return keymap; +} diff --git a/src/keybind-defaults.h b/src/keybind-defaults.h index 9914e3cf1..53b324afb 100644 --- a/src/keybind-defaults.h +++ b/src/keybind-defaults.h @@ -3,6 +3,7 @@ #include "lib/global.h" #include "lib/keybind.h" /* global_keymap_t */ +#include "lib/mcconfig.h" /* mc_config_t */ /*** typedefs(not structures) and defined constants **********************************************/ @@ -49,36 +50,10 @@ extern const global_keymap_t *viewer_hex_map; extern const global_keymap_t *diff_map; #endif - -/* main.c */ -extern const global_keymap_t default_main_keymap[]; -extern const global_keymap_t default_main_x_keymap[]; -/* screen.c */ -extern const global_keymap_t default_panel_keymap[]; -/* dialog.c */ -extern const global_keymap_t default_dialog_keymap[]; -/* widget.c */ -extern const global_keymap_t default_input_keymap[]; -extern const global_keymap_t default_listbox_keymap[]; -/* tree.c */ -extern const global_keymap_t default_tree_keymap[]; -/* help.c */ -extern const global_keymap_t default_help_keymap[]; -#ifdef USE_INTERNAL_EDIT -/* ../edit/editkey.c */ -extern const global_keymap_t default_editor_keymap[]; -extern const global_keymap_t default_editor_x_keymap[]; -#endif -/* viewer/actions_cmd.c */ -extern const global_keymap_t default_viewer_keymap[]; -extern const global_keymap_t default_viewer_hex_keymap[]; -#ifdef USE_DIFF_VIEW -/* ydiff.c */ -extern const global_keymap_t default_diff_keymap[]; -#endif - /*** declarations of public functions ************************************************************/ +mc_config_t *create_default_keymap (void); + /*** inline functions ****************************************************************************/ #endif /* MC__KEYBIND_DEFAULTS_H */ diff --git a/src/setup.c b/src/setup.c index c32a5e935..7bf39f4c5 100644 --- a/src/setup.c +++ b/src/setup.c @@ -517,7 +517,6 @@ setup__move_panels_config_into_separate_file (const char *profile) /** Create new mc_config object from specified ini-file or append data to existing mc_config object from ini-file - */ static void @@ -665,14 +664,19 @@ load_keymap_from_section (const char *section_name, GArray * keymap, mc_config_t /* --------------------------------------------------------------------------------------------- */ static mc_config_t * -load_setup_get_keymap_profile_config (void) +load_setup_get_keymap_profile_config (gboolean load_from_file) { /* TODO: IMHO, in future this function must be placed into mc_config module. */ - mc_config_t *keymap_config = NULL; + mc_config_t *keymap_config; char *fname, *fname2; + /* 0) Create default keymap */ + keymap_config = create_default_keymap (); + if (!load_from_file) + return keymap_config; + /* 1) /usr/share/mc (mc_share_data_dir) */ fname = g_build_filename (mc_share_data_dir, GLOBAL_KEYMAP_FILE, NULL); load_setup_init_config_from_file (&keymap_config, fname); @@ -1160,10 +1164,9 @@ load_keymap_defs (gboolean load_from_file) * Load keymap from GLOBAL_KEYMAP_FILE before ${XDG_DATA_HOME}/mc/keymap, so that the user * definitions override global settings. */ - mc_config_t *mc_global_keymap = NULL; + mc_config_t *mc_global_keymap; - if (load_from_file) - mc_global_keymap = load_setup_get_keymap_profile_config (); + mc_global_keymap = load_setup_get_keymap_profile_config (load_from_file); if (mc_global_keymap != NULL) { @@ -1210,60 +1213,22 @@ load_keymap_defs (gboolean load_from_file) mc_config_deinit (mc_global_keymap); } - main_map = default_main_keymap; - if (main_keymap && main_keymap->len > 0) - main_map = (global_keymap_t *) main_keymap->data; - - main_x_map = default_main_x_keymap; - if (main_x_keymap && main_x_keymap->len > 0) - main_x_map = (global_keymap_t *) main_x_keymap->data; - - panel_map = default_panel_keymap; - if (panel_keymap && panel_keymap->len > 0) - panel_map = (global_keymap_t *) panel_keymap->data; - - dialog_map = default_dialog_keymap; - if (dialog_keymap && dialog_keymap->len > 0) - dialog_map = (global_keymap_t *) dialog_keymap->data; - - input_map = default_input_keymap; - if (input_keymap && input_keymap->len > 0) - input_map = (global_keymap_t *) input_keymap->data; - - listbox_map = default_listbox_keymap; - if (listbox_keymap && listbox_keymap->len > 0) - listbox_map = (global_keymap_t *) listbox_keymap->data; - - tree_map = default_tree_keymap; - if (tree_keymap && tree_keymap->len > 0) - tree_map = (global_keymap_t *) tree_keymap->data; - - help_map = default_help_keymap; - if (help_keymap && help_keymap->len > 0) - help_map = (global_keymap_t *) help_keymap->data; - + main_map = (global_keymap_t *) main_keymap->data; + main_x_map = (global_keymap_t *) main_x_keymap->data; + panel_map = (global_keymap_t *) panel_keymap->data; + dialog_map = (global_keymap_t *) dialog_keymap->data; + input_map = (global_keymap_t *) input_keymap->data; + listbox_map = (global_keymap_t *) listbox_keymap->data; + tree_map = (global_keymap_t *) tree_keymap->data; + help_map = (global_keymap_t *) help_keymap->data; #ifdef USE_INTERNAL_EDIT - editor_map = default_editor_keymap; - if (editor_keymap && editor_keymap->len > 0) - editor_map = (global_keymap_t *) editor_keymap->data; - - editor_x_map = default_editor_x_keymap; - if (editor_x_keymap && editor_x_keymap->len > 0) - editor_x_map = (global_keymap_t *) editor_x_keymap->data; + editor_map = (global_keymap_t *) editor_keymap->data; + editor_x_map = (global_keymap_t *) editor_x_keymap->data; #endif - - viewer_map = default_viewer_keymap; - if (viewer_keymap && viewer_keymap->len > 0) - viewer_map = (global_keymap_t *) viewer_keymap->data; - - viewer_hex_map = default_viewer_hex_keymap; - if (viewer_hex_keymap && viewer_hex_keymap->len > 0) - viewer_hex_map = (global_keymap_t *) viewer_hex_keymap->data; - + viewer_map = (global_keymap_t *) viewer_keymap->data; + viewer_hex_map = (global_keymap_t *) viewer_hex_keymap->data; #ifdef USE_DIFF_VIEW - diff_map = default_diff_keymap; - if (diff_keymap && diff_keymap->len > 0) - diff_map = (global_keymap_t *) diff_keymap->data; + diff_map = (global_keymap_t *) diff_keymap->data; #endif } From 5ef63751203f6854ef08bb1fd170f02424fa6957 Mon Sep 17 00:00:00 2001 From: Andrew Borodin Date: Sun, 27 Feb 2011 17:03:31 +0300 Subject: [PATCH 9/9] Symbolic names of keymap sections are defined. Signed-off-by: Andrew Borodin --- lib/keybind.h | 15 +++++++++++++++ src/keybind-defaults.c | 26 +++++++++++++------------- src/setup.c | 26 +++++++++++++------------- 3 files changed, 41 insertions(+), 26 deletions(-) diff --git a/lib/keybind.h b/lib/keybind.h index 3532d77d8..42fb04daf 100644 --- a/lib/keybind.h +++ b/lib/keybind.h @@ -8,6 +8,21 @@ /*** typedefs(not structures) and defined constants **********************************************/ +/* keymap sections */ +#define KEYMAP_SECTION_MAIN "main" +#define KEYMAP_SECTION_MAIN_EXT "main:xmap" +#define KEYMAP_SECTION_PANEL "panel" +#define KEYMAP_SECTION_DIALOG "dialog" +#define KEYMAP_SECTION_INPUT "input" +#define KEYMAP_SECTION_LISTBOX "listbox" +#define KEYMAP_SECTION_TREE "tree" +#define KEYMAP_SECTION_HELP "help" +#define KEYMAP_SECTION_EDITOR "editor" +#define KEYMAP_SECTION_EDITOR_EXT "editor:xmap" +#define KEYMAP_SECTION_VIEWER "viewer" +#define KEYMAP_SECTION_VIEWER_HEX "viewer:hex" +#define KEYMAP_SECTION_DIFFVIEWER "diffviewer" + #define KEYMAP_SHORTCUT_LENGTH 32 /* FIXME: is 32 bytes enough for shortcut? */ #define CK_PipeBlock(i) (10000+(i)) diff --git a/src/keybind-defaults.c b/src/keybind-defaults.c index d4ca0ee41..b46b87e46 100644 --- a/src/keybind-defaults.c +++ b/src/keybind-defaults.c @@ -565,22 +565,22 @@ create_default_keymap (void) keymap = mc_config_init (NULL); - create_default_keymap_section (keymap, "main", default_main_keymap); - create_default_keymap_section (keymap, "main:xmap", default_main_x_keymap); - create_default_keymap_section (keymap, "panel", default_panel_keymap); - create_default_keymap_section (keymap, "dialog", default_dialog_keymap); - create_default_keymap_section (keymap, "input", default_input_keymap); - create_default_keymap_section (keymap, "listbox", default_listbox_keymap); - create_default_keymap_section (keymap, "tree", default_tree_keymap); - create_default_keymap_section (keymap, "help", default_help_keymap); + create_default_keymap_section (keymap, KEYMAP_SECTION_MAIN, default_main_keymap); + create_default_keymap_section (keymap, KEYMAP_SECTION_MAIN_EXT, default_main_x_keymap); + create_default_keymap_section (keymap, KEYMAP_SECTION_PANEL, default_panel_keymap); + create_default_keymap_section (keymap, KEYMAP_SECTION_DIALOG, default_dialog_keymap); + create_default_keymap_section (keymap, KEYMAP_SECTION_INPUT, default_input_keymap); + create_default_keymap_section (keymap, KEYMAP_SECTION_LISTBOX, default_listbox_keymap); + create_default_keymap_section (keymap, KEYMAP_SECTION_TREE, default_tree_keymap); + create_default_keymap_section (keymap, KEYMAP_SECTION_HELP, default_help_keymap); #ifdef USE_INTERNAL_EDIT - create_default_keymap_section (keymap, "editor", default_editor_keymap); - create_default_keymap_section (keymap, "editor:xmap", default_editor_x_keymap); + create_default_keymap_section (keymap, KEYMAP_SECTION_EDITOR, default_editor_keymap); + create_default_keymap_section (keymap, KEYMAP_SECTION_EDITOR_EXT, default_editor_x_keymap); #endif - create_default_keymap_section (keymap, "viewer", default_viewer_keymap); - create_default_keymap_section (keymap, "viewer:hex", default_viewer_hex_keymap); + create_default_keymap_section (keymap, KEYMAP_SECTION_VIEWER, default_viewer_keymap); + create_default_keymap_section (keymap, KEYMAP_SECTION_VIEWER_HEX, default_viewer_hex_keymap); #ifdef USE_DIFF_VIEW - create_default_keymap_section (keymap, "diffviewer", default_diff_keymap); + create_default_keymap_section (keymap, KEYMAP_SECTION_DIFFVIEWER, default_diff_keymap); #endif return keymap; diff --git a/src/setup.c b/src/setup.c index 7bf39f4c5..31b504854 100644 --- a/src/setup.c +++ b/src/setup.c @@ -1171,43 +1171,43 @@ load_keymap_defs (gboolean load_from_file) if (mc_global_keymap != NULL) { main_keymap = g_array_new (TRUE, FALSE, sizeof (global_keymap_t)); - load_keymap_from_section ("main", main_keymap, mc_global_keymap); + load_keymap_from_section (KEYMAP_SECTION_MAIN, main_keymap, mc_global_keymap); main_x_keymap = g_array_new (TRUE, FALSE, sizeof (global_keymap_t)); - load_keymap_from_section ("main:xmap", main_x_keymap, mc_global_keymap); + load_keymap_from_section (KEYMAP_SECTION_MAIN_EXT, main_x_keymap, mc_global_keymap); panel_keymap = g_array_new (TRUE, FALSE, sizeof (global_keymap_t)); - load_keymap_from_section ("panel", panel_keymap, mc_global_keymap); + load_keymap_from_section (KEYMAP_SECTION_PANEL, panel_keymap, mc_global_keymap); dialog_keymap = g_array_new (TRUE, FALSE, sizeof (global_keymap_t)); - load_keymap_from_section ("dialog", dialog_keymap, mc_global_keymap); + load_keymap_from_section (KEYMAP_SECTION_DIALOG, dialog_keymap, mc_global_keymap); input_keymap = g_array_new (TRUE, FALSE, sizeof (global_keymap_t)); - load_keymap_from_section ("input", input_keymap, mc_global_keymap); + load_keymap_from_section (KEYMAP_SECTION_INPUT, input_keymap, mc_global_keymap); listbox_keymap = g_array_new (TRUE, FALSE, sizeof (global_keymap_t)); - load_keymap_from_section ("listbox", listbox_keymap, mc_global_keymap); + load_keymap_from_section (KEYMAP_SECTION_LISTBOX, listbox_keymap, mc_global_keymap); tree_keymap = g_array_new (TRUE, FALSE, sizeof (global_keymap_t)); - load_keymap_from_section ("tree", tree_keymap, mc_global_keymap); + load_keymap_from_section (KEYMAP_SECTION_TREE, tree_keymap, mc_global_keymap); help_keymap = g_array_new (TRUE, FALSE, sizeof (global_keymap_t)); - load_keymap_from_section ("help", help_keymap, mc_global_keymap); + load_keymap_from_section (KEYMAP_SECTION_HELP, help_keymap, mc_global_keymap); #ifdef USE_INTERNAL_EDIT editor_keymap = g_array_new (TRUE, FALSE, sizeof (global_keymap_t)); - load_keymap_from_section ("editor", editor_keymap, mc_global_keymap); + load_keymap_from_section (KEYMAP_SECTION_EDITOR, editor_keymap, mc_global_keymap); editor_x_keymap = g_array_new (TRUE, FALSE, sizeof (global_keymap_t)); - load_keymap_from_section ("editor:xmap", editor_x_keymap, mc_global_keymap); + load_keymap_from_section (KEYMAP_SECTION_EDITOR_EXT, editor_x_keymap, mc_global_keymap); #endif viewer_keymap = g_array_new (TRUE, FALSE, sizeof (global_keymap_t)); - load_keymap_from_section ("viewer", viewer_keymap, mc_global_keymap); + load_keymap_from_section (KEYMAP_SECTION_VIEWER, viewer_keymap, mc_global_keymap); viewer_hex_keymap = g_array_new (TRUE, FALSE, sizeof (global_keymap_t)); - load_keymap_from_section ("viewer:hex", viewer_hex_keymap, mc_global_keymap); + load_keymap_from_section (KEYMAP_SECTION_VIEWER_HEX, viewer_hex_keymap, mc_global_keymap); #ifdef USE_DIFF_VIEW diff_keymap = g_array_new (TRUE, FALSE, sizeof (global_keymap_t)); - load_keymap_from_section ("diffviewer", diff_keymap, mc_global_keymap); + load_keymap_from_section (KEYMAP_SECTION_DIFFVIEWER, diff_keymap, mc_global_keymap); #endif mc_config_deinit (mc_global_keymap);