2009-09-17 14:47:56 +04:00
|
|
|
/*
|
|
|
|
Copyright (C) 2009 The Free Software Foundation, Inc.
|
|
|
|
|
|
|
|
Written by: 2005 Vitja Makarov
|
|
|
|
2009 Ilia Maslakov
|
|
|
|
|
|
|
|
This file is part of the Midnight Commander.
|
|
|
|
|
|
|
|
The Midnight Commander is free software; you can redistribute it
|
|
|
|
and/or modify it under the terms of the GNU General Public License as
|
|
|
|
published by the Free Software Foundation; either version 2 of the
|
|
|
|
License, or (at your option) any later version.
|
|
|
|
|
|
|
|
The Midnight Commander is distributed in the hope that it will be
|
|
|
|
useful, but WITHOUT ANY WARRANTY; without even the implied warranty
|
|
|
|
of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
|
|
|
|
General Public License for more details.
|
|
|
|
|
|
|
|
You should have received a copy of the GNU General Public License
|
|
|
|
along with this program; if not, write to the Free Software
|
|
|
|
Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston,
|
|
|
|
MA 02110-1301, USA.
|
2009-07-05 19:04:42 +04:00
|
|
|
*/
|
|
|
|
|
|
|
|
#include <config.h>
|
|
|
|
|
|
|
|
#include <ctype.h>
|
|
|
|
#include <errno.h>
|
|
|
|
#include <stdarg.h>
|
|
|
|
#include <stdio.h>
|
|
|
|
#include <stdlib.h>
|
|
|
|
#include <string.h>
|
|
|
|
#include <sys/types.h>
|
|
|
|
#include <sys/stat.h>
|
|
|
|
#include <unistd.h>
|
|
|
|
|
2010-01-20 18:11:52 +03:00
|
|
|
#include "lib/global.h"
|
2010-01-08 17:47:19 +03:00
|
|
|
#include "lib/tty/win.h"
|
|
|
|
#include "lib/tty/key.h" /* KEY_M_ */
|
|
|
|
#include "lib/tty/tty.h" /* keys */
|
2010-01-21 15:17:26 +03:00
|
|
|
#include "lib/strutil.h"
|
2009-09-14 21:13:54 +04:00
|
|
|
|
2010-01-21 15:17:26 +03:00
|
|
|
#include "cmddef.h" /* CK_ cmd name const */
|
|
|
|
#include "wtools.h"
|
2009-07-05 19:04:42 +04:00
|
|
|
#include "keybind.h"
|
|
|
|
|
2010-05-06 23:19:02 +04:00
|
|
|
#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 *input_keymap = NULL;
|
|
|
|
GArray *tree_keymap = NULL;
|
|
|
|
GArray *help_keymap = NULL;
|
|
|
|
GArray *dialog_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 *input_map;
|
|
|
|
const global_keymap_t *tree_map;
|
|
|
|
const global_keymap_t *help_map;
|
|
|
|
const global_keymap_t *dialog_map;
|
|
|
|
|
2009-11-03 19:39:16 +03:00
|
|
|
static name_keymap_t command_names[] = {
|
2009-10-01 22:23:50 +04:00
|
|
|
#ifdef USE_INTERNAL_EDIT
|
2009-09-11 18:13:17 +04:00
|
|
|
{ "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 },
|
|
|
|
{ "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 },
|
2009-11-06 14:55:21 +03:00
|
|
|
{ "EditMenu", CK_Menu },
|
2009-09-11 18:13:17 +04:00
|
|
|
{ "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 },
|
2010-01-16 15:56:14 +03:00
|
|
|
{ "EditMarkAll", CK_Mark_All },
|
2009-09-11 18:13:17 +04:00
|
|
|
{ "EditUnmark", CK_Unmark },
|
|
|
|
{ "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 },
|
2010-01-16 15:56:14 +03:00
|
|
|
|
2009-11-06 14:41:54 +03:00
|
|
|
#if 0
|
2009-09-11 18:13:17 +04:00
|
|
|
{ "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 },
|
2009-11-06 14:41:54 +03:00
|
|
|
#endif
|
2009-09-11 18:13:17 +04:00
|
|
|
{ "EditInsertFile", CK_Insert_File },
|
2009-10-24 16:40:19 +04:00
|
|
|
{ "EditQuit", CK_Quit },
|
2009-09-11 18:13:17 +04:00
|
|
|
{ "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 },
|
|
|
|
{ "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 },
|
2009-09-26 03:38:04 +04:00
|
|
|
|
|
|
|
{ "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 },
|
|
|
|
|
2009-10-28 14:32:48 +03:00
|
|
|
{ "EditShiftBlockLeft", CK_Shift_Block_Left },
|
|
|
|
{ "EditShiftBlockRight", CK_Shift_Block_Right },
|
|
|
|
|
2009-09-11 18:13:17 +04:00
|
|
|
{ "EditXStore", CK_XStore },
|
|
|
|
{ "EditXCut", CK_XCut },
|
|
|
|
{ "EditXPaste", CK_XPaste },
|
|
|
|
{ "EditSelectionHistory", CK_Selection_History },
|
|
|
|
{ "EditShell", CK_Shell },
|
|
|
|
{ "EditInsertLiteral", CK_Insert_Literal },
|
|
|
|
{ "EditExecuteMacro", CK_Execute_Macro },
|
2009-10-25 12:15:19 +03:00
|
|
|
{ "EditBeginOrEndMacro", CK_Begin_End_Macro },
|
|
|
|
{ "EditExtMode", CK_Ext_Mode },
|
2009-09-11 18:13:17 +04:00
|
|
|
{ "EditToggleLineState", CK_Toggle_Line_State },
|
2009-09-30 13:13:29 +04:00
|
|
|
{ "EditToggleTabTWS", CK_Toggle_Tab_TWS },
|
2009-10-10 10:15:21 +04:00
|
|
|
{ "EditToggleSyntax", CK_Toggle_Syntax },
|
2010-01-03 04:58:35 +03:00
|
|
|
{ "EditToggleShowMargin", CK_Toggle_Show_Margin },
|
2009-09-30 13:13:29 +04:00
|
|
|
{ "EditFindDefinition", CK_Find_Definition },
|
|
|
|
{ "EditLoadPrevFile", CK_Load_Prev_File },
|
|
|
|
{ "EditLoadNextFile", CK_Load_Next_File },
|
2009-10-01 22:23:50 +04:00
|
|
|
{ "EditOptions", CK_Edit_Options },
|
|
|
|
{ "EditSaveMode", CK_Edit_Save_Mode },
|
|
|
|
{ "EditChooseSyntax", CK_Choose_Syntax },
|
|
|
|
{ "EditAbout", CK_About },
|
2009-09-30 13:13:29 +04:00
|
|
|
|
2009-07-05 19:04:42 +04:00
|
|
|
#if 0
|
2009-10-09 15:46:08 +04:00
|
|
|
{ "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 },
|
2009-10-01 22:23:50 +04:00
|
|
|
#endif
|
|
|
|
|
|
|
|
#if 0
|
2009-10-09 15:46:08 +04:00
|
|
|
{ "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 },
|
2009-10-01 22:23:50 +04:00
|
|
|
#endif
|
|
|
|
|
2009-11-02 17:01:08 +03:00
|
|
|
#endif /* USE_INTERNAL_EDIT */
|
2009-07-05 19:04:42 +04:00
|
|
|
|
2009-09-11 18:13:17 +04:00
|
|
|
/* viewer */
|
2009-11-07 13:46:05 +03:00
|
|
|
{ "ViewHelp", CK_ViewHelp },
|
|
|
|
{ "ViewToggleWrapMode", CK_ViewToggleWrapMode },
|
|
|
|
{ "ViewToggleHexEditMode", CK_ViewToggleHexEditMode },
|
|
|
|
{ "ViewQuit", CK_ViewQuit },
|
|
|
|
{ "ViewToggleHexMode", CK_ViewToggleHexMode },
|
|
|
|
{ "ViewGoto", CK_ViewGoto },
|
|
|
|
{ "ViewHexEditSave", CK_ViewHexEditSave },
|
2009-10-09 15:46:08 +04:00
|
|
|
{ "ViewSearch", CK_ViewSearch },
|
2009-11-07 13:46:05 +03:00
|
|
|
{ "ViewToggleMagicMode", CK_ViewToggleMagicMode },
|
|
|
|
{ "ViewToggleNroffMode", CK_ViewToggleNroffMode },
|
2009-10-09 15:46:08 +04:00
|
|
|
{ "ViewContinueSearch", CK_ViewContinueSearch },
|
|
|
|
{ "ViewGotoBookmark", CK_ViewGotoBookmark },
|
|
|
|
{ "ViewNewBookmark", CK_ViewNewBookmark },
|
|
|
|
{ "ViewMoveUp", CK_ViewMoveUp },
|
|
|
|
{ "ViewMoveDown", CK_ViewMoveDown },
|
|
|
|
{ "ViewMoveLeft", CK_ViewMoveLeft },
|
|
|
|
{ "ViewMoveRight", CK_ViewMoveRight },
|
|
|
|
{ "ViewMovePgDn", CK_ViewMovePgDn },
|
|
|
|
{ "ViewMovePgUp", CK_ViewMovePgUp },
|
|
|
|
{ "ViewMoveHalfPgDn", CK_ViewMoveHalfPgDn },
|
|
|
|
{ "ViewMoveHalfPgUp", CK_ViewMoveHalfPgUp },
|
|
|
|
{ "ViewMoveToBol", CK_ViewMoveToBol },
|
|
|
|
{ "ViewMoveToEol", CK_ViewMoveToEol },
|
|
|
|
{ "ViewNextFile", CK_ViewNextFile },
|
|
|
|
{ "ViewPrevFile", CK_ViewPrevFile },
|
|
|
|
{ "ViewToggleRuler", CK_ViewToggleRuler },
|
2009-11-07 13:46:05 +03:00
|
|
|
{ "ViewToggleHexNavMode", CK_ViewToggleHexNavMode },
|
2009-07-05 19:04:42 +04:00
|
|
|
|
2009-11-07 18:36:44 +03:00
|
|
|
/* help */
|
|
|
|
{ "HelpHelp", CK_HelpHelp },
|
|
|
|
{ "HelpIndex", CK_HelpIndex },
|
|
|
|
{ "HelpBack", CK_HelpBack },
|
|
|
|
{ "HelpQuit", CK_HelpQuit },
|
|
|
|
{ "HelpMoveUp", CK_HelpMoveUp },
|
|
|
|
{ "HelpMoveDown", CK_HelpMoveDown },
|
|
|
|
{ "HelpSelectLink", CK_HelpSelectLink },
|
|
|
|
{ "HelpNextLink", CK_HelpNextLink },
|
|
|
|
{ "HelpPrevLink", CK_HelpPrevLink },
|
|
|
|
{ "HelpNextNode", CK_HelpNextNode },
|
|
|
|
{ "HelpPrevNode", CK_HelpPrevNode },
|
|
|
|
|
2009-11-02 17:01:08 +03:00
|
|
|
/* 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 },
|
|
|
|
|
2009-09-11 18:13:17 +04:00
|
|
|
/* main commands */
|
2009-11-06 14:55:21 +03:00
|
|
|
{ "CmdHelp", CK_HelpCmd },
|
|
|
|
{ "CmdMenu", CK_MenuCmd },
|
2009-10-09 15:46:08 +04:00
|
|
|
{ "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 },
|
|
|
|
{ "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 },
|
2009-10-01 22:23:50 +04:00
|
|
|
#ifdef USE_NETCODE
|
2009-10-09 15:46:08 +04:00
|
|
|
{ "CmdFishlink", CK_FishlinkCmd },
|
|
|
|
{ "CmdFtplink", CK_FtplinkCmd },
|
2009-10-01 22:23:50 +04:00
|
|
|
#endif
|
2009-10-09 15:46:08 +04:00
|
|
|
{ "CmdHistory", CK_HistoryCmd },
|
|
|
|
{ "CmdInfo", CK_InfoCmd },
|
2009-10-01 22:23:50 +04:00
|
|
|
#ifdef WITH_BACKGROUND
|
2009-10-09 15:46:08 +04:00
|
|
|
{ "CmdJobs", CK_JobsCmd },
|
2009-10-01 22:23:50 +04:00
|
|
|
#endif
|
2010-03-09 22:03:51 +03:00
|
|
|
{ "CmdLayout", CK_LayoutBox },
|
2009-10-09 15:46:08 +04:00
|
|
|
{ "CmdLearnKeys", CK_LearnKeys },
|
|
|
|
{ "CmdLink", CK_LinkCmd },
|
2010-03-08 12:10:36 +03:00
|
|
|
{ "CmdChangeListing", CK_ChangeListingCmd },
|
2009-10-09 15:46:08 +04:00
|
|
|
{ "CmdListing", CK_ListingCmd },
|
2009-10-01 22:23:50 +04:00
|
|
|
#ifdef LISTMODE_EDITOR
|
2009-10-09 15:46:08 +04:00
|
|
|
{ "CmdListmodeCmd", CK_ListmodeCmd }.
|
2009-10-01 22:23:50 +04:00
|
|
|
#endif
|
2009-10-09 15:46:08 +04:00
|
|
|
{ "CmdMkdir", CK_MkdirCmd },
|
2009-10-01 22:23:50 +04:00
|
|
|
#if defined (USE_NETCODE) && defined (ENABLE_VFS_MCFS)
|
2009-10-09 15:46:08 +04:00
|
|
|
{ "CmdNetlink", CK_NetlinkCmd },
|
2009-10-01 22:23:50 +04:00
|
|
|
#endif
|
2010-03-09 22:03:51 +03:00
|
|
|
{ "CmdPanelOptions", CK_PanelOptionsBox },
|
2009-10-09 15:46:08 +04:00
|
|
|
{ "CmdQuickCd", CK_QuickCdCmd },
|
|
|
|
{ "CmdQuickChdir", CK_QuickChdirCmd },
|
|
|
|
{ "CmdQuickView", CK_QuickViewCmd },
|
|
|
|
{ "CmdQuietQuit", CK_QuietQuitCmd },
|
2010-05-10 13:43:34 +04:00
|
|
|
{ "CmdRelativeSymlink", CK_RelativeSymlinkCmd },
|
2009-10-24 16:40:19 +04:00
|
|
|
{ "CmdRename", CK_RenameCmd },
|
2009-10-09 15:46:08 +04:00
|
|
|
{ "CmdReread", CK_RereadCmd },
|
|
|
|
{ "CmdReselectVfs", CK_ReselectVfs },
|
|
|
|
{ "CmdReverseSelection", CK_ReverseSelectionCmd },
|
|
|
|
{ "CmdSaveSetup", CK_SaveSetupCmd },
|
|
|
|
{ "CmdSelect", CK_SelectCmd },
|
2009-11-14 19:10:57 +03:00
|
|
|
#if defined (USE_NETCODE) && defined (ENABLE_VFS_SMB)
|
2009-10-09 15:46:08 +04:00
|
|
|
{ "CmdSmblinkCmd", CK_SmblinkCmd },
|
2010-01-03 02:58:23 +03:00
|
|
|
#endif /* USE_NETCODE || ENABLE_VFS_SMB */
|
2009-10-09 15:46:08 +04:00
|
|
|
{ "CmdSwapPanel", CK_SwapCmd },
|
|
|
|
{ "CmdSymlink", CK_SymlinkCmd },
|
|
|
|
{ "CmdTree", CK_TreeCmd },
|
|
|
|
{ "CmdTreeBox", CK_TreeBoxCmd },
|
2009-10-01 22:23:50 +04:00
|
|
|
#ifdef USE_EXT2FSLIB
|
2009-10-09 15:46:08 +04:00
|
|
|
{ "CmdUndelete", CK_UndeleteCmd },
|
2009-10-01 22:23:50 +04:00
|
|
|
#endif
|
2009-10-09 15:46:08 +04:00
|
|
|
{ "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 },
|
2009-10-28 19:15:33 +03:00
|
|
|
{ "CmdCopyCurrentTagged", CK_CopyCurrentTagged },
|
|
|
|
{ "CmdCopyOtherTagged", CK_CopyOtherTagged },
|
2009-10-09 15:46:08 +04:00
|
|
|
{ "CmdToggleShowHidden", CK_ToggleShowHidden },
|
2010-02-03 15:55:36 +03:00
|
|
|
{ "CmdTogglePanelsSplit", CK_TogglePanelsSplit },
|
2010-03-03 16:09:15 +03:00
|
|
|
#ifdef USE_DIFF_VIEW
|
|
|
|
{ "CmdDiffView", CK_DiffViewCmd},
|
|
|
|
#endif
|
2009-07-05 19:04:42 +04:00
|
|
|
|
2009-09-11 18:13:17 +04:00
|
|
|
/* panel */
|
2009-10-09 15:46:08 +04:00
|
|
|
{ "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 },
|
|
|
|
{ "PanelCtrlNextPage", CK_PanelCtrlNextPage },
|
|
|
|
{ "PanelCtrlPrevPage", CK_PanelCtrlPrevPage },
|
|
|
|
{ "PanelDirectoryHistoryList", CK_PanelDirectoryHistoryList },
|
|
|
|
{ "PanelDirectoryHistoryNext", CK_PanelDirectoryHistoryNext },
|
|
|
|
{ "PanelDirectoryHistoryPrev", CK_PanelDirectoryHistoryPrev },
|
|
|
|
{ "PanelGotoBottomFile", CK_PanelGotoBottomFile },
|
|
|
|
{ "PanelGotoMiddleFile", CK_PanelGotoMiddleFile },
|
|
|
|
{ "PanelGotoTopFile", CK_PanelGotoTopFile },
|
|
|
|
{ "PanelMarkFile", CK_PanelMarkFile },
|
2010-05-10 22:34:17 +04:00
|
|
|
{ "PanelMarkFileDown", CK_PanelMarkFileDown },
|
|
|
|
{ "PanelMarkFileUp", CK_PanelMarkFileUp },
|
2009-10-09 15:46:08 +04:00
|
|
|
{ "PanelMoveUp", CK_PanelMoveUp },
|
|
|
|
{ "PanelMoveDown", CK_PanelMoveDown },
|
|
|
|
{ "PanelMoveLeft", CK_PanelMoveLeft },
|
|
|
|
{ "PanelMoveRight", CK_PanelMoveRight },
|
|
|
|
{ "PanelMoveEnd", CK_PanelMoveEnd },
|
|
|
|
{ "PanelMoveHome", CK_PanelMoveHome },
|
|
|
|
{ "PanelNextPage", CK_PanelNextPage },
|
|
|
|
{ "PanelPrevPage", CK_PanelPrevPage },
|
2009-10-01 22:23:50 +04:00
|
|
|
#ifdef HAVE_CHARSET
|
2009-10-09 15:46:08 +04:00
|
|
|
{ "PanelSetPanelEncoding", CK_PanelSetPanelEncoding },
|
2009-10-01 22:23:50 +04:00
|
|
|
#endif
|
2009-10-09 15:46:08 +04:00
|
|
|
{ "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 },
|
2009-09-14 21:13:54 +04:00
|
|
|
|
2009-10-01 22:23:50 +04:00
|
|
|
/* input line */
|
2009-10-09 15:46:08 +04:00
|
|
|
{ "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 },
|
2009-10-07 19:43:19 +04:00
|
|
|
{ "InputXStore", CK_InputKillSave },
|
|
|
|
{ "InputXPaste", CK_InputPaste },
|
|
|
|
{ "InputClearLine", CK_InputClearLine },
|
2010-05-03 02:33:08 +04:00
|
|
|
{ "InputLeftHighlight", CK_InputLeftHighlight },
|
|
|
|
{ "InputRightHighlight", CK_InputRightHighlight},
|
|
|
|
{ "InputWordLeftHighlight", CK_InputWordLeftHighlight},
|
|
|
|
{ "InputWordRightHighlight", CK_InputWordRightHighlight},
|
|
|
|
{ "InputBolHighlight", CK_InputBolHighlight},
|
|
|
|
{ "InputEolHighlight", CK_InputEolHighlight},
|
2009-09-14 21:13:54 +04:00
|
|
|
|
|
|
|
/* common */
|
2009-10-09 15:46:08 +04:00
|
|
|
{ "ExtMap1", CK_StartExtMap1 },
|
|
|
|
{ "ExtMap2", CK_StartExtMap2 },
|
|
|
|
{ "ShowCommandLine", CK_ShowCommandLine },
|
|
|
|
{ "SelectCodepage", CK_SelectCodepage },
|
2009-09-14 21:13:54 +04:00
|
|
|
|
2010-05-06 23:19:02 +04:00
|
|
|
/* dialog */
|
|
|
|
{ "DialogOK", CK_DialogOK },
|
|
|
|
{ "DialogCancel", CK_DialogCancel },
|
|
|
|
{ "DialogPrevItem", CK_DialogPrevItem },
|
|
|
|
{ "DialogNextItem", CK_DialogNextItem },
|
|
|
|
{ "DialogHelp", CK_DialogHelp },
|
|
|
|
{ "DialogSuspend", CK_DialogSuspend },
|
|
|
|
{ "DialogRefresh", CK_DialogRefresh },
|
2010-03-03 16:09:15 +03:00
|
|
|
|
|
|
|
/* 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},
|
2010-04-14 10:24:08 +04:00
|
|
|
{ "DiffContinueSearch", CK_DiffContinueSearch},
|
2010-03-03 16:09:15 +03:00
|
|
|
{ "DiffEOF", CK_DiffEOF},
|
|
|
|
{ "DiffBOF", CK_DiffBOF},
|
|
|
|
{ "DiffDown", CK_DiffDown},
|
|
|
|
{ "DiffUp", CK_DiffUp},
|
|
|
|
{ "DiffLeft", CK_DiffLeft},
|
|
|
|
{ "DiffRight", CK_DiffRight},
|
|
|
|
{ "DiffPageDown", CK_DiffPageDown},
|
|
|
|
{ "DiffPageUp", CK_DiffPageUp},
|
|
|
|
{ "DiffHome", CK_DiffHome},
|
|
|
|
{ "DiffEnd", CK_DiffEnd},
|
|
|
|
{ "DiffQuit", CK_DiffQuit},
|
2010-04-08 11:15:19 +04:00
|
|
|
{ "DiffHelp", CK_DiffHelp},
|
2010-03-23 19:27:36 +03:00
|
|
|
{ "SelectCodepage", CK_SelectCodepage},
|
2010-04-12 02:37:06 +04:00
|
|
|
{ "DiffMergeCurrentHunk", CK_DiffMergeCurrentHunk},
|
|
|
|
{ "DiffSave", CK_DiffSave},
|
2010-04-18 14:19:03 +04:00
|
|
|
{ "DiffOptions", CK_DiffOptions},
|
2010-03-03 16:09:15 +03:00
|
|
|
|
2009-11-02 17:01:08 +03:00
|
|
|
{ NULL, CK_Ignore_Key }
|
2009-07-05 19:04:42 +04:00
|
|
|
};
|
|
|
|
|
2009-11-03 19:39:16 +03:00
|
|
|
static const size_t num_command_names = sizeof (command_names) /
|
|
|
|
sizeof (command_names[0]) - 1;
|
|
|
|
|
2009-09-17 14:47:56 +04:00
|
|
|
/*** global variables ****************************************************************************/
|
|
|
|
|
|
|
|
/* viewer/actions_cmd.c */
|
2009-10-23 10:27:28 +04:00
|
|
|
const global_keymap_t default_viewer_keymap[] = {
|
2009-11-07 13:46:05 +03:00
|
|
|
{ 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" },
|
|
|
|
|
|
|
|
{ '?', 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" },
|
|
|
|
|
|
|
|
{ XCTRL ('a'), CK_ViewMoveToBol, "C-a" },
|
|
|
|
{ XCTRL ('e'), CK_ViewMoveToEol, "C-e" },
|
|
|
|
|
|
|
|
{ 'h', CK_ViewMoveLeft, "h" },
|
|
|
|
{ KEY_LEFT, CK_ViewMoveLeft, "Left" },
|
|
|
|
|
|
|
|
{ 'l', CK_ViewMoveRight, "l" },
|
|
|
|
{ KEY_RIGHT, CK_ViewMoveRight, "Right" },
|
|
|
|
|
|
|
|
{ 'k', CK_ViewMoveUp, "k" },
|
|
|
|
{ 'y', CK_ViewMoveUp, "y" },
|
|
|
|
{ KEY_IC, CK_ViewMoveUp, "Insert" },
|
|
|
|
{ KEY_UP, CK_ViewMoveUp, "Up" },
|
|
|
|
|
|
|
|
{ 'j', CK_ViewMoveDown, "j" },
|
|
|
|
{ 'e', CK_ViewMoveDown, "e" },
|
|
|
|
{ KEY_DOWN, CK_ViewMoveDown, "Down" },
|
|
|
|
{ KEY_DC, CK_ViewMoveDown, "Delete" },
|
|
|
|
|
|
|
|
{ ' ', CK_ViewMovePgDn, "Space" },
|
|
|
|
{ 'f', CK_ViewMovePgDn, "f" },
|
|
|
|
{ KEY_NPAGE, CK_ViewMovePgDn, "PgDn" },
|
|
|
|
|
|
|
|
{ 'b', CK_ViewMovePgUp, "b" },
|
|
|
|
{ KEY_PPAGE, CK_ViewMovePgUp, "PgUp" },
|
|
|
|
|
|
|
|
{ 'd', CK_ViewMoveHalfPgDn, "d" },
|
|
|
|
{ 'u', CK_ViewMoveHalfPgUp, "u" },
|
|
|
|
|
|
|
|
{ 'm', CK_ViewGotoBookmark, "m" },
|
|
|
|
{ 'r', CK_ViewNewBookmark, "r" },
|
|
|
|
|
|
|
|
{ XCTRL ('f'), CK_ViewNextFile, "C-f" },
|
|
|
|
{ XCTRL ('b'), CK_ViewPrevFile, "C-b" },
|
|
|
|
|
|
|
|
{ 'q', CK_ViewQuit, "q" },
|
|
|
|
{ XCTRL ('g'), CK_ViewQuit, "C-g" },
|
|
|
|
{ ESC_CHAR, CK_ViewQuit, "Esc" },
|
|
|
|
|
|
|
|
{ ALT ('e'), CK_SelectCodepage, "M-e" },
|
|
|
|
{ XCTRL ('o'), CK_ShowCommandLine, "C-o" },
|
2009-10-24 12:58:02 +04:00
|
|
|
|
2009-11-02 17:01:08 +03:00
|
|
|
{ 0, CK_Ignore_Key, "" }
|
2009-09-17 14:47:56 +04:00
|
|
|
};
|
|
|
|
|
2009-10-23 10:27:28 +04:00
|
|
|
const global_keymap_t default_viewer_hex_keymap[] = {
|
2009-11-07 13:46:05 +03:00
|
|
|
{ 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" },
|
|
|
|
|
|
|
|
{ '?', 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" },
|
|
|
|
|
|
|
|
{ '\t', CK_ViewToggleHexNavMode, "Tab" },
|
|
|
|
{ XCTRL ('a'), CK_ViewMoveToBol, "C-a" },
|
|
|
|
{ XCTRL ('e'), CK_ViewMoveToEol, "C-e" },
|
|
|
|
|
|
|
|
{ 'b', CK_ViewMoveLeft, "b" },
|
|
|
|
{ KEY_LEFT, CK_ViewMoveLeft, "Left" },
|
|
|
|
|
|
|
|
{ 'f', CK_ViewMoveRight, "f" },
|
|
|
|
{ KEY_RIGHT, CK_ViewMoveRight, "Right" },
|
|
|
|
|
|
|
|
{ 'k', CK_ViewMoveUp, "k" },
|
|
|
|
{ 'y', CK_ViewMoveUp, "y" },
|
|
|
|
{ KEY_UP, CK_ViewMoveUp, "Up" },
|
|
|
|
|
|
|
|
{ 'j', CK_ViewMoveDown, "j" },
|
|
|
|
{ KEY_DOWN, CK_ViewMoveDown, "Down" },
|
|
|
|
{ KEY_DC, CK_ViewMoveDown, "Delete" },
|
|
|
|
|
|
|
|
{ 'q', CK_ViewQuit, "q" },
|
|
|
|
{ XCTRL ('g'), CK_ViewQuit, "C-g" },
|
|
|
|
{ ESC_CHAR, CK_ViewQuit, "Esc" },
|
|
|
|
|
|
|
|
{ ALT ('e'), CK_SelectCodepage, "M-e" },
|
|
|
|
{ XCTRL ('o'), CK_ShowCommandLine, "C-o" },
|
2009-09-17 14:47:56 +04:00
|
|
|
|
2009-11-02 17:01:08 +03:00
|
|
|
{ 0, CK_Ignore_Key, "" }
|
2009-09-17 14:47:56 +04:00
|
|
|
};
|
2009-09-20 23:43:56 +04:00
|
|
|
|
2009-10-23 10:27:28 +04:00
|
|
|
#ifdef USE_INTERNAL_EDIT
|
2009-09-20 23:43:56 +04:00
|
|
|
/* ../edit/editkeys.c */
|
2009-10-23 10:27:28 +04:00
|
|
|
const global_keymap_t default_editor_keymap[] = {
|
2009-11-16 16:08:17 +03:00
|
|
|
{ '\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" },
|
2009-09-20 23:43:56 +04:00
|
|
|
/* edit user menu */
|
2009-11-16 16:08:17 +03:00
|
|
|
{ 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" },
|
2009-09-20 23:43:56 +04:00
|
|
|
/* C formatter */
|
2009-11-16 16:08:17 +03:00
|
|
|
{ KEY_F (19), CK_Pipe_Block (0), "S-F9" },
|
|
|
|
|
|
|
|
{ ESC_CHAR, CK_Quit, "Esc" },
|
|
|
|
{ KEY_BACKSPACE, CK_BackSpace, "BackSpace" },
|
|
|
|
{ KEY_DC, CK_Delete, "Delete" },
|
|
|
|
{ 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" },
|
2009-09-20 23:43:56 +04:00
|
|
|
|
|
|
|
/* Ctrl */
|
2009-10-23 12:23:43 +04:00
|
|
|
{ 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" },
|
2009-11-16 16:08:17 +03:00
|
|
|
{ KEY_M_CTRL | KEY_BACKSPACE, CK_Undo, "C-BackSpace" },
|
2009-10-25 12:15:19 +03:00
|
|
|
{ KEY_M_CTRL | KEY_NPAGE, CK_End_Of_Text, "C-PgDn" },
|
|
|
|
{ KEY_M_CTRL | KEY_PPAGE, CK_Beginning_Of_Text, "C-PgUp" },
|
2009-10-23 12:23:43 +04:00
|
|
|
{ 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" },
|
|
|
|
{ KEY_M_CTRL | KEY_RIGHT, CK_Word_Right, "C-Right" },
|
|
|
|
{ KEY_M_CTRL | KEY_IC, CK_XStore, "C-Insert" },
|
|
|
|
{ KEY_M_CTRL | KEY_DC, CK_Remove, "C-Delete" },
|
2009-09-20 23:43:56 +04:00
|
|
|
|
2009-11-16 16:08:17 +03:00
|
|
|
{ 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 ('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 ('a'), CK_Execute_Macro, "C-a" },
|
|
|
|
|
|
|
|
/* 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" },
|
|
|
|
|
2009-09-20 23:43:56 +04:00
|
|
|
/* Ctrl + Shift */
|
2009-10-25 12:15:19 +03:00
|
|
|
{ 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" },
|
2009-10-23 12:23:43 +04:00
|
|
|
{ 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" },
|
2009-09-20 23:43:56 +04:00
|
|
|
|
2009-11-16 16:08:17 +03:00
|
|
|
/* 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" },
|
|
|
|
|
2009-10-25 12:15:19 +03:00
|
|
|
{ XCTRL ('x'), CK_Ext_Mode, "C-x" },
|
2009-09-20 23:43:56 +04:00
|
|
|
|
2009-11-02 17:01:08 +03:00
|
|
|
{ 0, CK_Ignore_Key, "" }
|
2009-09-20 23:43:56 +04:00
|
|
|
};
|
2009-10-23 21:58:01 +04:00
|
|
|
|
2009-10-25 12:15:19 +03:00
|
|
|
/* emacs keyboard layout emulation */
|
2009-10-23 21:58:01 +04:00
|
|
|
const global_keymap_t default_editor_x_keymap[] = {
|
2009-10-25 12:15:19 +03:00
|
|
|
{ 'k', CK_New, "k"},
|
|
|
|
{ 'e', CK_Execute_Macro, "e"},
|
2009-11-02 17:01:08 +03:00
|
|
|
{ 0, CK_Ignore_Key, "" }
|
2009-10-23 21:58:01 +04:00
|
|
|
};
|
2009-11-06 14:41:54 +03:00
|
|
|
#endif /* USE_INTERNAL_EDIT */
|
2009-09-20 23:43:56 +04:00
|
|
|
|
2010-05-06 23:19:02 +04:00
|
|
|
/* 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, "" }
|
|
|
|
};
|
|
|
|
|
2009-11-02 17:01:08 +03:00
|
|
|
/* 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_END, CK_TreeMoveEnd , "End" },
|
|
|
|
{ ALT ('>'), CK_TreeMoveEnd , "M->" },
|
|
|
|
{ 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, ""}
|
|
|
|
};
|
|
|
|
|
2009-11-07 18:36:44 +03:00
|
|
|
/* 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" },
|
|
|
|
{ KEY_UP, CK_HelpMoveUp, "Up" },
|
|
|
|
{ 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, "" }
|
|
|
|
};
|
|
|
|
|
2009-09-17 14:47:56 +04:00
|
|
|
/* screen.c */
|
2009-10-23 10:27:28 +04:00
|
|
|
const global_keymap_t default_panel_keymap[] = {
|
2009-10-23 12:23:43 +04:00
|
|
|
{ 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-*" },
|
2009-11-14 12:19:19 +03:00
|
|
|
{ KEY_KP_ADD, CK_PanelCmdSelect, "M-+" },
|
|
|
|
{ KEY_KP_SUBTRACT, CK_PanelCmdUnselect, "M--" },
|
2009-10-23 12:23:43 +04:00
|
|
|
{ KEY_F (13), CK_PanelCmdViewSimple, "S-F3" },
|
2009-10-25 12:15:19 +03:00
|
|
|
{ KEY_M_CTRL | KEY_NPAGE, CK_PanelCtrlNextPage, "C-PgDn" },
|
|
|
|
{ KEY_M_CTRL | KEY_PPAGE, CK_PanelCtrlPrevPage, "C-PgUp" },
|
2009-10-23 12:23:43 +04:00
|
|
|
{ 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_HOME, CK_PanelMoveHome, "Home" },
|
|
|
|
{ KEY_A1, CK_PanelMoveHome, "Home" },
|
2009-10-25 12:15:19 +03:00
|
|
|
{ KEY_NPAGE, CK_PanelNextPage, "PgDn" },
|
|
|
|
{ KEY_PPAGE, CK_PanelPrevPage, "PgUp" },
|
2009-10-23 12:23:43 +04:00
|
|
|
{ ALT ('e'), CK_PanelSetPanelEncoding, "M-e" },
|
|
|
|
{ XCTRL ('s'), CK_PanelStartSearch, "C-s" },
|
|
|
|
{ ALT ('s'), CK_PanelStartSearch, "M-s" },
|
|
|
|
{ ALT ('i'), CK_PanelSyncOtherPanel, "M-i" },
|
2009-11-02 17:01:08 +03:00
|
|
|
{ 0, CK_Ignore_Key , "" }
|
2009-09-17 14:47:56 +04:00
|
|
|
};
|
|
|
|
|
|
|
|
/* main.c */
|
2009-10-23 10:27:28 +04:00
|
|
|
const global_keymap_t default_main_map[] = {
|
2009-11-06 14:55:21 +03:00
|
|
|
{ KEY_F (1), CK_HelpCmd, "F1" },
|
2009-10-24 16:40:19 +04:00
|
|
|
{ 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" },
|
2009-11-14 11:51:37 +03:00
|
|
|
{ KEY_F (8), CK_DeleteCmd, "F8" },
|
2009-11-06 14:55:21 +03:00
|
|
|
{ KEY_F (9), CK_MenuCmd, "F9" },
|
2009-10-24 16:40:19 +04:00
|
|
|
{ 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" },
|
2009-09-17 14:47:56 +04:00
|
|
|
/* Copy useful information to the command line */
|
2009-10-24 16:40:19 +04:00
|
|
|
{ ALT ('a'), CK_CopyCurrentPathname, "M-a" },
|
|
|
|
{ ALT ('A'), CK_CopyOtherPathname, "M-A" },
|
|
|
|
{ ALT ('c'), CK_QuickCdCmd, "M-c" },
|
2009-09-17 14:47:56 +04:00
|
|
|
/* To access the directory hotlist */
|
2009-10-24 16:40:19 +04:00
|
|
|
{ XCTRL ('\\'), CK_QuickChdirCmd, "C-\\" },
|
2009-09-17 14:47:56 +04:00
|
|
|
/* Suspend */
|
2009-10-24 16:40:19 +04:00
|
|
|
{ XCTRL ('z'), CK_SuspendCmd, "C-z" },
|
2009-09-17 14:47:56 +04:00
|
|
|
/* The filtered view command */
|
2009-10-24 16:40:19 +04:00
|
|
|
{ ALT ('!'), CK_FilteredViewCmd, "M-!" },
|
2009-09-17 14:47:56 +04:00
|
|
|
/* Find file */
|
2009-10-24 16:40:19 +04:00
|
|
|
{ ALT ('?'), CK_FindCmd, "M-?" },
|
2009-09-17 14:47:56 +04:00
|
|
|
/* Panel refresh */
|
2009-10-24 16:40:19 +04:00
|
|
|
{ XCTRL ('r'), CK_RereadCmd, "C-r" },
|
2009-09-17 14:47:56 +04:00
|
|
|
/* Toggle listing between long, user defined and full formats */
|
2009-10-24 16:40:19 +04:00
|
|
|
{ ALT ('t'), CK_ToggleListingCmd, "M-t" },
|
2009-09-17 14:47:56 +04:00
|
|
|
/* Swap panels */
|
2009-10-24 16:40:19 +04:00
|
|
|
{ XCTRL ('u'), CK_SwapCmd, "C-u" },
|
2009-09-17 14:47:56 +04:00
|
|
|
/* View output */
|
2009-10-24 16:40:19 +04:00
|
|
|
{ XCTRL ('o'), CK_ShowCommandLine, "C-o" },
|
|
|
|
{ ALT ('.'), CK_ToggleShowHidden, "M-." },
|
2010-02-03 15:55:36 +03:00
|
|
|
{ ALT (','), CK_TogglePanelsSplit, "M-," },
|
2009-10-24 16:40:19 +04:00
|
|
|
{ XCTRL ('x'), CK_StartExtMap1, "C-x" },
|
|
|
|
/* Select/unselect group */
|
2009-11-14 12:19:19 +03:00
|
|
|
{ KEY_KP_ADD, CK_SelectCmd, "+" },
|
|
|
|
{ KEY_KP_SUBTRACT, CK_UnselectCmd, "-" },
|
|
|
|
{ ALT ('*'), CK_ReverseSelectionCmd, "*" },
|
2009-11-02 17:01:08 +03:00
|
|
|
{ 0, CK_Ignore_Key, "" }
|
2009-09-17 14:47:56 +04:00
|
|
|
};
|
|
|
|
|
2009-10-23 10:27:28 +04:00
|
|
|
const global_keymap_t default_main_x_map[] = {
|
2009-10-24 12:58:02 +04:00
|
|
|
{ 'd', CK_CompareDirsCmd, "d" },
|
2009-12-29 14:39:13 +03:00
|
|
|
#ifdef ENABLE_VFS
|
2009-10-24 12:58:02 +04:00
|
|
|
{ 'a', CK_ReselectVfs, "a"},
|
2009-12-29 14:39:13 +03:00
|
|
|
#endif /* ENABLE_VFS */
|
2009-10-24 12:58:02 +04:00
|
|
|
{ 'p', CK_CopyCurrentPathname, "p" },
|
|
|
|
{ XCTRL ('p'), CK_CopyOtherPathname, "C-p" },
|
|
|
|
{ 't', CK_CopyCurrentTagged, "t" },
|
2009-10-28 19:15:33 +03:00
|
|
|
{ XCTRL ('t'), CK_CopyOtherTagged, "C-t" },
|
2009-10-24 12:58:02 +04:00
|
|
|
{ '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" },
|
2010-05-10 13:43:34 +04:00
|
|
|
{ 'v', CK_RelativeSymlinkCmd, "v" },
|
2009-10-24 12:58:02 +04:00
|
|
|
{ XCTRL ('s'), CK_EditSymlinkCmd, "C-s" },
|
|
|
|
{ 'i', CK_InfoCmd, "i" },
|
|
|
|
{ 'q', CK_QuickViewCmd, "q" },
|
|
|
|
{ 'h', CK_AddHotlist, "h" },
|
|
|
|
{ '!', CK_ExternalPanelize, "!" },
|
2009-09-17 14:47:56 +04:00
|
|
|
#ifdef WITH_BACKGROUND
|
2009-10-24 12:58:02 +04:00
|
|
|
{ 'j', CK_JobsCmd, "j" },
|
2009-09-17 14:47:56 +04:00
|
|
|
#endif /* WITH_BACKGROUND */
|
2009-11-02 17:01:08 +03:00
|
|
|
{ 0, CK_Ignore_Key, "" }
|
2009-09-17 14:47:56 +04:00
|
|
|
};
|
|
|
|
|
2009-10-23 10:27:28 +04:00
|
|
|
const global_keymap_t default_input_keymap[] = {
|
2009-09-28 19:39:11 +04:00
|
|
|
/* Motion */
|
2009-10-23 12:23:43 +04:00
|
|
|
{ XCTRL ('a'), CK_InputBol, "C-a" },
|
|
|
|
{ KEY_HOME, CK_InputBol, "Home" },
|
|
|
|
{ KEY_A1, CK_InputBol, "Home" },
|
|
|
|
{ ALT ('<'), CK_InputBol, "M-<" },
|
|
|
|
{ XCTRL ('e'), CK_InputEol, "C-e" },
|
|
|
|
{ KEY_END, CK_InputEol, "End" },
|
|
|
|
{ KEY_C1, CK_InputEol, "End" },
|
|
|
|
{ ALT ('>'), CK_InputEol, "M->" },
|
2009-11-14 11:51:37 +03:00
|
|
|
{ KEY_LEFT, CK_InputMoveLeft, "Left" },
|
2009-10-23 12:23:43 +04:00
|
|
|
{ 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" },
|
2009-09-28 19:39:11 +04:00
|
|
|
|
|
|
|
/* Editing */
|
2009-10-23 12:23:43 +04:00
|
|
|
{ KEY_BACKSPACE, CK_InputBackwardDelete, "BackSpace" },
|
|
|
|
{ KEY_DC, CK_InputDeleteChar, "Delete" },
|
|
|
|
{ ALT ('d'), CK_InputKillWord, "M-d" },
|
|
|
|
{ ALT (KEY_BACKSPACE), CK_InputBackwardKillWord, "M-BackSpace" },
|
2009-09-28 19:39:11 +04:00
|
|
|
|
|
|
|
/* Region manipulation */
|
2009-10-23 12:23:43 +04:00
|
|
|
{ XCTRL ('w'), CK_InputKillRegion, "C-w" },
|
|
|
|
{ ALT ('w'), CK_InputKillSave, "M-w" },
|
|
|
|
{ XCTRL ('y'), CK_InputYank, "C-y" },
|
|
|
|
{ XCTRL ('k'), CK_InputKillLine, "C-k" },
|
2009-09-28 19:39:11 +04:00
|
|
|
|
|
|
|
/* History */
|
2009-10-23 12:23:43 +04:00
|
|
|
{ ALT ('p'), CK_InputHistoryPrev, "M-p" },
|
|
|
|
{ ALT ('n'), CK_InputHistoryNext, "M-n" },
|
|
|
|
{ ALT ('h'), CK_InputHistoryShow, "M-h" },
|
2009-09-28 19:39:11 +04:00
|
|
|
|
|
|
|
/* Completion */
|
2009-10-23 12:23:43 +04:00
|
|
|
{ ALT ('\t'), CK_InputComplete, "M-tab" },
|
2009-10-24 12:58:02 +04:00
|
|
|
|
2009-11-02 17:01:08 +03:00
|
|
|
{ 0, CK_Ignore_Key, "" }
|
2009-09-28 19:39:11 +04:00
|
|
|
};
|
2009-09-17 14:47:56 +04:00
|
|
|
|
2010-03-03 16:09:15 +03:00
|
|
|
/* 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" },
|
2010-04-08 11:15:19 +04:00
|
|
|
|
|
|
|
{ KEY_F (1), CK_DiffHelp, "F1" },
|
|
|
|
{ KEY_F (4), CK_DiffEditCurrent, "F4" },
|
2010-04-12 02:37:06 +04:00
|
|
|
{ KEY_F (5), CK_DiffMergeCurrentHunk, "F5" },
|
2010-04-08 11:15:19 +04:00
|
|
|
{ KEY_F (7), CK_DiffSearch, "F7" },
|
2010-04-14 10:24:08 +04:00
|
|
|
{ KEY_F (17), CK_DiffContinueSearch, "S-F7" },
|
2010-04-18 14:19:03 +04:00
|
|
|
{ KEY_F (9), CK_DiffOptions, "F9" },
|
2010-04-08 11:15:19 +04:00
|
|
|
{ KEY_F (10), CK_DiffQuit, "F10" },
|
|
|
|
{ KEY_F (14), CK_DiffEditOther, "S-F4" },
|
|
|
|
|
|
|
|
{ 0, CK_Ignore_Key, "" }
|
2010-03-03 16:09:15 +03:00
|
|
|
};
|
|
|
|
|
2009-11-03 19:39:16 +03:00
|
|
|
static int
|
|
|
|
name_keymap_comparator (const void *p1, const void *p2)
|
|
|
|
{
|
|
|
|
const name_keymap_t *m1 = (const name_keymap_t *) p1;
|
|
|
|
const name_keymap_t *m2 = (const name_keymap_t *) p2;
|
|
|
|
|
|
|
|
return str_casecmp (m1->name, m2->name);
|
|
|
|
}
|
|
|
|
|
2009-11-23 21:30:43 +03:00
|
|
|
static inline void
|
2009-11-03 19:39:16 +03:00
|
|
|
sort_command_names (void)
|
|
|
|
{
|
|
|
|
static gboolean has_been_sorted = FALSE;
|
|
|
|
|
|
|
|
if (!has_been_sorted) {
|
|
|
|
qsort (command_names, num_command_names,
|
|
|
|
sizeof (command_names[0]), &name_keymap_comparator);
|
|
|
|
has_been_sorted = TRUE;
|
|
|
|
}
|
|
|
|
}
|
2009-09-17 14:47:56 +04:00
|
|
|
|
2009-10-30 04:12:04 +03:00
|
|
|
static void
|
2009-11-06 14:41:54 +03:00
|
|
|
keymap_add (GArray *keymap, long key, unsigned long cmd, const char *caption)
|
2009-07-05 19:04:42 +04:00
|
|
|
{
|
2009-11-06 14:41:54 +03:00
|
|
|
if (key != 0 && cmd != CK_Ignore_Key) {
|
2009-10-23 10:27:28 +04:00
|
|
|
global_keymap_t new_bind;
|
|
|
|
|
2009-09-11 18:13:17 +04:00
|
|
|
new_bind.key = key;
|
|
|
|
new_bind.command = cmd;
|
2009-10-09 15:46:08 +04:00
|
|
|
g_snprintf (new_bind.caption, sizeof (new_bind.caption), "%s", caption);
|
|
|
|
g_array_append_val (keymap, new_bind);
|
2009-09-10 19:21:08 +04:00
|
|
|
}
|
2009-07-05 19:04:42 +04:00
|
|
|
}
|
|
|
|
|
|
|
|
void
|
2009-11-06 14:41:54 +03:00
|
|
|
keybind_cmd_bind (GArray *keymap, const char *keybind, unsigned long action)
|
2009-07-05 19:04:42 +04:00
|
|
|
{
|
2009-10-09 15:46:08 +04:00
|
|
|
char *caption = NULL;
|
2009-11-06 14:41:54 +03:00
|
|
|
long key;
|
2009-10-09 15:46:08 +04:00
|
|
|
|
|
|
|
key = lookup_key (keybind, &caption);
|
|
|
|
keymap_add (keymap, key, action, caption);
|
|
|
|
g_free (caption);
|
2009-07-05 19:04:42 +04:00
|
|
|
}
|
2009-10-24 12:58:02 +04:00
|
|
|
|
2009-11-06 14:41:54 +03:00
|
|
|
unsigned long
|
2010-02-02 13:48:08 +03:00
|
|
|
lookup_action (const char *name)
|
2009-11-06 14:41:54 +03:00
|
|
|
{
|
2010-02-02 13:48:08 +03:00
|
|
|
const name_keymap_t key = { name, 0 };
|
2009-11-06 14:41:54 +03:00
|
|
|
name_keymap_t *res;
|
|
|
|
|
|
|
|
sort_command_names ();
|
|
|
|
|
|
|
|
res = bsearch (&key, command_names, num_command_names,
|
|
|
|
sizeof (command_names[0]), name_keymap_comparator);
|
|
|
|
|
|
|
|
return (res != NULL) ? res->val : CK_Ignore_Key;
|
|
|
|
}
|
|
|
|
|
2009-10-24 12:58:02 +04:00
|
|
|
const char *
|
2009-11-06 14:41:54 +03:00
|
|
|
lookup_keymap_shortcut (const global_keymap_t *keymap, unsigned long action)
|
2009-10-24 12:58:02 +04:00
|
|
|
{
|
2009-11-06 14:41:54 +03:00
|
|
|
size_t i;
|
2009-10-24 12:58:02 +04:00
|
|
|
|
|
|
|
for (i = 0; keymap[i].key != 0; i++)
|
|
|
|
if (keymap[i].command == action)
|
2009-10-25 12:15:19 +03:00
|
|
|
return (keymap[i].caption[0] != '\0') ? keymap[i].caption : NULL;
|
2009-10-24 12:58:02 +04:00
|
|
|
|
|
|
|
return NULL;
|
|
|
|
}
|
2009-11-07 14:17:38 +03:00
|
|
|
|
|
|
|
unsigned long
|
|
|
|
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;
|
|
|
|
|
|
|
|
return CK_Ignore_Key;
|
|
|
|
}
|