matches inside a line (e.g. replace the "b" in "abc" with
anything). (David Benbennick)
- winio.c:
+ get_verbatim_kbinput()
+ - Set keypad() to FALSE while reading input, and set it back to
+ TRUE afterwards. This ensures that we don't end up reading in
+ extended keypad values that are outside the ASCII range.
+ (Also, with keypad() set to TRUE, xterm generates
+ KEY_BACKSPACE when the user hits Ctrl-H, which, when cut down
+ to ASCII range, ends up being Ctrl-G, which can be confusing.)
+ (DLR)
get_accepted_kbinput()
- Don't use "kbinput = wgetch(win)" as a switch value. (DLR)
get_escape_seq_kbinput()
topwin = newwin(2, COLS, 0, 0);
bottomwin = newwin(3 - no_help(), COLS, LINES - 3 + no_help(), 0);
- /* This is so the keypad still works after a Meta-X, for example. */
+ /* Turn the keypad on, so that it still works after a Meta-X, for
+ * example. */
keypad(edit, TRUE);
keypad(bottomwin, TRUE);
}
mouse_init();
#endif
+ /* Turn the keypad on */
keypad(edit, TRUE);
keypad(bottomwin, TRUE);
int allow_ascii)
{
char *verbatim_kbinput;
- int kbinput = wgetch(win);
+ int kbinput;
+
+ /* Turn the keypad off so that we don't get extended keypad values,
+ * all of which are outside the ASCII range. */
+ keypad(win, FALSE);
+ kbinput = wgetch(win);
verbatim_kbinput = charalloc(1);
verbatim_kbinput[0] = kbinput;
*kbinput_len = 1;
nodelay(win, FALSE);
}
+ /* Turn the keypad back on now that we're done. */
+ keypad(win, TRUE);
+
#ifdef DEBUG
fprintf(stderr, "get_verbatim_kbinput(): verbatim_kbinput = %s\n", verbatim_kbinput);
#endif
return retval;
}
-/* Translate escape sequences for extended keypad values. These are
- * generated when the terminal doesn't support the needed keys. Assume
- * that Escape has already been read in, and that nodelay(win) is TRUE.
+/* Translate escape sequences, most of which correspond to extended
+ * keypad values. These sequences are generated when the terminal
+ * doesn't support the needed keys. Assume that Escape has already been
+ * read in, and that nodelay(win) is TRUE.
*
* The supported terminals are the Linux console, the FreeBSD console,
* the Hurd console (a.k.a. the Mach console), xterm, rxvt, and Eterm.