5 #include <sys/time.h> /* time_t */
7 #include "lib/global.h"
9 /*** typedefs(not structures) and defined constants **********************************************/
12 #define KEYMAP_SECTION_MAIN "main"
13 #define KEYMAP_SECTION_MAIN_EXT "main:xmap"
14 #define KEYMAP_SECTION_PANEL "panel"
15 #define KEYMAP_SECTION_DIALOG "dialog"
16 #define KEYMAP_SECTION_INPUT "input"
17 #define KEYMAP_SECTION_LISTBOX "listbox"
18 #define KEYMAP_SECTION_TREE "tree"
19 #define KEYMAP_SECTION_HELP "help"
20 #define KEYMAP_SECTION_EDITOR "editor"
21 #define KEYMAP_SECTION_EDITOR_EXT "editor:xmap"
22 #define KEYMAP_SECTION_VIEWER "viewer"
23 #define KEYMAP_SECTION_VIEWER_HEX "viewer:hex"
24 #define KEYMAP_SECTION_DIFFVIEWER "diffviewer"
26 #define KEYMAP_SHORTCUT_LENGTH 32 /* FIXME: is 32 bytes enough for shortcut? */
28 #define CK_PipeBlock(i) (10000+(i))
29 #define CK_Macro(i) (20000+(i))
30 #define CK_MacroLast CK_Macro(0x7FFF)
32 /*** enums ***************************************************************************************/
36 /* special commands */
106 CK_DeleteToWordBegin
,
131 CK_EditForceInternal
= 100L,
139 CK_PanelListingChange
,
145 CK_OptionsDisplayBits
,
146 CK_EditExtensionsFile
,
147 CK_EditFileHighlightFile
,
158 CK_OptionsAppearance
,
167 CK_PanelListingSwitch
,
178 CK_LinkSymbolicRelative
,
181 CK_PutCurrentSelected
,
182 CK_PutCurrentFullSelected
,
191 CK_PanelOtherCd
= 200L,
230 /* cursor movements */
267 CK_MarkParagraphDown
,
268 /* column mark commands */
270 CK_MarkColumnPageDown
,
275 CK_MarkColumnScrollUp
,
276 CK_MarkColumnScrollDown
,
277 CK_MarkColumnParagraphUp
,
278 CK_MarkColumnParagraphDown
,
282 CK_MacroStartStopRecord
,
284 CK_RepeatStartRecord
,
286 CK_RepeatStartStopRecord
,
287 /* window commands */
296 CK_SpellCheckCurrentWord
,
297 CK_SpellCheckSelectLang
,
322 CK_SearchForwardContinue
,
323 CK_SearchBackwardContinue
,
326 CK_ShowSymbols
= 700L,
339 /*** structures declarations (and typedefs of structures)*****************************************/
341 typedef struct name_keymap_t
347 typedef struct key_config_t
349 time_t mtime
; /* mtime at the moment we read config file */
355 /* The global keymaps are of this type */
356 typedef struct global_keymap_t
360 char caption
[KEYMAP_SHORTCUT_LENGTH
];
363 /*** global variables defined in .c file *********************************************************/
365 /*** declarations of public functions ************************************************************/
367 void keybind_cmd_bind (GArray
* keymap
, const char *keybind
, long action
);
368 long keybind_lookup_action (const char *name
);
369 const char *keybind_lookup_actionname (long action
);
370 const char *keybind_lookup_keymap_shortcut (const global_keymap_t
* keymap
, long action
);
371 long keybind_lookup_keymap_command (const global_keymap_t
* keymap
, long key
);
373 /*** inline functions ****************************************************************************/
375 #endif /* MC__KEYBIND_H */