4 #include "lib/global.h"
6 /*** typedefs(not structures) and defined constants **********************************************/
8 #define KEYMAP_SHORTCUT_LENGTH 32 /* FIXME: is 32 bytes enough for shortcut? */
10 /*** enums ***************************************************************************************/
12 /*** structures declarations (and typedefs of structures)*****************************************/
14 typedef struct name_keymap_t
20 typedef struct key_config_t
22 time_t mtime
; /* mtime at the moment we read config file */
28 /* The global keymaps are of this type */
29 typedef struct global_keymap_t
32 unsigned long command
;
33 char caption
[KEYMAP_SHORTCUT_LENGTH
];
36 /*** global variables defined in .c file *********************************************************/
38 #ifdef USE_INTERNAL_EDIT
39 extern GArray
*editor_keymap
;
40 extern GArray
*editor_x_keymap
;
42 extern const global_keymap_t
*editor_map
;
43 extern const global_keymap_t
*editor_x_map
;
46 extern GArray
*viewer_keymap
;
47 extern GArray
*viewer_hex_keymap
;
48 extern GArray
*main_keymap
;
49 extern GArray
*main_x_keymap
;
50 extern GArray
*panel_keymap
;
51 extern GArray
*input_keymap
;
52 extern GArray
*listbox_keymap
;
53 extern GArray
*tree_keymap
;
54 extern GArray
*help_keymap
;
55 extern GArray
*dialog_keymap
;
57 extern GArray
*diff_keymap
;
60 extern const global_keymap_t
*main_map
;
61 extern const global_keymap_t
*main_x_map
;
62 extern const global_keymap_t
*panel_map
;
63 extern const global_keymap_t
*input_map
;
64 extern const global_keymap_t
*listbox_map
;
65 extern const global_keymap_t
*tree_map
;
66 extern const global_keymap_t
*help_map
;
67 extern const global_keymap_t
*dialog_map
;
69 extern const global_keymap_t
*diff_map
;
72 /* viewer/actions_cmd.c */
73 extern const global_keymap_t default_viewer_keymap
[];
74 extern const global_keymap_t default_viewer_hex_keymap
[];
76 #ifdef USE_INTERNAL_EDIT
77 /* ../edit/editkey.c */
78 extern const global_keymap_t default_editor_keymap
[];
79 extern const global_keymap_t default_editor_x_keymap
[];
83 extern const global_keymap_t default_panel_keymap
[];
86 extern const global_keymap_t default_input_keymap
[];
87 extern const global_keymap_t default_listbox_keymap
[];
90 extern const global_keymap_t default_main_map
[];
91 extern const global_keymap_t default_main_x_map
[];
94 extern const global_keymap_t default_tree_keymap
[];
97 extern const global_keymap_t default_help_keymap
[];
100 extern const global_keymap_t default_dialog_keymap
[];
104 extern const global_keymap_t default_diff_keymap
[];
107 /*** declarations of public functions ************************************************************/
109 void keybind_cmd_bind (GArray
* keymap
, const char *keybind
, unsigned long action
);
110 unsigned long keybind_lookup_action (const char *name
);
111 const char *keybind_lookup_keymap_shortcut (const global_keymap_t
* keymap
, unsigned long action
);
112 unsigned long keybind_lookup_keymap_command (const global_keymap_t
* keymap
, long key
);
114 /*** inline functions ****************************************************************************/
115 #endif /* MC__KEYBIND_H */