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

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