Added two macro examples:
[midnight-commander/osp.git] / src / keybind-defaults.c
blob2b26262616cba0460c8c7285a536c9567847f60f
1 /*
2 Copyright (C) 2009 The Free Software Foundation, Inc.
4 Written by: 2005 Vitja Makarov
5 2009 Ilia Maslakov
7 This file is part of the Midnight Commander.
9 The Midnight Commander is free software; you can redistribute it
10 and/or modify it under the terms of the GNU General Public License as
11 published by the Free Software Foundation; either version 2 of the
12 License, or (at your option) any later version.
14 The Midnight Commander is distributed in the hope that it will be
15 useful, but WITHOUT ANY WARRANTY; without even the implied warranty
16 of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
17 General Public License for more details.
19 You should have received a copy of the GNU General Public License
20 along with this program; if not, write to the Free Software
21 Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston,
22 MA 02110-1301, USA.
25 #include <config.h>
27 #include "lib/global.h"
28 #include "lib/tty/key.h"
30 #include "keybind-defaults.h"
32 /*** global variables ****************************************************************************/
34 #ifdef USE_INTERNAL_EDIT
35 GArray *editor_keymap = NULL;
36 GArray *editor_x_keymap = NULL;
38 const global_keymap_t *editor_map;
39 const global_keymap_t *editor_x_map;
40 #endif
42 GArray *main_keymap = NULL;
43 GArray *main_x_keymap = NULL;
44 GArray *viewer_keymap = NULL;
45 GArray *viewer_hex_keymap = NULL;
46 GArray *panel_keymap = NULL;
47 GArray *input_keymap = NULL;
48 GArray *listbox_keymap = NULL;
49 GArray *tree_keymap = NULL;
50 GArray *help_keymap = NULL;
51 GArray *dialog_keymap = NULL;
53 #ifdef USE_DIFF_VIEW
54 GArray *diff_keymap = NULL;
56 const global_keymap_t *diff_map;
57 #endif
59 const global_keymap_t *main_map;
60 const global_keymap_t *main_x_map;
61 const global_keymap_t *panel_map;
62 const global_keymap_t *input_map;
63 const global_keymap_t *listbox_map;
64 const global_keymap_t *tree_map;
65 const global_keymap_t *help_map;
66 const global_keymap_t *dialog_map;
68 /*** global variables ****************************************************************************/
70 /* viewer/actions_cmd.c */
71 const global_keymap_t default_viewer_keymap[] = {
72 {KEY_F (1), CK_ViewHelp, "F1"},
73 {KEY_F (2), CK_ViewToggleWrapMode, "F2"},
74 {KEY_F (3), CK_ViewQuit, "F3"},
75 {KEY_F (4), CK_ViewToggleHexMode, "F4"},
76 {KEY_F (5), CK_ViewGoto, "F5"},
77 {KEY_F (7), CK_ViewSearch, "F7"},
78 {KEY_F (8), CK_ViewToggleMagicMode, "F8"},
79 {KEY_F (9), CK_ViewToggleNroffMode, "F9"},
80 {KEY_F (10), CK_ViewQuit, "F10"},
82 {'?', CK_ViewSearch, "?"},
83 {'/', CK_ViewSearch, "/"},
84 {XCTRL ('r'), CK_ViewContinueSearch, "C-r"},
85 {XCTRL ('s'), CK_ViewContinueSearch, "C-s"},
86 {KEY_F (17), CK_ViewContinueSearch, "S-F7"},
87 {'n', CK_ViewContinueSearch, "n"},
88 {ALT ('r'), CK_ViewToggleRuler, "M-r"},
90 {XCTRL ('a'), CK_ViewMoveToBol, "C-a"},
91 {XCTRL ('e'), CK_ViewMoveToEol, "C-e"},
93 {'h', CK_ViewMoveLeft, "h"},
94 {KEY_LEFT, CK_ViewMoveLeft, "Left"},
96 {'l', CK_ViewMoveRight, "l"},
97 {KEY_RIGHT, CK_ViewMoveRight, "Right"},
99 {KEY_M_CTRL | KEY_LEFT, CK_ViewMoveLeft10, "C-Left"},
100 {KEY_M_CTRL | KEY_RIGHT, CK_ViewMoveRight10, "C-Right"},
102 {'k', CK_ViewMoveUp, "k"},
103 {'y', CK_ViewMoveUp, "y"},
104 {XCTRL ('p'), CK_ViewMoveUp, "C-p"},
105 {KEY_IC, CK_ViewMoveUp, "Insert"},
106 {KEY_UP, CK_ViewMoveUp, "Up"},
108 {'j', CK_ViewMoveDown, "j"},
109 {'e', CK_ViewMoveDown, "e"},
110 {XCTRL ('n'), CK_ViewMoveUp, "C-n"},
111 {KEY_DOWN, CK_ViewMoveDown, "Down"},
112 {KEY_DC, CK_ViewMoveDown, "Delete"},
113 {'\n', CK_ViewMoveDown, "Endter"},
115 {' ', CK_ViewMovePgDn, "Space"},
116 {'f', CK_ViewMovePgDn, "f"},
117 {KEY_NPAGE, CK_ViewMovePgDn, "PgDn"},
118 {XCTRL ('v'), CK_ViewMovePgDn, "C-v"},
120 {'b', CK_ViewMovePgUp, "b"},
121 {KEY_PPAGE, CK_ViewMovePgUp, "PgUp"},
122 {ALT ('v'), CK_ViewMovePgUp, "M-v"},
123 {KEY_BACKSPACE, CK_ViewMovePgUp, "BackSpace"},
125 {'d', CK_ViewMoveHalfPgDn, "d"},
126 {'u', CK_ViewMoveHalfPgUp, "u"},
128 {KEY_HOME, CK_ViewMoveTop, "Home"},
129 {KEY_M_CTRL | KEY_HOME, CK_ViewMoveTop, "C-Home"},
130 {KEY_M_CTRL | KEY_PPAGE, CK_ViewMoveTop, "C-PgUp"},
131 {KEY_A1, CK_ViewMoveTop, "A1"},
132 {ALT ('<'), CK_ViewMoveTop, "M-<"},
133 {'g', CK_ViewMoveTop, "g"},
135 {KEY_END, CK_ViewMoveBottom, "End"},
136 {KEY_M_CTRL | KEY_END, CK_ViewMoveBottom, "C-End"},
137 {KEY_M_CTRL | KEY_NPAGE, CK_ViewMoveBottom, "C-PgDn"},
138 {KEY_C1, CK_ViewMoveBottom, "C1"},
139 {ALT ('>'), CK_ViewMoveBottom, "M->"},
140 {'G', CK_ViewMoveBottom, "G"},
142 {'m', CK_ViewGotoBookmark, "m"},
143 {'r', CK_ViewNewBookmark, "r"},
145 {XCTRL ('f'), CK_ViewNextFile, "C-f"},
146 {XCTRL ('b'), CK_ViewPrevFile, "C-b"},
148 {'q', CK_ViewQuit, "q"},
149 {XCTRL ('g'), CK_ViewQuit, "C-g"},
150 {ESC_CHAR, CK_ViewQuit, "Esc"},
152 {ALT ('e'), CK_SelectCodepage, "M-e"},
153 {XCTRL ('o'), CK_ShowCommandLine, "C-o"},
155 {0, CK_Ignore_Key, ""}
158 const global_keymap_t default_viewer_hex_keymap[] = {
159 {KEY_F (1), CK_ViewHelp, "F1"},
160 {KEY_F (2), CK_ViewToggleHexEditMode, "F2"},
161 {KEY_F (3), CK_ViewQuit, "F3"},
162 {KEY_F (4), CK_ViewToggleHexMode, "F4"},
163 {KEY_F (5), CK_ViewGoto, "F5"},
164 {KEY_F (6), CK_ViewHexEditSave, "F6"},
165 {KEY_F (7), CK_ViewSearch, "F7"},
166 {KEY_F (8), CK_ViewToggleMagicMode, "F8"},
167 {KEY_F (9), CK_ViewToggleNroffMode, "F9"},
168 {KEY_F (10), CK_ViewQuit, "F10"},
170 {'?', CK_ViewSearch, "?"},
171 {'/', CK_ViewSearch, "/"},
172 {XCTRL ('r'), CK_ViewContinueSearch, "C-r"},
173 {XCTRL ('s'), CK_ViewContinueSearch, "C-s"},
174 {KEY_F (17), CK_ViewContinueSearch, "S-F7"},
175 {'n', CK_ViewContinueSearch, "n"},
177 {'\t', CK_ViewToggleHexNavMode, "Tab"},
178 {XCTRL ('a'), CK_ViewMoveToBol, "C-a"},
179 {XCTRL ('e'), CK_ViewMoveToEol, "C-e"},
181 {'b', CK_ViewMoveLeft, "b"},
182 {KEY_LEFT, CK_ViewMoveLeft, "Left"},
184 {'f', CK_ViewMoveRight, "f"},
185 {KEY_RIGHT, CK_ViewMoveRight, "Right"},
187 {'k', CK_ViewMoveUp, "k"},
188 {'y', CK_ViewMoveUp, "y"},
189 {KEY_UP, CK_ViewMoveUp, "Up"},
191 {'j', CK_ViewMoveDown, "j"},
192 {KEY_DOWN, CK_ViewMoveDown, "Down"},
193 {KEY_DC, CK_ViewMoveDown, "Delete"},
195 {KEY_NPAGE, CK_ViewMovePgDn, "PgDn"},
196 {XCTRL ('v'), CK_ViewMovePgDn, "C-v"},
198 {KEY_PPAGE, CK_ViewMovePgUp, "PgUp"},
199 {ALT ('v'), CK_ViewMovePgUp, "M-v"},
201 {KEY_HOME, CK_ViewMoveTop, "Home"},
202 {KEY_M_CTRL | KEY_HOME, CK_ViewMoveTop, "C-Home"},
203 {KEY_M_CTRL | KEY_PPAGE, CK_ViewMoveTop, "C-PgUp"},
204 {KEY_A1, CK_ViewMoveTop, "A1"},
205 {ALT ('<'), CK_ViewMoveTop, "M-<"},
206 {'g', CK_ViewMoveTop, "g"},
208 {KEY_END, CK_ViewMoveBottom, "End"},
209 {KEY_M_CTRL | KEY_END, CK_ViewMoveBottom, "C-End"},
210 {KEY_M_CTRL | KEY_NPAGE, CK_ViewMoveBottom, "C-PgDn"},
211 {KEY_C1, CK_ViewMoveBottom, "C1"},
212 {ALT ('>'), CK_ViewMoveBottom, "M->"},
213 {'G', CK_ViewMoveBottom, "G"},
215 {'q', CK_ViewQuit, "q"},
216 {XCTRL ('g'), CK_ViewQuit, "C-g"},
217 {ESC_CHAR, CK_ViewQuit, "Esc"},
219 {ALT ('e'), CK_SelectCodepage, "M-e"},
220 {XCTRL ('o'), CK_ShowCommandLine, "C-o"},
222 {0, CK_Ignore_Key, ""}
225 #ifdef USE_INTERNAL_EDIT
226 /* ../edit/editkeys.c */
227 const global_keymap_t default_editor_keymap[] = {
228 {'\n', CK_Enter, "Enter"},
229 {'\t', CK_Tab, "Tab"},
231 {KEY_F (1), CK_Help, "F1"},
232 {KEY_F (2), CK_Save, "F2"},
233 {KEY_F (3), CK_Mark, "F3"},
234 {KEY_F (4), CK_Replace, "F4"},
235 {KEY_F (5), CK_Copy, "F5"},
236 {KEY_F (6), CK_Move, "F6"},
237 {KEY_F (7), CK_Find, "F7"},
238 {KEY_F (8), CK_Remove, "F8"},
239 {KEY_F (9), CK_Menu, "F9"},
240 {KEY_F (10), CK_Quit, "F10"},
241 /* edit user menu */
242 {KEY_F (11), CK_User_Menu, "S-F1"},
243 {KEY_F (12), CK_Save_As, "S-F2"},
244 {KEY_F (13), CK_Column_Mark, "S-F3"},
245 {KEY_F (14), CK_Replace_Again, "S-F4"},
246 {KEY_F (15), CK_Insert_File, "S-F5"},
247 {KEY_F (17), CK_Find_Again, "S-F7"},
248 /* C formatter */
249 {KEY_F (19), CK_Pipe_Block (0), "S-F9"},
251 {ESC_CHAR, CK_Quit, "Esc"},
252 {KEY_BACKSPACE, CK_BackSpace, "BackSpace"},
253 {KEY_BACKSPACE, CK_BackSpace, "C-h"},
254 {KEY_DC, CK_Delete, "Delete"},
255 {KEY_DC, CK_Delete, "C-d"},
256 {KEY_DOWN, CK_Down, "Down"},
257 {KEY_END, CK_End, "End"},
258 {KEY_HOME, CK_Home, "Home"},
259 {KEY_IC, CK_Toggle_Insert, "Insert"},
260 {KEY_LEFT, CK_Left, "Left"},
261 {KEY_NPAGE, CK_Page_Down, "PgDn"},
262 {KEY_PPAGE, CK_Page_Up, "PgUp"},
263 {KEY_RIGHT, CK_Right, "Right"},
264 {KEY_UP, CK_Up, "Up"},
266 /* Ctrl */
267 {KEY_M_CTRL | (KEY_F (2)), CK_Save_As, "C-F2"},
268 {KEY_M_CTRL | (KEY_F (4)), CK_Replace_Again, "C-F4"},
269 {KEY_M_CTRL | (KEY_F (7)), CK_Find_Again, "C-F7"},
270 {KEY_M_CTRL | KEY_BACKSPACE, CK_Undo, "C-BackSpace"},
271 {KEY_M_CTRL | KEY_NPAGE, CK_End_Of_Text, "C-PgDn"},
272 {KEY_M_CTRL | KEY_PPAGE, CK_Beginning_Of_Text, "C-PgUp"},
273 {KEY_M_CTRL | KEY_HOME, CK_Beginning_Of_Text, "C-Home"},
274 {KEY_M_CTRL | KEY_END, CK_End_Of_Text, "C-End"},
275 {KEY_M_CTRL | KEY_UP, CK_Scroll_Up, "C-Up"},
276 {KEY_M_CTRL | KEY_DOWN, CK_Scroll_Down, "C-Down"},
277 {KEY_M_CTRL | KEY_LEFT, CK_Word_Left, "C-Left"},
278 {XCTRL ('z'), CK_Word_Left, "C-z"},
279 {KEY_M_CTRL | KEY_RIGHT, CK_Word_Right, "C-Right"},
280 {XCTRL ('x'), CK_Word_Right, "C-x"},
281 {KEY_M_CTRL | KEY_IC, CK_XStore, "C-Insert"},
282 {KEY_M_CTRL | KEY_DC, CK_Remove, "C-Delete"},
284 {XCTRL ('n'), CK_New, "C-n"},
285 {XCTRL ('k'), CK_Delete_To_Line_End, "C-k"},
286 {XCTRL ('l'), CK_Refresh, "C-l"},
287 {XCTRL ('o'), CK_Shell, "C-o"},
288 {XCTRL ('s'), CK_Toggle_Syntax, "C-s"},
289 {XCTRL ('u'), CK_Undo, "C-u"},
290 {ALT ('r'), CK_Redo, "M-r"},
291 {ALT ('e'), CK_SelectCodepage, "M-e"},
292 {XCTRL ('q'), CK_Insert_Literal, "C-q"},
293 {XCTRL ('r'), CK_Begin_End_Macro, "C-r"},
294 {XCTRL ('r'), CK_Begin_Record_Macro, "C-r"},
295 {XCTRL ('r'), CK_End_Record_Macro, "C-r"},
296 {XCTRL ('f'), CK_Save_Block, "C-f"},
297 /* Spell check */
298 {XCTRL ('p'), CK_Pipe_Block (1), "C-p"},
299 {XCTRL ('y'), CK_Delete_Line, "C-y"},
301 /* Shift */
302 {KEY_M_SHIFT | KEY_NPAGE, CK_Page_Down_Highlight, "S-PgDn"},
303 {KEY_M_SHIFT | KEY_PPAGE, CK_Page_Up_Highlight, "S-PgUp"},
304 {KEY_M_SHIFT | KEY_LEFT, CK_Left_Highlight, "S-Left"},
305 {KEY_M_SHIFT | KEY_RIGHT, CK_Right_Highlight, "S-Right"},
306 {KEY_M_SHIFT | KEY_UP, CK_Up_Highlight, "S-Up"},
307 {KEY_M_SHIFT | KEY_DOWN, CK_Down_Highlight, "S-Down"},
308 {KEY_M_SHIFT | KEY_HOME, CK_Home_Highlight, "S-Home"},
309 {KEY_M_SHIFT | KEY_END, CK_End_Highlight, "S-End"},
310 {KEY_M_SHIFT | KEY_IC, CK_XPaste, "S-Insert"},
311 {KEY_M_SHIFT | KEY_DC, CK_XCut, "S-Delete"},
312 /* useful for pasting multiline text */
313 {KEY_M_SHIFT | '\n', CK_Return, "S-Enter"},
315 /* Ctrl + Shift */
316 {KEY_M_SHIFT | KEY_M_CTRL | KEY_NPAGE, CK_End_Of_Text_Highlight, "C-S-PgDn"},
317 {KEY_M_SHIFT | KEY_M_CTRL | KEY_PPAGE, CK_Beginning_Of_Text_Highlight, "C-S-PgUp"},
318 {KEY_M_SHIFT | KEY_M_CTRL | KEY_LEFT, CK_Word_Left_Highlight, "C-S-Left"},
319 {KEY_M_SHIFT | KEY_M_CTRL | KEY_RIGHT, CK_Word_Right_Highlight, "C-S-Right"},
320 {KEY_M_SHIFT | KEY_M_CTRL | KEY_UP, CK_Scroll_Up_Highlight, "C-S-Up"},
321 {KEY_M_SHIFT | KEY_M_CTRL | KEY_DOWN, CK_Scroll_Down_Highlight, "C-S-Down"},
323 /* Alt */
324 {KEY_M_ALT | KEY_NPAGE, CK_Page_Down_Alt_Highlight, "M-PgDn"},
325 {KEY_M_ALT | KEY_PPAGE, CK_Page_Up_Alt_Highlight, "M-PgUp"},
326 {KEY_M_ALT | KEY_LEFT, CK_Left_Alt_Highlight, "M-Left"},
327 {KEY_M_ALT | KEY_RIGHT, CK_Right_Alt_Highlight, "M-Right"},
328 {KEY_M_ALT | KEY_UP, CK_Up_Alt_Highlight, "M-Up"},
329 {KEY_M_ALT | KEY_DOWN, CK_Down_Alt_Highlight, "M-Down"},
330 {KEY_M_ALT | KEY_HOME, CK_Home_Highlight, "M-Home"},
331 {KEY_M_ALT | KEY_END, CK_End_Alt_Highlight, "M-End"},
333 {ALT ('\n'), CK_Find_Definition, "M-Enter"},
334 {ALT ('\t'), CK_Complete_Word, "M-Tab"},
335 {ALT ('l'), CK_Goto, "M-l"},
336 {ALT ('L'), CK_Goto, "M-L"},
337 {ALT ('p'), CK_Paragraph_Format, "M-p"},
338 {ALT ('t'), CK_Sort, "M-t"},
339 {ALT ('u'), CK_ExtCmd, "M-u"},
340 {ALT ('<'), CK_Beginning_Of_Text, "M-<"},
341 {ALT ('>'), CK_End_Of_Text, "M->"},
342 {ALT ('-'), CK_Load_Prev_File, "M--"},
343 {ALT ('+'), CK_Load_Next_File, "M-+"},
344 {ALT ('d'), CK_Delete_Word_Right, "M-d"},
345 {ALT (KEY_BACKSPACE), CK_Delete_Word_Left, "M-BackSpace"},
346 {ALT ('n'), CK_Toggle_Line_State, "M-n"},
347 {ALT ('_'), CK_Toggle_Tab_TWS, "M-_"},
348 {ALT ('k'), CK_Toggle_Bookmark, "M-k"},
349 {ALT ('i'), CK_Prev_Bookmark, "M-i"},
350 {ALT ('j'), CK_Next_Bookmark, "M-j"},
351 {ALT ('o'), CK_Flush_Bookmarks, "M-o"},
352 {ALT ('b'), CK_Match_Bracket, "M-b"},
353 {ALT ('m'), CK_Mail, "M-m"},
355 {XCTRL ('x'), CK_Ext_Mode, "C-x"},
357 {0, CK_Ignore_Key, ""}
360 /* emacs keyboard layout emulation */
361 const global_keymap_t default_editor_x_keymap[] = {
362 {'k', CK_New, "k"},
363 {0, CK_Ignore_Key, ""}
365 #endif /* USE_INTERNAL_EDIT */
367 /* dialog */
368 const global_keymap_t default_dialog_keymap[] = {
369 {'\n', CK_DialogOK, "Enter"},
370 {KEY_ENTER, CK_DialogOK, "Enter"},
371 {ESC_CHAR, CK_DialogCancel, "Esc"},
372 {XCTRL ('g'), CK_DialogCancel, "C-g"},
373 {KEY_F (10), CK_DialogCancel, "F10"},
374 {KEY_LEFT, CK_DialogPrevItem, "Left"},
375 {KEY_UP, CK_DialogPrevItem, "Up"},
376 {KEY_RIGHT, CK_DialogNextItem, "Right"},
377 {KEY_DOWN, CK_DialogNextItem, "Down"},
378 {KEY_F (1), CK_DialogHelp, "F1"},
379 {XCTRL ('z'), CK_DialogSuspend, "C-z"},
380 {XCTRL ('l'), CK_DialogRefresh, "C-l"},
381 {0, CK_Ignore_Key, ""}
384 /* tree */
385 const global_keymap_t default_tree_keymap[] = {
386 {KEY_F (1), CK_TreeHelp, "F1"},
387 {KEY_F (2), CK_TreeRescan, "F2"},
388 {KEY_F (3), CK_TreeForget, "F3"},
389 {KEY_F (4), CK_TreeToggleNav, "F4"},
390 {KEY_F (5), CK_TreeCopy, "F5"},
391 {KEY_F (6), CK_TreeMove, "F6"},
392 #if 0
393 {KEY_F (7), CK_TreeMake, "F7"},
394 #endif
395 {KEY_F (8), CK_TreeRemove, "F8"},
396 {KEY_UP, CK_TreeMoveUp, "Up"},
397 {XCTRL ('p'), CK_TreeMoveUp, "C-p"},
398 {KEY_DOWN, CK_TreeMoveDown, "Down"},
399 {XCTRL ('n'), CK_TreeMoveDown, "C-n"},
400 {KEY_LEFT, CK_TreeMoveLeft, "Left"},
401 {KEY_RIGHT, CK_TreeMoveRight, "Right"},
402 {KEY_HOME, CK_TreeMoveHome, "Home"},
403 {ALT ('<'), CK_TreeMoveHome, "M-<"},
404 {KEY_A1, CK_TreeMoveHome, "A1"},
405 {KEY_END, CK_TreeMoveEnd, "End"},
406 {ALT ('>'), CK_TreeMoveEnd, "M->"},
407 {KEY_C1, CK_TreeMoveEnd, "C1"},
408 {KEY_PPAGE, CK_TreeMovePgUp, "PgUp"},
409 {ALT ('v'), CK_TreeMovePgUp, "M-v"},
410 {KEY_NPAGE, CK_TreeMovePgDn, "PnDn"},
411 {XCTRL ('v'), CK_TreeMovePgDn, "C-v"},
412 {'\n', CK_TreeOpen, "Enter"},
413 {KEY_ENTER, CK_TreeOpen, "Enter"},
414 {XCTRL ('r'), CK_TreeRescan, "C-r"},
415 {XCTRL ('s'), CK_TreeStartSearch, "C-s"},
416 {ALT ('s'), CK_TreeStartSearch, "M-s"},
417 {KEY_DC, CK_TreeRemove, "Delete"},
418 {0, CK_Ignore_Key, ""}
421 /* help */
422 const global_keymap_t default_help_keymap[] = {
423 {KEY_F (1), CK_HelpHelp, "F1"},
424 {KEY_F (2), CK_HelpIndex, "F2"},
425 {KEY_F (3), CK_HelpBack, "F3"},
426 {KEY_F (10), CK_HelpQuit, "F10"},
427 {KEY_LEFT, CK_HelpBack, "Left"},
428 {'l', CK_HelpBack, "l"},
429 {KEY_DOWN, CK_HelpMoveDown, "Down"},
430 {XCTRL ('n'), CK_HelpMoveDown, "C-n"},
431 {KEY_UP, CK_HelpMoveUp, "Up"},
432 {XCTRL ('p'), CK_HelpMoveUp, "C-p"},
433 {KEY_NPAGE, CK_HelpMovePgDn, "PgDn"},
434 {XCTRL ('v'), CK_HelpMovePgDn, "C-v"},
435 {'f', CK_HelpMovePgDn, "f"},
436 {' ', CK_HelpMovePgDn, "Space"},
437 {KEY_PPAGE, CK_HelpMovePgUp, "PgUp"},
438 {ALT ('v'), CK_HelpMovePgUp, "M-v"},
439 {'b', CK_HelpMovePgUp, "b"},
440 {KEY_BACKSPACE, CK_HelpMovePgUp, "BackSpace"},
441 {'d', CK_HelpMoveHalfPgDn, "d"},
442 {'u', CK_HelpMoveHalfPgUp, "u"},
443 {KEY_HOME, CK_HelpMoveTop, "Home"},
444 {KEY_M_CTRL | KEY_HOME, CK_HelpMoveTop, "C-Home"},
445 {KEY_M_CTRL | KEY_PPAGE, CK_HelpMoveTop, "C-PgUp"},
446 {KEY_A1, CK_HelpMoveTop, "A1"},
447 {ALT ('<'), CK_HelpMoveTop, "M-<"},
448 {'g', CK_HelpMoveTop, "g"},
449 {KEY_END, CK_HelpMoveBottom, "End"},
450 {KEY_M_CTRL | KEY_END, CK_HelpMoveBottom, "C-End"},
451 {KEY_M_CTRL | KEY_NPAGE, CK_HelpMoveBottom, "C-PgDn"},
452 {KEY_C1, CK_HelpMoveBottom, "C1"},
453 {ALT ('>'), CK_HelpMoveBottom, "M->"},
454 {'G', CK_HelpMoveBottom, "G"},
455 {KEY_RIGHT, CK_HelpSelectLink, "Right"},
456 {KEY_ENTER, CK_HelpSelectLink, "Enter"},
457 {'\n', CK_HelpSelectLink, "Enter"},
458 {'\t', CK_HelpNextLink, "Tab"},
459 {ALT ('\t'), CK_HelpPrevLink, "M-Tab"},
460 {'n', CK_HelpNextNode, "n"},
461 {'p', CK_HelpPrevNode, "p"},
462 {ESC_CHAR, CK_HelpQuit, "Esc"},
463 {XCTRL ('g'), CK_HelpQuit, "C-g"},
464 {0, CK_Ignore_Key, ""}
467 /* panel */
468 const global_keymap_t default_panel_keymap[] = {
469 {ALT ('o'), CK_PanelChdirOtherPanel, "M-o"},
470 {ALT ('l'), CK_PanelChdirToReadlink, "M-l"},
471 {KEY_F (15), CK_PanelCmdCopyLocal, "S-F5"},
472 {KEY_F (18), CK_PanelCmdDeleteLocal, "S-F8"},
473 {KEY_ENTER, CK_PanelCmdDoEnter, "Enter"},
474 {'\n', CK_PanelCmdDoEnter, "Enter"},
475 {KEY_F (14), CK_PanelCmdEditNew, "S-F4"},
476 {KEY_F (16), CK_PanelCmdRenameLocal, "S-F6"},
477 {ALT ('*'), CK_PanelCmdReverseSelection, "M-*"},
478 {KEY_KP_ADD, CK_PanelCmdSelect, "M-+"},
479 {KEY_KP_SUBTRACT, CK_PanelCmdUnselect, "M--"},
480 {KEY_F (13), CK_PanelCmdViewSimple, "S-F3"},
481 {KEY_M_CTRL | KEY_NPAGE, CK_PanelGotoChildDir, "C-PgDn"},
482 {KEY_M_CTRL | KEY_PPAGE, CK_PanelGotoParentDir, "C-PgUp"},
483 {ALT ('H'), CK_PanelDirectoryHistoryList, "M-H"},
484 {ALT ('u'), CK_PanelDirectoryHistoryNext, "M-u"},
485 {ALT ('y'), CK_PanelDirectoryHistoryPrev, "M-y"},
486 {ALT ('j'), CK_PanelGotoBottomFile, "M-j"},
487 {ALT ('r'), CK_PanelGotoMiddleFile, "M-r"},
488 {ALT ('g'), CK_PanelGotoTopFile, "M-g"},
489 {KEY_IC, CK_PanelMarkFile, "Insert"},
490 {KEY_UP, CK_PanelMoveUp, "Up"},
491 {KEY_DOWN, CK_PanelMoveDown, "Down"},
492 {KEY_LEFT, CK_PanelMoveLeft, "Left"},
493 {KEY_RIGHT, CK_PanelMoveRight, "Right"},
494 {KEY_END, CK_PanelMoveEnd, "End"},
495 {KEY_C1, CK_PanelMoveEnd, "C1"},
496 {KEY_HOME, CK_PanelMoveHome, "Home"},
497 {KEY_A1, CK_PanelMoveHome, "A1"},
498 {KEY_NPAGE, CK_PanelNextPage, "PgDn"},
499 {KEY_PPAGE, CK_PanelPrevPage, "PgUp"},
500 {ALT ('e'), CK_PanelSetPanelEncoding, "M-e"},
501 {XCTRL ('s'), CK_PanelStartSearch, "C-s"},
502 {ALT ('s'), CK_PanelStartSearch, "M-s"},
503 {ALT ('i'), CK_PanelSyncOtherPanel, "M-i"},
504 {0, CK_Ignore_Key, ""}
507 /* main.c */
508 const global_keymap_t default_main_map[] = {
509 {KEY_F (1), CK_HelpCmd, "F1"},
510 {KEY_F (2), CK_UserMenuCmd, "F2"},
511 {KEY_F (3), CK_ViewCmd, "F3"},
512 {KEY_F (4), CK_EditCmd, "F4"},
513 {KEY_F (5), CK_CopyCmd, "F5"},
514 {KEY_F (6), CK_RenameCmd, "F6"},
515 {KEY_F (7), CK_MkdirCmd, "F7"},
516 {KEY_F (8), CK_DeleteCmd, "F8"},
517 {KEY_F (9), CK_MenuCmd, "F9"},
518 {KEY_F (10), CK_QuitCmd, "F10"},
519 {KEY_F (13), CK_ViewFileCmd, "S-F3"},
520 {KEY_F (19), CK_MenuLastSelectedCmd, "S-F9"},
521 {KEY_F (20), CK_QuietQuitCmd, "S-10"},
522 {ALT ('h'), CK_HistoryCmd, "M-h"},
523 {XCTRL ('@'), CK_SingleDirsizeCmd, "C-Space"},
524 /* Copy useful information to the command line */
525 {ALT ('a'), CK_CopyCurrentPathname, "M-a"},
526 {ALT ('A'), CK_CopyOtherPathname, "M-A"},
527 {ALT ('c'), CK_QuickCdCmd, "M-c"},
528 /* To access the directory hotlist */
529 {XCTRL ('\\'), CK_QuickChdirCmd, "C-\\"},
530 /* Suspend */
531 {XCTRL ('z'), CK_SuspendCmd, "C-z"},
532 /* The filtered view command */
533 {ALT ('!'), CK_FilteredViewCmd, "M-!"},
534 /* Find file */
535 {ALT ('?'), CK_FindCmd, "M-?"},
536 /* Panel refresh */
537 {XCTRL ('r'), CK_RereadCmd, "C-r"},
538 /* Toggle listing between long, user defined and full formats */
539 {ALT ('t'), CK_ToggleListingCmd, "M-t"},
540 /* Swap panels */
541 {XCTRL ('u'), CK_SwapCmd, "C-u"},
542 /* View output */
543 {XCTRL ('o'), CK_ShowCommandLine, "C-o"},
544 {ALT ('.'), CK_ToggleShowHidden, "M-."},
545 {ALT (','), CK_TogglePanelsSplit, "M-,"},
546 {XCTRL ('x'), CK_StartExtMap1, "C-x"},
547 /* Select/unselect group */
548 {KEY_KP_ADD, CK_SelectCmd, "+"},
549 {KEY_KP_SUBTRACT, CK_UnselectCmd, "-"},
550 {ALT ('*'), CK_ReverseSelectionCmd, "*"},
552 {ALT ('`'), CK_DialogListCmd, "M-`"},
553 {ALT ('}'), CK_DialogNextCmd, "M-}"},
554 {ALT ('{'), CK_DialogPrevCmd, "M-{"},
556 {0, CK_Ignore_Key, ""}
559 const global_keymap_t default_main_x_map[] = {
560 {'d', CK_CompareDirsCmd, "d"},
561 #ifdef USE_DIFF_VIEW
562 {XCTRL ('d'), CK_DiffViewCmd, "C-d"},
563 #endif /* USE_DIFF_VIEW */
564 #ifdef ENABLE_VFS
565 {'a', CK_ReselectVfs, "a"},
566 #endif /* ENABLE_VFS */
567 {'p', CK_CopyCurrentPathname, "p"},
568 {XCTRL ('p'), CK_CopyOtherPathname, "C-p"},
569 {'t', CK_CopyCurrentTagged, "t"},
570 {XCTRL ('t'), CK_CopyOtherTagged, "C-t"},
571 {'c', CK_ChmodCmd, "c"},
572 {'o', CK_ChownCmd, "o"},
573 {'r', CK_CopyCurrentReadlink, "r"},
574 {XCTRL ('r'), CK_CopyOtherReadlink, "C-r"},
575 {'l', CK_LinkCmd, "l"},
576 {'s', CK_SymlinkCmd, "s"},
577 {'v', CK_RelativeSymlinkCmd, "v"},
578 {XCTRL ('s'), CK_EditSymlinkCmd, "C-s"},
579 {'i', CK_InfoCmd, "i"},
580 {'q', CK_QuickViewCmd, "q"},
581 {'h', CK_AddHotlist, "h"},
582 {'!', CK_ExternalPanelize, "!"},
583 #ifdef WITH_BACKGROUND
584 {'j', CK_JobsCmd, "j"},
585 #endif /* WITH_BACKGROUND */
586 {0, CK_Ignore_Key, ""}
589 const global_keymap_t default_input_keymap[] = {
590 /* Motion */
591 {XCTRL ('a'), CK_InputBol, "C-a"},
592 {KEY_HOME, CK_InputBol, "Home"},
593 {KEY_A1, CK_InputBol, "A1"},
594 {ALT ('<'), CK_InputBol, "M-<"},
595 {XCTRL ('e'), CK_InputEol, "C-e"},
596 {KEY_END, CK_InputEol, "End"},
597 {ALT ('>'), CK_InputEol, "M->"},
598 {KEY_C1, CK_InputEol, "C1"},
599 {KEY_LEFT, CK_InputMoveLeft, "Left"},
600 {KEY_M_CTRL | KEY_LEFT, CK_InputWordLeft, "C-Left"},
601 {KEY_RIGHT, CK_InputMoveRight, "Right"},
602 {KEY_M_CTRL | KEY_RIGHT, CK_InputWordRight, "C-Right"},
604 {XCTRL ('b'), CK_InputBackwardChar, "C-b"},
605 {ALT ('b'), CK_InputBackwardWord, "M-b"},
606 {XCTRL ('f'), CK_InputForwardChar, "C-f"},
607 {ALT ('f'), CK_InputForwardWord, "M-f"},
609 /* Editing */
610 {KEY_BACKSPACE, CK_InputBackwardDelete, "BackSpace"},
611 {KEY_BACKSPACE, CK_InputBackwardDelete, "C-h"},
612 {KEY_DC, CK_InputDeleteChar, "Delete"},
613 {KEY_DC, CK_InputDeleteChar, "C-d"},
614 {ALT ('d'), CK_InputKillWord, "M-d"},
615 {ALT (KEY_BACKSPACE), CK_InputBackwardKillWord, "M-BackSpace"},
617 /* Region manipulation */
618 {XCTRL ('w'), CK_InputKillRegion, "C-w"},
619 {ALT ('w'), CK_InputKillSave, "M-w"},
620 {XCTRL ('y'), CK_InputYank, "C-y"},
621 {XCTRL ('k'), CK_InputKillLine, "C-k"},
623 /* History */
624 {ALT ('p'), CK_InputHistoryPrev, "M-p"},
625 {ALT ('n'), CK_InputHistoryNext, "M-n"},
626 {ALT ('h'), CK_InputHistoryShow, "M-h"},
628 /* Completion */
629 {ALT ('\t'), CK_InputComplete, "M-tab"},
631 {0, CK_Ignore_Key, ""}
634 const global_keymap_t default_listbox_keymap[] = {
635 {KEY_UP, CK_ListboxMoveUp, "Up"},
636 {XCTRL ('p'), CK_ListboxMoveUp, "C-p"},
637 {KEY_DOWN, CK_ListboxMoveDown, "Down"},
638 {XCTRL ('n'), CK_ListboxMoveDown, "C-n"},
639 {KEY_HOME, CK_ListboxMoveHome, "Home"},
640 {ALT ('<'), CK_ListboxMoveHome, "M-<"},
641 {KEY_A1, CK_ListboxMoveHome, "A1"},
642 {KEY_END, CK_ListboxMoveEnd, "End"},
643 {ALT ('>'), CK_ListboxMoveEnd, "M->"},
644 {KEY_C1, CK_ListboxMoveEnd, "C1"},
645 {KEY_PPAGE, CK_ListboxMovePgUp, "PgUp"},
646 {ALT ('v'), CK_ListboxMovePgUp, "M-v"},
647 {KEY_NPAGE, CK_ListboxMovePgDn, "PgDn"},
648 {XCTRL ('v'), CK_ListboxMovePgDn, "C-v"},
649 {KEY_DC, CK_ListboxDeleteItem, "Delete"},
650 {'d', CK_ListboxDeleteItem, "d"},
651 {KEY_M_SHIFT | KEY_DC, CK_ListboxDeleteAll, "S-Delete"},
652 {'D', CK_ListboxDeleteAll, "D"},
654 {0, CK_Ignore_Key, ""}
657 #ifdef USE_DIFF_VIEW
658 /* diff viewer */
659 const global_keymap_t default_diff_keymap[] = {
661 {'s', CK_DiffDisplaySymbols, "s"},
662 {'l', CK_DiffDisplayNumbers, "l"},
663 {'f', CK_DiffFull, "f"},
664 {'=', CK_DiffEqual, "="},
665 {'>', CK_DiffSplitMore, ">"},
666 {'<', CK_DiffSplitLess, "<"},
667 {'2', CK_DiffSetTab2, "2"},
668 {'3', CK_DiffSetTab3, "3"},
669 {'4', CK_DiffSetTab4, "4"},
670 {'8', CK_DiffSetTab8, "8"},
671 {XCTRL ('u'), CK_DiffSwapPanel, "C-u"},
672 {XCTRL ('r'), CK_DiffRedo, "C-r"},
673 {XCTRL ('o'), CK_ShowCommandLine, "C-o"},
674 {'n', CK_DiffNextHunk, "n"},
675 {'p', CK_DiffPrevHunk, "p"},
676 {'g', CK_DiffGoto, "g"},
677 {'G', CK_DiffGoto, "G"},
678 {KEY_M_CTRL | KEY_HOME, CK_DiffBOF, "C-Home"},
679 {KEY_M_CTRL | KEY_END, CK_DiffEOF, "C-End"},
680 {KEY_DOWN, CK_DiffDown, "Down"},
681 {KEY_UP, CK_DiffUp, "Up"},
682 {KEY_M_CTRL | KEY_LEFT, CK_DiffQuickLeft, "C-Left"},
683 {KEY_M_CTRL | KEY_RIGHT, CK_DiffQuickRight, "C-Right"},
684 {KEY_LEFT, CK_DiffLeft, "Left"},
685 {KEY_RIGHT, CK_DiffRight, "Right"},
686 {KEY_NPAGE, CK_DiffPageDown, "Down"},
687 {KEY_PPAGE, CK_DiffPageUp, "Up"},
688 {KEY_HOME, CK_DiffHome, "Home"},
689 {KEY_END, CK_DiffEnd, "End"},
690 {'q', CK_DiffQuit, "q"},
691 {'Q', CK_DiffQuit, "Q"},
692 {XCTRL ('g'), CK_DiffQuit, "C-g"},
693 {ESC_CHAR, CK_DiffQuit, "Esc"},
695 {KEY_F (1), CK_DiffHelp, "F1"},
696 {KEY_F (4), CK_DiffEditCurrent, "F4"},
697 {KEY_F (5), CK_DiffMergeCurrentHunk, "F5"},
698 {KEY_F (7), CK_DiffSearch, "F7"},
699 {KEY_F (17), CK_DiffContinueSearch, "S-F7"},
700 {KEY_F (9), CK_DiffOptions, "F9"},
701 {KEY_F (10), CK_DiffQuit, "F10"},
702 {KEY_F (14), CK_DiffEditOther, "S-F4"},
704 {0, CK_Ignore_Key, ""}
706 #endif
708 /*** file scope macro definitions ****************************************************************/
710 /*** file scope type declarations ****************************************************************/
712 /*** file scope variables ************************************************************************/
714 /*** file scope functions ************************************************************************/
715 /* --------------------------------------------------------------------------------------------- */
717 /* --------------------------------------------------------------------------------------------- */
718 /*** public functions ****************************************************************************/
719 /* --------------------------------------------------------------------------------------------- */