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 */
102 CK_DeleteToWordBegin
,
127 CK_EditForceInternal
= 100,
135 CK_PanelListingChange
,
141 CK_OptionsDisplayBits
,
142 CK_EditExtensionsFile
,
143 CK_EditFileHighlightFile
,
161 CK_PanelListingSwitch
,
169 CK_LinkSymbolicRelative
,
179 CK_PanelOtherCd
= 200,
215 /* cursor movements */
255 CK_MarkParagraphDown
,
256 /* column mark commands */
258 CK_MarkColumnPageDown
,
263 CK_MarkColumnScrollUp
,
264 CK_MarkColumnScrollDown
,
265 CK_MarkColumnParagraphUp
,
266 CK_MarkColumnParagraphDown
,
270 CK_MacroStartStopRecord
,
272 CK_RepeatStartRecord
,
274 CK_RepeatStartStopRecord
,
300 CK_ShowSymbols
= 700,
315 /*** structures declarations (and typedefs of structures)*****************************************/
317 typedef struct name_keymap_t
323 typedef struct key_config_t
325 time_t mtime
; /* mtime at the moment we read config file */
331 /* The global keymaps are of this type */
332 typedef struct global_keymap_t
335 unsigned long command
;
336 char caption
[KEYMAP_SHORTCUT_LENGTH
];
339 /*** global variables defined in .c file *********************************************************/
341 /*** declarations of public functions ************************************************************/
343 void keybind_cmd_bind (GArray
* keymap
, const char *keybind
, unsigned long action
);
344 unsigned long keybind_lookup_action (const char *name
);
345 const char *keybind_lookup_actionname (unsigned long action
);
346 const char *keybind_lookup_keymap_shortcut (const global_keymap_t
* keymap
, unsigned long action
);
347 unsigned long keybind_lookup_keymap_command (const global_keymap_t
* keymap
, long key
);
349 /*** inline functions ****************************************************************************/
351 #endif /* MC__KEYBIND_H */