Merge branch '2153_wrong_selection_fix'
[midnight-commander/osp/pkrayzel.git] / src / keybind.h
blob6c599149c9c08f0b600a116b583bf6ce6559fbda
2 #ifndef MC_KEYBIND_H
3 #define MC_KEYBIND_H
5 #include "lib/global.h"
7 typedef struct name_keymap_t {
8 const char *name;
9 unsigned long val;
10 } name_keymap_t;
12 typedef struct key_config_t {
13 time_t mtime; /* mtime at the moment we read config file */
14 GArray *keymap;
15 GArray *ext_keymap;
16 gchar *labels[10];
17 } key_config_t;
19 /* The global keymaps are of this type */
20 #define KEYMAP_SHORTCUT_LENGTH 32 /* FIXME: is 32 bytes enough for shortcut? */
21 typedef struct global_keymap_t {
22 long key;
23 unsigned long command;
24 char caption[KEYMAP_SHORTCUT_LENGTH];
25 } global_keymap_t;
27 void keybind_cmd_bind (GArray *keymap, const char *keybind, unsigned long action);
28 unsigned long lookup_action (const char *name);
29 const char *lookup_keymap_shortcut (const global_keymap_t *keymap, unsigned long action);
30 unsigned long lookup_keymap_command (const global_keymap_t *keymap, long key);
32 #ifdef USE_INTERNAL_EDIT
33 extern GArray *editor_keymap;
34 extern GArray *editor_x_keymap;
36 extern const global_keymap_t *editor_map;
37 extern const global_keymap_t *editor_x_map;
38 #endif
40 extern GArray *viewer_keymap;
41 extern GArray *viewer_hex_keymap;
42 extern GArray *main_keymap;
43 extern GArray *main_x_keymap;
44 extern GArray *panel_keymap;
45 extern GArray *input_keymap;
46 extern GArray *tree_keymap;
47 extern GArray *help_keymap;
48 extern GArray *dialog_keymap;
49 #ifdef USE_DIFF_VIEW
50 extern GArray *diff_keymap;
51 #endif
53 extern const global_keymap_t *main_map;
54 extern const global_keymap_t *main_x_map;
55 extern const global_keymap_t *panel_map;
56 extern const global_keymap_t *input_map;
57 extern const global_keymap_t *tree_map;
58 extern const global_keymap_t *help_map;
59 extern const global_keymap_t *dialog_map;
60 #ifdef USE_DIFF_VIEW
61 extern const global_keymap_t *diff_map;
62 #endif
64 /* viewer/actions_cmd.c */
65 extern const global_keymap_t default_viewer_keymap[];
66 extern const global_keymap_t default_viewer_hex_keymap[];
68 #ifdef USE_INTERNAL_EDIT
69 /* ../edit/editkey.c */
70 extern const global_keymap_t default_editor_keymap[];
71 extern const global_keymap_t default_editor_x_keymap[];
72 #endif
74 /* screen.c */
75 extern const global_keymap_t default_panel_keymap[];
77 /* widget.c */
78 extern const global_keymap_t default_input_keymap[];
80 /* main.c */
81 extern const global_keymap_t default_main_map[];
82 extern const global_keymap_t default_main_x_map[];
84 /* tree.c */
85 extern const global_keymap_t default_tree_keymap[];
87 /* help.c */
88 extern const global_keymap_t default_help_keymap[];
90 /* dialog.c */
91 extern const global_keymap_t default_dialog_keymap[];
93 #ifdef USE_DIFF_VIEW
94 /* ydiff.c */
95 extern const global_keymap_t default_diff_keymap[];
96 #endif
98 #endif /* MC_KEYBIND_H */