tweaks: stop setting and requiring the Meta flag for special keycodes

Set the Meta flag only for the regular Meta keystrokes: "M-" plus a
printable ASCII character.  The special keycodes are unique and do
not need any extra flags to differentiate them.
This commit is contained in:
Benno Schulenberg 2018-11-04 20:24:34 +01:00
parent 89760cd6ec
commit 77826c2b06
2 changed files with 4 additions and 7 deletions

View File

@ -462,7 +462,7 @@ functionptrtype func_from_key(int *kbinput)
void assign_keyinfo(sc *s, const char *keystring, const int keycode) void assign_keyinfo(sc *s, const char *keystring, const int keycode)
{ {
s->keystr = keystring; s->keystr = keystring;
s->meta = (keystring[0] == 'M' && keystring[2] != '\xE2'); s->meta = (keystring[0] == 'M' && keycode == 0);
assert(strlen(keystring) > 1 && (!s->meta || strlen(keystring) > 2)); assert(strlen(keystring) > 1 && (!s->meta || strlen(keystring) > 2));

View File

@ -576,10 +576,9 @@ int parse_kbinput(WINDOW *win)
return ALT_UP; return ALT_UP;
else if (retval == altdown) else if (retval == altdown)
return ALT_DOWN; return ALT_DOWN;
else if (retval == altdelete) { else if (retval == altdelete)
meta_key = TRUE;
return ALT_DELETE; return ALT_DELETE;
} else if (retval == shiftaltleft) { else if (retval == shiftaltleft) {
shift_held = TRUE; shift_held = TRUE;
return KEY_HOME; return KEY_HOME;
} else if (retval == shiftaltright) { } else if (retval == shiftaltright) {
@ -613,10 +612,8 @@ int parse_kbinput(WINDOW *win)
if (retval == KEY_DC) { if (retval == KEY_DC) {
if ((modifiers & 0x05) == 0x05) if ((modifiers & 0x05) == 0x05)
return CONTROL_SHIFT_DELETE; return CONTROL_SHIFT_DELETE;
if (modifiers == 0x08) { if (modifiers == 0x08)
meta_key = TRUE;
return ALT_DELETE; return ALT_DELETE;
}
} }
#endif #endif
/* Is Ctrl being held? */ /* Is Ctrl being held? */