chiark / gitweb /
lib/dpkg/tarfn.c: Kludge `tar_header_decode' to handle spurious `errno'.
[dpkg] / dselect / methkeys.cc
1 /*
2  * dselect - Debian package maintenance user interface
3  * methkeys.cc - method list keybindings
4  *
5  * Copyright © 1995 Ian Jackson <ijackson@chiark.greenend.org.uk>
6  *
7  * This is free software; you can redistribute it and/or modify
8  * it under the terms of the GNU General Public License as published by
9  * the Free Software Foundation; either version 2 of the License, or
10  * (at your option) any later version.
11  *
12  * This is distributed in the hope that it will be useful,
13  * but WITHOUT ANY WARRANTY; without even the implied warranty of
14  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
15  * GNU General Public License for more details.
16  *
17  * You should have received a copy of the GNU General Public License
18  * along with this program.  If not, see <https://www.gnu.org/licenses/>.
19  */
20
21 #include <config.h>
22 #include <compat.h>
23
24 #include <dpkg/dpkg-db.h>
25
26 #include "dselect.h"
27 #include "bindings.h"
28
29 const keybindings::interpretation methodlist_kinterps[] = {
30   { "up",              &methodlist::kd_up,           nullptr, qa_noquit           },
31   { "down",            &methodlist::kd_down,         nullptr, qa_noquit           },
32   { "top",             &methodlist::kd_top,          nullptr, qa_noquit           },
33   { "bottom",          &methodlist::kd_bottom,       nullptr, qa_noquit           },
34   { "scrollon",        &methodlist::kd_scrollon,     nullptr, qa_noquit           },
35   { "scrollback",      &methodlist::kd_scrollback,   nullptr, qa_noquit           },
36   { "iscrollon",       &methodlist::kd_iscrollon,    nullptr, qa_noquit           },
37   { "iscrollback",     &methodlist::kd_iscrollback,  nullptr, qa_noquit           },
38   { "scrollon1",       &methodlist::kd_scrollon1,    nullptr, qa_noquit           },
39   { "scrollback1",     &methodlist::kd_scrollback1,  nullptr, qa_noquit           },
40   { "iscrollon1",      &methodlist::kd_iscrollon1,   nullptr, qa_noquit           },
41   { "iscrollback1",    &methodlist::kd_iscrollback1, nullptr, qa_noquit           },
42   { "panon",           &methodlist::kd_panon,        nullptr, qa_noquit           },
43   { "panback",         &methodlist::kd_panback,      nullptr, qa_noquit           },
44   { "panon1",          &methodlist::kd_panon1,       nullptr, qa_noquit           },
45   { "panback1",        &methodlist::kd_panback1,     nullptr, qa_noquit           },
46   { "help",            &methodlist::kd_help,         nullptr, qa_noquit           },
47   { "search",          &methodlist::kd_search,       nullptr, qa_noquit           },
48   { "searchagain",     &methodlist::kd_searchagain,  nullptr, qa_noquit           },
49   { "redraw",          &methodlist::kd_redraw,       nullptr, qa_noquit           },
50   { "select-and-quit", &methodlist::kd_quit,         nullptr, qa_quitchecksave    },
51   { "abort",           &methodlist::kd_abort,        nullptr, qa_quitnochecksave  },
52   { nullptr,           nullptr,                      nullptr, qa_noquit           }
53 };
54
55 const keybindings::orgbinding methodlist_korgbindings[]= {
56   { 'j',            "down"           }, // vi style
57 //{ 'n',            "down"           }, // no style
58   { KEY_DOWN,       "down"           },
59   { 'k',            "up"             }, // vi style
60 //{ 'p',            "up"             }, // no style
61   { KEY_UP,         "up"             },
62
63   { CTRL('f'),      "scrollon"       }, // vi style
64   { 'N',            "scrollon"       },
65   { KEY_NPAGE,      "scrollon"       },
66   { ' ',            "scrollon"       },
67   { CTRL('b'),      "scrollback"     }, // vi style
68   { 'P',            "scrollback"     },
69   { KEY_PPAGE,      "scrollback"     },
70   { KEY_BACKSPACE,  "scrollback"     },
71   { 0177,/*DEL*/    "scrollback"     },
72   { CTRL('h'),      "scrollback"     },
73   { CTRL('n'),      "scrollon1"      },
74   { CTRL('p'),      "scrollback1"    },
75
76   { 't',            "top"            },
77   { KEY_HOME,       "top"            },
78   { 'e',            "bottom"         },
79   { KEY_LL,         "bottom"         },
80   { KEY_END,        "bottom"         },
81
82   { 'u',            "iscrollback"    },
83   { 'd',            "iscrollon"      },
84   { CTRL('u'),      "iscrollback1"   },
85   { CTRL('d'),      "iscrollon1"     },
86
87   { 'B',            "panback"        },
88   { KEY_LEFT,       "panback"        },
89   { 'F',            "panon"          },
90   { KEY_RIGHT,      "panon"          },
91   { CTRL('b'),      "panback1"       },
92   { CTRL('f'),      "panon1"         },
93
94   { '?',            "help"             },
95   { KEY_HELP,       "help"             },
96   { KEY_F(1),       "help"             },
97   { '/',            "search"           },
98   { 'n',            "searchagain"      },
99   { '\\',           "searchagain"      },
100   { CTRL('l'),      "redraw"           },
101
102   { KEY_ENTER,      "select-and-quit"  },
103   { '\r',           "select-and-quit"  },
104   { 'x',            "abort"            },
105   { 'X',            "abort"            },
106   { 'Q',            "abort"            },
107
108   {  -1,            nullptr            }
109 };