root/lib/keybind.h

/* [previous][next][first][last][top][bottom][index][help]  */

INCLUDED FROM


   1 #ifndef MC__KEYBIND_H
   2 #define MC__KEYBIND_H
   3 
   4 #include <sys/types.h>
   5 #include <sys/time.h>           /* time_t */
   6 
   7 #include "lib/global.h"
   8 
   9 /*** typedefs(not structures) and defined constants **********************************************/
  10 
  11 /* keymap sections */
  12 #define KEYMAP_SECTION_FILEMANAGER "filemanager"
  13 #define KEYMAP_SECTION_FILEMANAGER_EXT "filemanager:xmap"
  14 #define KEYMAP_SECTION_PANEL "panel"
  15 #define KEYMAP_SECTION_DIALOG "dialog"
  16 #define KEYMAP_SECTION_MENU "menu"
  17 #define KEYMAP_SECTION_INPUT "input"
  18 #define KEYMAP_SECTION_LISTBOX "listbox"
  19 #define KEYMAP_SECTION_RADIO "radio"
  20 #define KEYMAP_SECTION_TREE "tree"
  21 #define KEYMAP_SECTION_HELP "help"
  22 #define KEYMAP_SECTION_CHATTR "chattr"
  23 #define KEYMAP_SECTION_EDITOR "editor"
  24 #define KEYMAP_SECTION_EDITOR_EXT "editor:xmap"
  25 #define KEYMAP_SECTION_VIEWER "viewer"
  26 #define KEYMAP_SECTION_VIEWER_HEX "viewer:hex"
  27 #define KEYMAP_SECTION_DIFFVIEWER "diffviewer"
  28 
  29 #define KEYMAP_SHORTCUT_LENGTH 32       /* FIXME: is 32 bytes enough for shortcut? */
  30 
  31 #define CK_PipeBlock(i)  (10000+(i))
  32 #define CK_Macro(i)      (20000+(i))
  33 #define CK_MacroLast     CK_Macro(0x7FFF)
  34 
  35 /*** enums ***************************************************************************************/
  36 
  37 enum
  38 {
  39     /* special commands */
  40     CK_InsertChar = -1L,
  41     CK_IgnoreKey = 0L,
  42 
  43     /* common */
  44     CK_Enter = 1L,
  45     CK_ChangePanel,
  46     CK_Up,
  47     CK_Down,
  48     CK_Left,
  49     CK_Right,
  50     CK_Home,
  51     CK_End,
  52     CK_LeftQuick,
  53     CK_RightQuick,
  54     CK_PageUp,
  55     CK_PageDown,
  56     CK_HalfPageUp,
  57     CK_HalfPageDown,
  58     CK_Top,
  59     CK_Bottom,
  60     CK_TopOnScreen,
  61     CK_MiddleOnScreen,
  62     CK_BottomOnScreen,
  63     CK_WordLeft,
  64     CK_WordRight,
  65     CK_Copy,
  66     CK_Move,
  67     CK_Delete,
  68     CK_MakeDir,
  69     CK_ChangeMode,
  70     CK_ChangeOwn,
  71     CK_ChangeOwnAdvanced,
  72     CK_ChangeAttributes,
  73     CK_Remove,
  74     CK_BackSpace,
  75     CK_Redo,
  76     CK_Clear,
  77     CK_Menu,
  78     CK_MenuLastSelected,
  79     CK_UserMenu,
  80     CK_EditUserMenu,
  81     CK_Search,
  82     CK_SearchContinue,
  83     CK_Replace,
  84     CK_ReplaceContinue,
  85     CK_SearchStop,
  86     CK_Help,
  87     CK_Edit,
  88     CK_EditNew,
  89     CK_Shell,
  90     CK_SelectCodepage,
  91     CK_EditorViewerHistory,
  92     CK_History,
  93     CK_HistoryNext,
  94     CK_HistoryPrev,
  95     CK_Complete,
  96     CK_Save,
  97     CK_SaveAs,
  98     CK_Goto,
  99     CK_Reread,
 100     CK_Refresh,
 101     CK_Suspend,
 102     CK_Swap,
 103     CK_Mark,
 104     CK_HotList,
 105     CK_ScreenList,
 106     CK_ScreenNext,
 107     CK_ScreenPrev,
 108     CK_FilePrev,
 109     CK_FileNext,
 110     CK_DeleteToHome,
 111     CK_DeleteToEnd,
 112     CK_DeleteToWordBegin,
 113     CK_DeleteToWordEnd,
 114     CK_ShowNumbers,
 115     CK_Store,
 116     CK_Cut,
 117     CK_Paste,
 118     CK_MarkLeft,
 119     CK_MarkRight,
 120     CK_MarkUp,
 121     CK_MarkDown,
 122     CK_MarkToWordBegin,
 123     CK_MarkToWordEnd,
 124     CK_MarkToHome,
 125     CK_MarkToEnd,
 126     CK_ToggleNavigation,
 127     CK_Sort,
 128     CK_Options,
 129     CK_LearnKeys,
 130     CK_Bookmark,
 131     CK_Quit,
 132     CK_QuitQuiet,
 133     /* C-x or similar */
 134     CK_ExtendedKeyMap,
 135 
 136     /* main commands */
 137     CK_EditForceInternal = 100L,
 138     CK_View,
 139     CK_ViewRaw,
 140     CK_ViewFile,
 141     CK_ViewFiltered,
 142     CK_Find,
 143     CK_DirSize,
 144     CK_HotListAdd,
 145     CK_SetupListingFormat,
 146     CK_CompareDirs,
 147     CK_OptionsVfs,
 148     CK_OptionsConfirm,
 149     CK_PutCurrentLink,
 150     CK_PutOtherLink,
 151     CK_OptionsDisplayBits,
 152     CK_EditExtensionsFile,
 153     CK_EditFileHighlightFile,
 154     CK_LinkSymbolicEdit,
 155     CK_ExternalPanelize,
 156     CK_Filter,
 157     CK_ConnectFish,
 158     CK_ConnectFtp,
 159     CK_ConnectSftp,
 160     CK_ConnectSmb,
 161     CK_PanelInfo,
 162     CK_Jobs,
 163     CK_OptionsLayout,
 164     CK_OptionsAppearance,
 165     CK_Link,
 166     CK_PanelListing,
 167     CK_ListMode,
 168     CK_CdQuick,
 169     CK_PanelQuickView,
 170     CK_VfsList,
 171     CK_SaveSetup,
 172     CK_LinkSymbolic,
 173     CK_ShowHidden,
 174     CK_PanelTree,
 175     CK_Tree,
 176     CK_Undelete,
 177     CK_SplitVertHoriz,
 178     CK_SplitEqual,
 179     CK_SplitMore,
 180     CK_SplitLess,
 181     CK_CompareFiles,
 182     CK_OptionsPanel,
 183     CK_LinkSymbolicRelative,
 184     CK_PutCurrentPath,
 185     CK_PutOtherPath,
 186     CK_PutCurrentSelected,
 187     CK_PutCurrentFullSelected,
 188     CK_PutCurrentTagged,
 189     CK_PutOtherTagged,
 190     CK_Select,
 191     CK_Unselect,
 192     CK_SelectExt,
 193     CK_SelectInvert,
 194 
 195     /* panels */
 196     CK_PanelOtherCd = 200L,
 197     CK_PanelOtherCdLink,
 198     CK_Panelize,
 199     CK_CopySingle,
 200     CK_MoveSingle,
 201     CK_DeleteSingle,
 202     CK_CdChild,
 203     CK_CdParent,
 204     CK_CdParentSmart,
 205     CK_PanelOtherSync,
 206     CK_SortNext,
 207     CK_SortPrev,
 208     CK_SortReverse,
 209     CK_SortByName,
 210     CK_SortByExt,
 211     CK_SortBySize,
 212     CK_SortByMTime,
 213     CK_ScrollLeft,
 214     CK_ScrollRight,
 215     CK_CycleListingFormat,
 216 
 217     /* dialog */
 218     CK_Ok = 300L,
 219     CK_Cancel,
 220 
 221     /* input */
 222     CK_Yank = 350L,
 223 
 224     /* help */
 225     CK_Index = 400L,
 226     CK_Back,
 227     CK_LinkNext,
 228     CK_LinkPrev,
 229     CK_NodeNext,
 230     CK_NodePrev,
 231 
 232     /* tree */
 233     CK_Forget = 450L,
 234 
 235     /* chattr dialog */
 236     CK_MarkAndDown = 480L,
 237 
 238     /* editor */
 239     /* cursor movements */
 240     CK_Tab = 500L,
 241     CK_Undo,
 242     CK_ScrollUp,
 243     CK_ScrollDown,
 244     CK_Return,
 245     CK_ParagraphUp,
 246     CK_ParagraphDown,
 247     /* file commands */
 248     CK_EditFile,
 249     CK_InsertFile,
 250     CK_EditSyntaxFile,
 251     CK_Close,
 252     /* block commands */
 253     CK_BlockSave,
 254     CK_BlockShiftLeft,
 255     CK_BlockShiftRight,
 256     CK_DeleteLine,
 257     /* bookmarks */
 258     CK_BookmarkFlush,
 259     CK_BookmarkNext,
 260     CK_BookmarkPrev,
 261     /* mark commands */
 262     CK_MarkColumn,
 263     CK_MarkWord,
 264     CK_MarkLine,
 265     CK_MarkAll,
 266     CK_Unmark,
 267     CK_MarkPageUp,
 268     CK_MarkPageDown,
 269     CK_MarkToFileBegin,
 270     CK_MarkToFileEnd,
 271     CK_MarkToPageBegin,
 272     CK_MarkToPageEnd,
 273     CK_MarkScrollUp,
 274     CK_MarkScrollDown,
 275     CK_MarkParagraphUp,
 276     CK_MarkParagraphDown,
 277     /* column mark commands */
 278     CK_MarkColumnPageUp,
 279     CK_MarkColumnPageDown,
 280     CK_MarkColumnLeft,
 281     CK_MarkColumnRight,
 282     CK_MarkColumnUp,
 283     CK_MarkColumnDown,
 284     CK_MarkColumnScrollUp,
 285     CK_MarkColumnScrollDown,
 286     CK_MarkColumnParagraphUp,
 287     CK_MarkColumnParagraphDown,
 288     /* macros */
 289     CK_MacroStartRecord,
 290     CK_MacroStopRecord,
 291     CK_MacroStartStopRecord,
 292     CK_MacroDelete,
 293     CK_RepeatStartRecord,
 294     CK_RepeatStopRecord,
 295     CK_RepeatStartStopRecord,
 296     /* window commands */
 297     CK_WindowMove,
 298     CK_WindowResize,
 299     CK_WindowFullscreen,
 300     CK_WindowList,
 301     CK_WindowNext,
 302     CK_WindowPrev,
 303     /* misc commands */
 304     CK_SpellCheck,
 305     CK_SpellCheckCurrentWord,
 306     CK_SpellCheckSelectLang,
 307     CK_InsertOverwrite,
 308     CK_ParagraphFormat,
 309     CK_MatchBracket,
 310     CK_OptionsSaveMode,
 311     CK_About,
 312     CK_ShowMargin,
 313     CK_ShowTabTws,
 314     CK_SyntaxOnOff,
 315     CK_SyntaxChoose,
 316     CK_InsertLiteral,
 317     CK_ExternalCommand,
 318     CK_Date,
 319     CK_EditMail,
 320 
 321     /* viewer */
 322     CK_WrapMode = 600L,
 323     CK_MagicMode,
 324     CK_NroffMode,
 325     CK_HexMode,
 326     CK_HexEditMode,
 327     CK_BookmarkGoto,
 328     CK_Ruler,
 329     CK_SearchForward,
 330     CK_SearchBackward,
 331     CK_SearchForwardContinue,
 332     CK_SearchBackwardContinue,
 333     CK_SearchOppositeContinue,
 334 
 335     /* diff viewer */
 336     CK_ShowSymbols = 700L,
 337     CK_SplitFull,
 338     CK_Tab2,
 339     CK_Tab3,
 340     CK_Tab4,
 341     CK_Tab8,
 342     CK_HunkNext,
 343     CK_HunkPrev,
 344     CK_EditOther,
 345     CK_Merge,
 346     CK_MergeOther
 347 };
 348 
 349 /*** structures declarations (and typedefs of structures)*****************************************/
 350 
 351 /* The global keymaps are of this type */
 352 typedef struct global_keymap_t
 353 {
 354     long key;
 355     long command;
 356     char caption[KEYMAP_SHORTCUT_LENGTH];
 357 } global_keymap_t;
 358 
 359 /*** global variables defined in .c file *********************************************************/
 360 
 361 /*** declarations of public functions ************************************************************/
 362 
 363 void keybind_cmd_bind (GArray * keymap, const char *keybind, long action);
 364 long keybind_lookup_action (const char *name);
 365 const char *keybind_lookup_actionname (long action);
 366 const char *keybind_lookup_keymap_shortcut (const global_keymap_t * keymap, long action);
 367 long keybind_lookup_keymap_command (const global_keymap_t * keymap, long key);
 368 
 369 /*** inline functions ****************************************************************************/
 370 
 371 #endif /* MC__KEYBIND_H */

/* [previous][next][first][last][top][bottom][index][help]  */