tweaks: condense a comment, add two small ones, and reshuffle a line

(Apart from reducing the verbosity of the long comment, also harmonize
its format: mentioning the FreeBSD key always first.)
This commit is contained in:
Benno Schulenberg 2022-09-22 10:45:56 +02:00
parent c7a600063d
commit 7eb66d3e09

View File

@ -160,22 +160,17 @@ void run_macro(void)
* We support escape sequences for ANSI, VT100, VT220, VT320, the Linux * We support escape sequences for ANSI, VT100, VT220, VT320, the Linux
* console, the FreeBSD console, the Mach console, xterm, and Terminal, * console, the FreeBSD console, the Mach console, xterm, and Terminal,
* and some for Konsole, rxvt, Eterm, and iTerm2. Among these sequences, * and some for Konsole, rxvt, Eterm, and iTerm2. Among these sequences,
* there are several conflicts and omissions: * there are some conflicts:
* *
* - Tab on ANSI == PageUp on FreeBSD console; the former is omitted. * - PageUp on FreeBSD console == Tab on ANSI; the latter is omitted.
* (Ctrl-I is also Tab on ANSI, which we already support.) * (Ctrl-I is also Tab on ANSI, which we already support.)
* - PageDown on FreeBSD console == Center (5) on numeric keypad with * - PageDown on FreeBSD console == Center (5) on numeric keypad with
* NumLock off on Linux console; the latter is omitted. (The editing * NumLock off on Linux console; the latter is useless and omitted.
* keypad key is more important to have working than the numeric * - F1 on FreeBSD console == the mouse sequence on xterm/rxvt/Eterm;
* keypad key, because the latter has no value when NumLock is off.) * the latter is omitted. (Mouse input works only when KEY_MOUSE
* - F1 on FreeBSD console == the mouse key on xterm/rxvt/Eterm; the * is generated on mouse events, not with the raw escape sequence.)
* latter is omitted. (Mouse input will only work properly if the
* extended keypad value KEY_MOUSE is generated on mouse events
* instead of the escape sequence.)
* - F9 on FreeBSD console == PageDown on Mach console; the former is * - F9 on FreeBSD console == PageDown on Mach console; the former is
* omitted. (The editing keypad is more important to have working * omitted. (Moving the cursor is more important than a function key.)
* than the function keys, because the functions of the former are
* not arbitrary and the functions of the latter are.)
* - F10 on FreeBSD console == PageUp on Mach console; the former is * - F10 on FreeBSD console == PageUp on Mach console; the former is
* omitted. (Same as above.) */ * omitted. (Same as above.) */
@ -202,6 +197,7 @@ void read_keys_from(WINDOW *frame)
lastmessage != INFO) || spotlighted)) { lastmessage != INFO) || spotlighted)) {
timed = TRUE; timed = TRUE;
halfdelay(ISSET(QUICK_BLANK) ? 8 : 15); halfdelay(ISSET(QUICK_BLANK) ? 8 : 15);
/* Counteract a side effect of half-delay mode. */
disable_kb_interrupt(); disable_kb_interrupt();
} }
#endif #endif
@ -218,6 +214,7 @@ void read_keys_from(WINDOW *frame)
if (timed) { if (timed) {
timed = FALSE; timed = FALSE;
/* Leave half-delay mode. */
raw(); raw();
if (input == ERR) { if (input == ERR) {
@ -251,8 +248,9 @@ void read_keys_from(WINDOW *frame)
/* Initiate the keystroke buffer, and save the keycode in it. */ /* Initiate the keystroke buffer, and save the keycode in it. */
key_buffer = nrealloc(key_buffer, sizeof(int)); key_buffer = nrealloc(key_buffer, sizeof(int));
nextcodes = key_buffer;
key_buffer[0] = input; key_buffer[0] = input;
nextcodes = key_buffer;
waiting_codes = 1; waiting_codes = 1;
#ifndef NANO_TINY #ifndef NANO_TINY