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

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