tweaks: make a few more direct returns, and reshuffle another bit of code

master
Benno Schulenberg 2020-08-05 11:03:35 +02:00
parent 4c6b6cad99
commit 4c63ef204d
1 changed files with 14 additions and 13 deletions

View File

@ -967,10 +967,10 @@ int parse_kbinput(WINDOW *win)
case 'C': return CONTROL_RIGHT; case 'C': return CONTROL_RIGHT;
case 'D': return CONTROL_LEFT; case 'D': return CONTROL_LEFT;
#ifndef NANO_TINY #ifndef NANO_TINY
case 'a': keycode = shiftaltup; break; case 'a': shift_held = TRUE; return KEY_PPAGE;
case 'b': keycode = shiftaltdown; break; case 'b': shift_held = TRUE; return KEY_NPAGE;
case 'c': keycode = shiftaltright; break; case 'c': shift_held = TRUE; return KEY_HOME;
case 'd': keycode = shiftaltleft; break; case 'd': shift_held = TRUE; return KEY_END;
#endif #endif
} }
} else if (key_buffer_len > 0 && *key_buffer != ESC_CODE && } else if (key_buffer_len > 0 && *key_buffer != ESC_CODE &&
@ -1004,16 +1004,17 @@ int parse_kbinput(WINDOW *win)
keycode = byte; keycode = byte;
else else
return byte; return byte;
} else if (digit_count > 0) { } else if (digit_count == 0) {
/* A non-digit in the middle of a byte sequence... */ /* If the second escape did not arrive alone, it is a Meta
; * keystroke; otherwise, it is an "Esc Esc control". */
} else if (!solitary) { if (!solitary) {
if (!shifted_metas) if (!shifted_metas)
keycode = tolower(keycode); keycode = tolower(keycode);
meta_key = TRUE; meta_key = TRUE;
} else } else
keycode = convert_to_control(keycode); keycode = convert_to_control(keycode);
} }
}
if (keycode == controlleft) if (keycode == controlleft)
return CONTROL_LEFT; return CONTROL_LEFT;