mirror of
https://github.com/MidnightCommander/mc
synced 2025-01-01 00:54:24 +03:00
fix: default_input_keymap, remove incorrect entry
fix: parsing keymap string with "backslash" Signed-off-by: Ilia Maslakov <il.smind@google.com>
This commit is contained in:
parent
19bb1938f3
commit
23b81fac46
@ -642,6 +642,47 @@ const global_key_map_t default_main_x_map[] = {
|
||||
{0, 0}
|
||||
};
|
||||
|
||||
const global_key_map_t default_input_keymap[] = {
|
||||
/* Motion */
|
||||
{ XCTRL('a'), CK_InputBol },
|
||||
{ KEY_HOME, CK_InputBol },
|
||||
{ KEY_A1, CK_InputBol },
|
||||
{ ALT ('<'), CK_InputBol },
|
||||
{ XCTRL('e'), CK_InputEol },
|
||||
{ KEY_END, CK_InputEol },
|
||||
{ KEY_C1, CK_InputEol },
|
||||
{ ALT ('>'), CK_InputEol },
|
||||
{ KEY_LEFT, CK_InputMoveLeft },
|
||||
{ KEY_LEFT | KEY_M_CTRL, CK_InputWordLeft },
|
||||
{ KEY_RIGHT, CK_InputMoveRight },
|
||||
{ KEY_RIGHT | KEY_M_CTRL, CK_InputWordRight },
|
||||
|
||||
{ XCTRL('b'), CK_InputBackwardChar },
|
||||
{ ALT('b'), CK_InputBackwardWord },
|
||||
{ XCTRL('f'), CK_InputForwardChar },
|
||||
{ ALT('f'), CK_InputForwardWord },
|
||||
|
||||
/* Editing */
|
||||
{ KEY_BACKSPACE, CK_InputBackwardDelete },
|
||||
{ KEY_DC, CK_InputDeleteChar },
|
||||
{ ALT('d'), CK_InputKillWord },
|
||||
{ ALT(KEY_BACKSPACE), CK_InputBackwardKillWord },
|
||||
|
||||
/* Region manipulation */
|
||||
{ XCTRL('w'), CK_InputKillRegion },
|
||||
{ ALT('w'), CK_InputKillSave },
|
||||
{ XCTRL('y'), CK_InputYank },
|
||||
{ XCTRL('k'), CK_InputKillLine },
|
||||
|
||||
/* History */
|
||||
{ ALT('p'), CK_InputHistoryPrev },
|
||||
{ ALT('n'), CK_InputHistoryNext },
|
||||
{ ALT('h'), CK_InputHistoryShow },
|
||||
|
||||
/* Completion */
|
||||
{ ALT('\t'), CK_InputComplete },
|
||||
{ 0, 0 }
|
||||
};
|
||||
|
||||
|
||||
int lookup_action (char *keyname)
|
||||
|
@ -47,3 +47,4 @@ extern const global_key_map_t default_input_keymap[];
|
||||
extern const global_key_map_t default_main_map[];
|
||||
extern const global_key_map_t default_main_x_map[];
|
||||
|
||||
const global_key_map_t default_input_keymap[];
|
||||
|
@ -130,7 +130,8 @@ key_code_name_t key_name_conv_tab[] = {
|
||||
{ALT ('\t'), "complete", N_("Completion/M-tab")},
|
||||
{KEY_KP_ADD, "kpplus", N_("+ on keypad")},
|
||||
{KEY_KP_SUBTRACT, "kpminus", N_("- on keypad")},
|
||||
{KEY_KP_MULTIPLY, "kpasterix", N_("* on keypad")},
|
||||
{(int) '/', "kpslash", N_("Slash on keypad")},
|
||||
{KEY_KP_MULTIPLY, "kpasterisk", N_("* on keypad")},
|
||||
|
||||
/* From here on, these won't be shown in Learn keys (no space) */
|
||||
{KEY_LEFT, "kpleft", N_("Left arrow keypad")},
|
||||
@ -144,18 +145,19 @@ key_code_name_t key_name_conv_tab[] = {
|
||||
{KEY_IC, "kpinsert", N_("Insert on keypad")},
|
||||
{KEY_DC, "kpdelete", N_("Delete on keypad")},
|
||||
{(int) '\n', "kpenter", N_("Enter on keypad")},
|
||||
{(int) '\n', "enter", N_("Enter on keypad")},
|
||||
{(int) '\t', "tab", N_("Tab on keypad")},
|
||||
{(int) ' ', "space", N_("Space on keypad")},
|
||||
{(int) '/', "kpslash", N_("Slash on keypad")},
|
||||
{(int) '#', "kpnumlock", N_("NumLock on keypad")},
|
||||
|
||||
/* Alternative label */
|
||||
{KEY_BACKSPACE, "backspace", N_("Backspace key")},
|
||||
{KEY_IC, "insert", N_("Insert key")},
|
||||
{KEY_KP_ADD, "plus", N_("+ on keypad")},
|
||||
{KEY_KP_SUBTRACT, "minus", N_("- on keypad")},
|
||||
{KEY_KP_MULTIPLY, "asterix", N_("* on keypad")},
|
||||
{(int) '+', "plus", N_("Plus")},
|
||||
{(int) '-', "minus", N_("Minus")},
|
||||
{(int) '*', "asterisk", N_("Asterisk")},
|
||||
{(int) '\n', "enter", N_("Enter")},
|
||||
{(int) '\t', "tab", N_("Tab key")},
|
||||
{(int) ' ', "space", N_("Space key")},
|
||||
{(int) '/', "slash", N_("Slash key")},
|
||||
{(int) '\\', "backslash", N_("Backslash key")},
|
||||
{(int) '#', "number", N_("Number sign #")},
|
||||
|
||||
/* meta keys */
|
||||
{KEY_M_CTRL, "control", N_("Ctrl")},
|
||||
|
43
src/widget.c
43
src/widget.c
@ -61,49 +61,6 @@
|
||||
|
||||
const global_key_map_t *input_map;
|
||||
|
||||
const global_key_map_t default_input_keymap[] = {
|
||||
/* Motion */
|
||||
{ XCTRL('a'), CK_InputBol },
|
||||
{ KEY_HOME, CK_InputBol },
|
||||
{ KEY_A1, CK_InputBol },
|
||||
{ ALT ('<'), CK_InputBol },
|
||||
{ XCTRL('e'), CK_InputEol },
|
||||
{ KEY_END, CK_InputEol },
|
||||
{ KEY_C1, CK_InputEol },
|
||||
{ ALT ('>'), CK_InputEol },
|
||||
{ KEY_LEFT, CK_InputMoveLeft },
|
||||
{ KEY_LEFT | KEY_M_CTRL, CK_InputWordLeft },
|
||||
{ KEY_RIGHT, CK_InputMoveRight },
|
||||
{ KEY_RIGHT | KEY_M_CTRL, CK_InputWordRight },
|
||||
|
||||
{ XCTRL('b'), CK_InputBackwardChar },
|
||||
{ ALT('b'), CK_InputBackwardWord },
|
||||
{ XCTRL('f'), CK_InputForwardChar },
|
||||
{ ALT('f'), CK_InputForwardWord },
|
||||
|
||||
/* Editing */
|
||||
{ KEY_BACKSPACE, CK_InputBackwardDelete },
|
||||
{ KEY_DC, CK_InputDeleteChar },
|
||||
{ ALT('d'), CK_InputKillWord },
|
||||
{ ALT(KEY_BACKSPACE), CK_InputBackwardKillWord },
|
||||
|
||||
/* Region manipulation */
|
||||
{ 0, CK_InputSetMark },
|
||||
{ XCTRL('w'), CK_InputKillRegion },
|
||||
{ ALT('w'), CK_InputKillSave },
|
||||
{ XCTRL('y'), CK_InputYank },
|
||||
{ XCTRL('k'), CK_InputKillLine },
|
||||
|
||||
/* History */
|
||||
{ ALT('p'), CK_InputHistoryPrev },
|
||||
{ ALT('n'), CK_InputHistoryNext },
|
||||
{ ALT('h'), CK_InputHistoryShow },
|
||||
|
||||
/* Completion */
|
||||
{ ALT('\t'), CK_InputComplete },
|
||||
{ 0, 0 }
|
||||
};
|
||||
|
||||
static void
|
||||
widget_selectcolor (Widget *w, gboolean focused, gboolean hotkey)
|
||||
{
|
||||
|
Loading…
Reference in New Issue
Block a user