mirror of
git://git.sv.gnu.org/nano.git
synced 2025-03-30 13:23:20 +03:00
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:
parent
89760cd6ec
commit
77826c2b06
@ -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));
|
||||||
|
|
||||||
|
@ -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? */
|
||||||
|
Loading…
x
Reference in New Issue
Block a user