root/src/keybind-defaults.c

/* [previous][next][first][last][top][bottom][index][help]  */

DEFINITIONS

This source file includes following definitions.
  1. create_default_keymap_section
  2. create_default_keymap

   1 /*
   2    Default values for keybinding engine
   3 
   4    Copyright (C) 2009-2019
   5    Free Software Foundation, Inc.
   6 
   7    Written by:
   8    Vitja Makarov, 2005
   9    Ilia Maslakov <il.smind@gmail.com>, 2009, 2010
  10    Andrew Borodin <aborodin@vmail.ru>, 2010, 2011
  11 
  12    This file is part of the Midnight Commander.
  13 
  14    The Midnight Commander is free software: you can redistribute it
  15    and/or modify it under the terms of the GNU General Public License as
  16    published by the Free Software Foundation, either version 3 of the License,
  17    or (at your option) any later version.
  18 
  19    The Midnight Commander is distributed in the hope that it will be useful,
  20    but WITHOUT ANY WARRANTY; without even the implied warranty of
  21    MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
  22    GNU General Public License for more details.
  23 
  24    You should have received a copy of the GNU General Public License
  25    along with this program.  If not, see <http://www.gnu.org/licenses/>.
  26  */
  27 
  28 #include <config.h>
  29 
  30 #include "lib/global.h"
  31 #include "lib/widget.h"         /* dialog_map, input_map, listbox_map */
  32 
  33 #include "keybind-defaults.h"
  34 
  35 /*** global variables ****************************************************************************/
  36 
  37 GArray *main_keymap = NULL;
  38 GArray *main_x_keymap = NULL;
  39 GArray *panel_keymap = NULL;
  40 GArray *dialog_keymap = NULL;
  41 GArray *menu_keymap = NULL;
  42 GArray *input_keymap = NULL;
  43 GArray *listbox_keymap = NULL;
  44 GArray *tree_keymap = NULL;
  45 GArray *help_keymap = NULL;
  46 #ifdef USE_INTERNAL_EDIT
  47 GArray *editor_keymap = NULL;
  48 GArray *editor_x_keymap = NULL;
  49 #endif
  50 GArray *viewer_keymap = NULL;
  51 GArray *viewer_hex_keymap = NULL;
  52 #ifdef USE_DIFF_VIEW
  53 GArray *diff_keymap = NULL;
  54 #endif
  55 
  56 const global_keymap_t *main_map = NULL;
  57 const global_keymap_t *main_x_map = NULL;
  58 const global_keymap_t *panel_map = NULL;
  59 const global_keymap_t *menu_map = NULL;
  60 const global_keymap_t *tree_map = NULL;
  61 const global_keymap_t *help_map = NULL;
  62 
  63 #ifdef USE_INTERNAL_EDIT
  64 const global_keymap_t *editor_map = NULL;
  65 const global_keymap_t *editor_x_map = NULL;
  66 #endif
  67 const global_keymap_t *viewer_map = NULL;
  68 const global_keymap_t *viewer_hex_map = NULL;
  69 #ifdef USE_DIFF_VIEW
  70 const global_keymap_t *diff_map = NULL;
  71 #endif
  72 
  73 /*** file scope macro definitions ****************************************************************/
  74 
  75 /*** file scope type declarations ****************************************************************/
  76 
  77 /* default keymaps in ini (key=value) format */
  78 typedef struct global_keymap_ini_t
  79 {
  80     const char *key;
  81     const char *value;
  82 } global_keymap_ini_t;
  83 
  84 /*** file scope variables ************************************************************************/
  85 
  86 /* midnight */
  87 static const global_keymap_ini_t default_main_keymap[] = {
  88     {"ChangePanel", "tab"},
  89     {"Help", "f1"},
  90     {"UserMenu", "f2"},
  91     {"View", "f3"},
  92     {"Edit", "f4"},
  93     {"Copy", "f5"},
  94     {"Move", "f6"},
  95     {"MakeDir", "f7"},
  96     {"Delete", "f8"},
  97     {"Menu", "f9"},
  98     {"Quit", "f10"},
  99     {"MenuLastSelected", "f19"},
 100     {"QuitQuiet", "f20"},
 101     {"History", "alt-h"},
 102     {"EditorViewerHistory", "alt-shift-e"},
 103     {"DirSize", "ctrl-space"},
 104     /* Copy useful information to the command line */
 105     {"PutCurrentPath", "alt-a"},
 106     {"PutOtherPath", "alt-shift-a"},
 107     {"PutCurrentSelected", "alt-enter; ctrl-enter"},
 108     {"PutCurrentFullSelected", "ctrl-shift-enter"},
 109     {"CdQuick", "alt-c"},
 110     /* To access the directory hotlist */
 111     {"HotList", "ctrl-backslash"},
 112     /* Suspend */
 113     {"Suspend", "ctrl-z"},
 114     /* The filtered view command */
 115     {"ViewFiltered", "alt-exclamation"},
 116     /* Find file */
 117     {"Find", "alt-question"},
 118     /* Panel refresh */
 119     {"Reread", "ctrl-r"},
 120     /* Switch listing between long, user defined and full formats */
 121     /* Swap panels */
 122     {"Swap", "ctrl-u"},
 123     /* Resize panels */
 124     {"SplitEqual", "alt-equal"},
 125     {"SplitMore", "alt-shift-right"},
 126     {"SplitLess", "alt-shift-left"},
 127     /* View output */
 128     {"Shell", "ctrl-o"},
 129     {"ShowHidden", "alt-dot"},
 130     {"SplitVertHoriz", "alt-comma"},
 131     {"ExtendedKeyMap", "ctrl-x"},
 132     /* Select/unselect group */
 133     {"Select", "kpplus"},
 134     {"Unselect", "kpminus"},
 135     {"SelectInvert", "kpasterisk"},
 136     /* List of screens */
 137     {"ScreenList", "alt-prime"},
 138     {NULL, NULL}
 139 };
 140 
 141 static const global_keymap_ini_t default_main_x_keymap[] = {
 142     {"CompareDirs", "d"},
 143 #ifdef USE_DIFF_VIEW
 144     {"CompareFiles", "ctrl-d"},
 145 #endif /* USE_DIFF_VIEW */
 146 #ifdef ENABLE_VFS
 147     {"VfsList", "a"},
 148 #endif /* ENABLE_VFS */
 149     {"PutCurrentPath", "p"},
 150     {"PutOtherPath", "ctrl-p"},
 151     {"PutCurrentTagged", "t"},
 152     {"PutOtherTagged", "ctrl-t"},
 153     {"ChangeMode", "c"},
 154     {"ChangeOwn", "o"},
 155     {"PutCurrentLink", "r"},
 156     {"PutOtherLink", "ctrl-r"},
 157     {"Link", "l"},
 158     {"LinkSymbolic", "s"},
 159     {"LinkSymbolicRelative", "v"},
 160     {"LinkSymbolicEdit", "ctrl-s"},
 161     {"PanelInfo", "i"},
 162     {"PanelQuickView", "q"},
 163     {"HotListAdd", "h"},
 164 #ifdef ENABLE_BACKGROUND
 165     {"Jobs", "j"},
 166 #endif /* ENABLE_BACKGROUND */
 167     {"ExternalPanelize", "!"},
 168     {NULL, NULL}
 169 };
 170 
 171 /* panel */
 172 static const global_keymap_ini_t default_panel_keymap[] = {
 173     {"CycleListingFormat", "alt-t"},
 174     {"PanelOtherCd", "alt-o"},
 175     {"PanelOtherCdLink", "alt-l"},
 176     {"CopySingle", "f15"},
 177     {"DeleteSingle", "f18"},
 178     {"Enter", "enter"},
 179     {"EditNew", "f14"},
 180     {"MoveSingle", "f16"},
 181     {"SelectInvert", "alt-asterisk"},
 182     {"Select", "alt-plus"},
 183     {"Unselect", "alt-minus"},
 184     {"ViewRaw", "f13"},
 185     {"CdChild", "ctrl-pgdn"},
 186     {"CdParent", "ctrl-pgup"},
 187     {"History", "alt-shift-h"},
 188     {"HistoryNext", "alt-u"},
 189     {"HistoryPrev", "alt-y"},
 190     {"BottomOnScreen", "alt-j"},
 191     {"MiddleOnScreen", "alt-r"},
 192     {"TopOnScreen", "alt-g"},
 193     {"Mark", "insert; ctrl-t"},
 194     {"MarkDown", "shift-down"},
 195     {"MarkUp", "shift-up"},
 196     {"Up", "up; ctrl-p"},
 197     {"Down", "down; ctrl-n"},
 198     {"Left", "left"},
 199     {"Right", "right"},
 200     {"Top", "alt-lt; home; a1"},
 201     {"Bottom", "alt-gt; end; c1"},
 202     {"PageDown", "pgdn; ctrl-v"},
 203     {"PageUp", "pgup; alt-v"},
 204 #ifdef HAVE_CHARSET
 205     {"SelectCodepage", "alt-e"},
 206 #endif
 207     {"Search", "ctrl-s; alt-s"},
 208     {"PanelOtherSync", "alt-i"},
 209     {NULL, NULL}
 210 };
 211 
 212 /* dialog */
 213 static const global_keymap_ini_t default_dialog_keymap[] = {
 214     {"Ok", "enter"},
 215     {"Cancel", "f10; esc; ctrl-g"},
 216     {"Up", "up; left"},
 217     {"Down", "down; right"},
 218 #if 0
 219     {"Left", "up; left"},
 220     {"Right", "down; right"},
 221 #endif
 222     {"Help", "f1"},
 223     {"Suspend", "ctrl-z"},
 224     {"Refresh", "ctrl-l"},
 225     {"ScreenList", "alt-prime"},
 226     {"ScreenNext", "alt-rbrace"},
 227     {"ScreenPrev", "alt-lbrace"},
 228     {NULL, NULL}
 229 };
 230 
 231 /* menubar */
 232 static const global_keymap_ini_t default_menu_keymap[] = {
 233     {"Help", "f1"},
 234     {"Left", "left; ctrl-b"},
 235     {"Right", "right; ctrl-f"},
 236     {"Up", "up; ctrl-p"},
 237     {"Down", "down; ctrl-n"},
 238     {"Home", "home; alt-lt; ctrl-a"},
 239     {"End", "end; alt-gt; ctrl-e"},
 240     {"Enter", "enter"},
 241     {"Quit", "f10; ctrl-g; esc"},
 242     {NULL, NULL}
 243 };
 244 
 245 /* input line */
 246 static const global_keymap_ini_t default_input_keymap[] = {
 247     /* Motion */
 248     {"Home", "ctrl-a; alt-lt; home; a1"},
 249     {"End", "ctrl-e; alt-gt; end; c1"},
 250     {"Left", "left; alt-left; ctrl-b"},
 251     {"Right", "right; alt-right; ctrl-f"},
 252     {"WordLeft", "ctrl-left; alt-b"},
 253     {"WordRight", "ctrl-right; alt-f"},
 254     /* Mark */
 255     {"MarkLeft", "shift-left"},
 256     {"MarkRight", "shift-right"},
 257     {"MarkToWordBegin", "ctrl-shift-left"},
 258     {"MarkToWordEnd", "ctrl-shift-right"},
 259     {"MarkToHome", "shift-home"},
 260     {"MarkToEnd", "shift-end"},
 261     /* Editing */
 262     {"Backspace", "backspace; ctrl-h"},
 263     {"Delete", "delete; ctrl-d"},
 264     {"DeleteToWordEnd", "alt-d"},
 265     {"DeleteToWordBegin", "alt-backspace"},
 266     /* Region manipulation */
 267     {"Remove", "ctrl-w"},
 268     {"Store", "alt-w"},
 269     {"Yank", "ctrl-y"},
 270     {"DeleteToEnd", "ctrl-k"},
 271     /* History */
 272     {"History", "alt-h"},
 273     {"HistoryPrev", "alt-p; ctrl-down"},
 274     {"HistoryNext", "alt-n; ctrl-up"},
 275     /* Completion */
 276     {"Complete", "alt-tab"},
 277     {NULL, NULL}
 278 };
 279 
 280 /* listbox */
 281 static const global_keymap_ini_t default_listbox_keymap[] = {
 282     {"Up", "up; ctrl-p"},
 283     {"Down", "down; ctrl-n"},
 284     {"Top", "home; alt-lt; a1"},
 285     {"Bottom", "end; alt-gt; c1"},
 286     {"PageUp", "pgup; alt-v"},
 287     {"PageDown", "pgdn; ctrl-v"},
 288     {"Delete", "delete; d"},
 289     {"Clear", "shift-delete; shift-d"},
 290     {"View", "f3"},
 291     {"Edit", "f4"},
 292     {"Enter", "enter"},
 293     {NULL, NULL}
 294 };
 295 
 296 /* tree */
 297 static const global_keymap_ini_t default_tree_keymap[] = {
 298     {"Help", "f1"},
 299     {"Rescan", "f2; ctrl-r"},
 300     {"Forget", "f3"},
 301     {"ToggleNavigation", "f4"},
 302     {"Copy", "f5"},
 303     {"Move", "f6"},
 304 #if 0
 305     {"MakeDir", "f7"},
 306 #endif
 307     {"Delete", "f8; delete"},
 308     {"Up", "up; ctrl-p"},
 309     {"Down", "down; ctrl-n"},
 310     {"Left", "left"},
 311     {"Right", "right"},
 312     {"Top", "home; alt-lt; a1"},
 313     {"Bottom", "end; alt-gt; c1"},
 314     {"PageUp", "pgup; alt-v"},
 315     {"PageDown", "pgdn; ctrl-v"},
 316     {"Enter", "enter"},
 317     {"Search", "ctrl-s; alt-s"},
 318     {NULL, NULL}
 319 };
 320 
 321 /* help */
 322 static const global_keymap_ini_t default_help_keymap[] = {
 323     {"Help", "f1"},
 324     {"Index", "f2; c"},
 325     {"Back", "f3; left; l"},
 326     {"Quit", "f10; esc"},
 327     {"Up", "up; ctrl-p"},
 328     {"Down", "down; ctrl-n"},
 329     {"PageDown", "f; space; pgdn; ctrl-v"},
 330     {"PageUp", "b; pgup; alt-v; backspace"},
 331     {"HalfPageDown", "d"},
 332     {"HalfPageUp", "u"},
 333     {"Top", "home; ctrl-home; ctrl-pgup; a1; alt-lt; g"},
 334     {"Bottom", "end; ctrl-end; ctrl-pgdn; c1; alt-gt; shift-g"},
 335     {"Enter", "right; enter"},
 336     {"LinkNext", "tab"},
 337     {"LinkPrev", "alt-tab"},
 338     {"NodeNext", "n"},
 339     {"NodePrev", "p"},
 340     {NULL, NULL}
 341 };
 342 
 343 #ifdef USE_INTERNAL_EDIT
 344 static const global_keymap_ini_t default_editor_keymap[] = {
 345     {"Enter", "enter"},
 346     {"Return", "shift-enter; ctrl-enter; ctrl-shift-enter"},    /* useful for pasting multiline text */
 347     {"Tab", "tab; shift-tab; ctrl-tab; ctrl-shift-tab"},        /* ditto */
 348     {"BackSpace", "backspace; ctrl-h"},
 349     {"Delete", "delete; ctrl-d"},
 350     {"Left", "left"},
 351     {"Right", "right"},
 352     {"Up", "up"},
 353     {"Down", "down"},
 354     {"Home", "home"},
 355     {"End", "end"},
 356     {"PageUp", "pgup"},
 357     {"PageDown", "pgdn"},
 358     {"WordLeft", "ctrl-left; ctrl-z"},
 359     {"WordRight", "ctrl-right; ctrl-x"},
 360     {"InsertOverwrite", "insert"},
 361     {"Help", "f1"},
 362     {"Save", "f2"},
 363     {"Mark", "f3"},
 364     {"Replace", "f4"},
 365     {"Copy", "f5"},
 366     {"Move", "f6"},
 367     {"Search", "f7"},
 368     {"Remove", "f8; ctrl-delete"},
 369     {"Menu", "f9"},
 370     {"Quit", "f10; esc"},
 371     {"UserMenu", "f11"},
 372     {"SaveAs", "f12; ctrl-f2"},
 373     {"MarkColumn", "f13"},
 374     {"ReplaceContinue", "f14; ctrl-f4"},
 375     {"InsertFile", "f15"},
 376     {"SearchContinue", "f17; ctrl-f7"},
 377     {"EditNew", "ctrl-n"},
 378     {"DeleteToWordBegin", "alt-backspace"},
 379     {"DeleteToWordEnd", "alt-d"},
 380     {"DeleteLine", "ctrl-y"},
 381     {"DeleteToEnd", "ctrl-k"},
 382     {"Undo", "ctrl-u; ctrl-backspace"},
 383     {"Redo", "alt-r"},
 384 #ifdef HAVE_CHARSET
 385     {"SelectCodepage", "alt-e"},
 386 #endif
 387     {"Goto", "alt-l; alt-shift-l"},
 388     {"Refresh", "ctrl-l"},
 389     {"Shell", "ctrl-o"},
 390     {"Top", "ctrl-home; ctrl-pgup; alt-lt"},
 391     {"Bottom", "ctrl-end; ctrl-pgdn; alt-gt"},
 392     {"TopOnScreen", "ctrl-pgup"},
 393     {"BottomOnScreen", "ctrl-pgdn"},
 394     {"ScrollUp", "ctrl-up"},
 395     {"ScrollDown", "ctrl-down"},
 396     {"Store", "ctrl-insert"},
 397     {"Paste", "shift-insert"},
 398     {"Cut", "shift-delete"},
 399     {"BlockSave", "ctrl-f"},
 400     {"MarkLeft", "shift-left"},
 401     {"MarkRight", "shift-right"},
 402     {"MarkUp", "shift-up"},
 403     {"MarkDown", "shift-down"},
 404     {"MarkPageUp", "shift-pgup"},
 405     {"MarkPageDown", "shift-pgdn"},
 406     {"MarkToWordBegin", "ctrl-shift-left"},
 407     {"MarkToWordEnd", "ctrl-shift-right"},
 408     {"MarkToHome", "shift-home"},
 409     {"MarkToEnd", "shift-end"},
 410     {"MarkToFileBegin", "ctrl-shift-home"},
 411     {"MarkToFileEnd", "ctrl-shift-end"},
 412     {"MarkToPageBegin", "ctrl-shift-pgup"},
 413     {"MarkToPageEnd", "ctrl-shift-pgdn"},
 414     {"MarkScrollUp", "ctrl-shift-up"},
 415     {"MarkScrollDown", "ctrl-shift-down"},
 416     {"MarkColumnLeft", "alt-left"},
 417     {"MarkColumnRight", "alt-right"},
 418     {"MarkColumnUp", "alt-up"},
 419     {"MarkColumnDown", "alt-down"},
 420     {"MarkColumnPageUp", "alt-pgup"},
 421     {"MarkColumnPageDown", "alt-pgdn"},
 422     {"InsertLiteral", "ctrl-q"},
 423     {"Complete", "alt-tab"},
 424     {"MatchBracket", "alt-b"},
 425     {"ParagraphFormat", "alt-p"},
 426     {"Bookmark", "alt-k"},
 427     {"BookmarkFlush", "alt-o"},
 428     {"BookmarkNext", "alt-j"},
 429     {"BookmarkPrev", "alt-i"},
 430     {"MacroStartStopRecord", "ctrl-r"},
 431     {"MacroExecute", "ctrl-a"},
 432     {"ShowNumbers", "alt-n"},
 433     {"ShowTabTws", "alt-underline"},
 434     {"SyntaxOnOff", "ctrl-s"},
 435     {"Find", "alt-enter"},
 436     {"FilePrev", "alt-minus"},
 437     {"FileNext", "alt-plus"},
 438     {"Sort", "alt-t"},
 439     {"Mail", "alt-m"},
 440     {"ExternalCommand", "alt-u"},
 441 #ifdef HAVE_ASPELL
 442     {"SpellCheckCurrentWord", "ctrl-p"},
 443 #endif
 444     {"ExtendedKeyMap", "ctrl-x"},
 445     {NULL, NULL}
 446 };
 447 
 448 /* emacs keyboard layout emulation */
 449 static const global_keymap_ini_t default_editor_x_keymap[] = {
 450     {NULL, NULL}
 451 };
 452 #endif /* USE_INTERNAL_EDIT */
 453 
 454 /* viewer */
 455 static const global_keymap_ini_t default_viewer_keymap[] = {
 456     {"Help", "f1"},
 457     {"WrapMode", "f2"},
 458     {"Quit", "f3; f10; q; esc"},
 459     {"HexMode", "f4"},
 460     {"Goto", "f5"},
 461     {"Search", "f7"},
 462     {"SearchContinue", "f17; n"},
 463     {"MagicMode", "f8"},
 464     {"NroffMode", "f9"},
 465     {"Home", "ctrl-a"},
 466     {"End", "ctrl-e"},
 467     {"Left", "h; left"},
 468     {"Right", "l; right"},
 469     {"LeftQuick", "ctrl-left"},
 470     {"RightQuick", "ctrl-right"},
 471     {"Up", "k; y; insert; up; ctrl-p"},
 472     {"Down", "j; e; delete; down; enter; ctrl-n"},
 473     {"PageDown", "f; space; pgdn; ctrl-v"},
 474     {"PageUp", "b; pgup; alt-v; backspace"},
 475     {"HalfPageDown", "d"},
 476     {"HalfPageUp", "u"},
 477     {"Top", "home; ctrl-home; ctrl-pgup; a1; alt-lt; g"},
 478     {"Bottom", "end; ctrl-end; ctrl-pgdn; c1; alt-gt; shift-g"},
 479     {"BookmarkGoto", "m"},
 480     {"Bookmark", "r"},
 481     {"FileNext", "ctrl-f"},
 482     {"FilePrev", "ctrl-b"},
 483 #ifdef HAVE_CHARSET
 484     {"SelectCodepage", "alt-e"},
 485 #endif
 486     {"Shell", "ctrl-o"},
 487     {"Ruler", "alt-r"},
 488     {"SearchForward", "slash"},
 489     {"SearchBackward", "question"},
 490     {"SearchForwardContinue", "ctrl-s"},
 491     {"SearchBackwardContinue", "ctrl-r"},
 492     {"SearchOppositeContinue", "shift-n"},
 493     {"History", "alt-shift-e"},
 494     {NULL, NULL}
 495 };
 496 
 497 /* hex viewer */
 498 static const global_keymap_ini_t default_viewer_hex_keymap[] = {
 499     {"Help", "f1"},
 500     {"HexEditMode", "f2"},
 501     {"Quit", "f3; f10; q; esc"},
 502     {"HexMode", "f4"},
 503     {"Goto", "f5"},
 504     {"Save", "f6"},
 505     {"Search", "f7"},
 506     {"SearchContinue", "f17; n"},
 507     {"MagicMode", "f8"},
 508     {"NroffMode", "f9"},
 509     {"ToggleNavigation", "tab"},
 510     {"Home", "ctrl-a; home"},
 511     {"End", "ctrl-e; end"},
 512     {"Left", "b; left"},
 513     {"Right", "f; right"},
 514     {"Up", "k; y; up"},
 515     {"Down", "j; delete; down"},
 516     {"PageDown", "pgdn; ctrl-v"},
 517     {"PageUp", "pgup; alt-v"},
 518     {"Top", "ctrl-home; ctrl-pgup; a1; alt-lt; g"},
 519     {"Bottom", "ctrl-end; ctrl-pgdn; c1; alt-gt; shift-g"},
 520 #ifdef HAVE_CHARSET
 521     {"SelectCodepage", "alt-e"},
 522 #endif
 523     {"Shell", "ctrl-o"},
 524     {"SearchForward", "slash"},
 525     {"SearchBackward", "question"},
 526     {"SearchForwardContinue", "ctrl-s"},
 527     {"SearchBackwardContinue", "ctrl-r"},
 528     {"SearchOppositeContinue", "shift-n"},
 529     {"History", "alt-shift-e"},
 530     {NULL, NULL}
 531 };
 532 
 533 #ifdef  USE_DIFF_VIEW
 534 /* diff viewer */
 535 static const global_keymap_ini_t default_diff_keymap[] = {
 536     {"ShowSymbols", "alt-s; s"},
 537     {"ShowNumbers", "alt-n; l"},
 538     {"SplitFull", "f"},
 539     {"SplitEqual", "equal"},
 540     {"SplitMore", "gt"},
 541     {"SplitLess", "lt"},
 542     {"Tab2", "2"},
 543     {"Tab3", "3"},
 544     {"Tab4", "4"},
 545     {"Tab8", "8"},
 546     {"Swap", "ctrl-u"},
 547     {"Redo", "ctrl-r"},
 548     {"HunkNext", "n; enter; space"},
 549     {"HunkPrev", "p; backspace"},
 550     {"Goto", "g; shift-g"},
 551     {"Save", "f2"},
 552     {"Edit", "f4"},
 553     {"EditOther", "f14"},
 554     {"Merge", "f5"},
 555     {"MergeOther", "f15"},
 556     {"Search", "f7"},
 557     {"SearchContinue", "f17"},
 558     {"Options", "f9"},
 559     {"Top", "ctrl-home"},
 560     {"Bottom", "ctrl-end"},
 561     {"Down", "down"},
 562     {"Up", "up"},
 563     {"LeftQuick", "ctrl-left"},
 564     {"RightQuick", "ctrl-right"},
 565     {"Left", "left"},
 566     {"Right", "right"},
 567     {"PageDown", "pgdn"},
 568     {"PageUp", "pgup"},
 569     {"Home", "home"},
 570     {"End", "end"},
 571     {"Help", "f1"},
 572     {"Quit", "f10; q; shift-q; esc"},
 573 #ifdef HAVE_CHARSET
 574     {"SelectCodepage", "alt-e"},
 575 #endif
 576     {"Shell", "ctrl-o"},
 577     {NULL, NULL}
 578 };
 579 #endif
 580 
 581 /*** file scope macro definitions ****************************************************************/
 582 
 583 /*** file scope type declarations ****************************************************************/
 584 
 585 /*** file scope variables ************************************************************************/
 586 
 587 /*** file scope functions ************************************************************************/
 588 /* --------------------------------------------------------------------------------------------- */
 589 
 590 static void
 591 create_default_keymap_section (mc_config_t * keymap, const char *section,
     /* [previous][next][first][last][top][bottom][index][help]  */
 592                                const global_keymap_ini_t * k)
 593 {
 594     size_t i;
 595 
 596     for (i = 0; k[i].key != NULL; i++)
 597         mc_config_set_string_raw (keymap, section, k[i].key, k[i].value);
 598 }
 599 
 600 /* --------------------------------------------------------------------------------------------- */
 601 /*** public functions ****************************************************************************/
 602 /* --------------------------------------------------------------------------------------------- */
 603 
 604 mc_config_t *
 605 create_default_keymap (void)
     /* [previous][next][first][last][top][bottom][index][help]  */
 606 {
 607     mc_config_t *keymap;
 608 
 609     keymap = mc_config_init (NULL, TRUE);
 610 
 611     create_default_keymap_section (keymap, KEYMAP_SECTION_MAIN, default_main_keymap);
 612     create_default_keymap_section (keymap, KEYMAP_SECTION_MAIN_EXT, default_main_x_keymap);
 613     create_default_keymap_section (keymap, KEYMAP_SECTION_PANEL, default_panel_keymap);
 614     create_default_keymap_section (keymap, KEYMAP_SECTION_DIALOG, default_dialog_keymap);
 615     create_default_keymap_section (keymap, KEYMAP_SECTION_MENU, default_menu_keymap);
 616     create_default_keymap_section (keymap, KEYMAP_SECTION_INPUT, default_input_keymap);
 617     create_default_keymap_section (keymap, KEYMAP_SECTION_LISTBOX, default_listbox_keymap);
 618     create_default_keymap_section (keymap, KEYMAP_SECTION_TREE, default_tree_keymap);
 619     create_default_keymap_section (keymap, KEYMAP_SECTION_HELP, default_help_keymap);
 620 #ifdef USE_INTERNAL_EDIT
 621     create_default_keymap_section (keymap, KEYMAP_SECTION_EDITOR, default_editor_keymap);
 622     create_default_keymap_section (keymap, KEYMAP_SECTION_EDITOR_EXT, default_editor_x_keymap);
 623 #endif
 624     create_default_keymap_section (keymap, KEYMAP_SECTION_VIEWER, default_viewer_keymap);
 625     create_default_keymap_section (keymap, KEYMAP_SECTION_VIEWER_HEX, default_viewer_hex_keymap);
 626 #ifdef  USE_DIFF_VIEW
 627     create_default_keymap_section (keymap, KEYMAP_SECTION_DIFFVIEWER, default_diff_keymap);
 628 #endif
 629 
 630     return keymap;
 631 }

/* [previous][next][first][last][top][bottom][index][help]  */