do_page_down(), do_up(), do_scroll_up(), do_down(),
do_scroll_down(), do_input(), do_search(), do_research(), and
do_delete(). (DLR)
+ - Ignore unhandled meta key sequences and escape sequences, and
+ indicate it on the statusbar when we get an unhandled shortcut
+ or toggle, as Pico does. New function is_ascii_cntrl_char();
+ changes to do_input(), do_statusbar_input(), and
+ parse_kbinput(). (DLR, suggested by Nick Warne and Benno
+ Schulenberg)
- browser.c:
do_browser()
- Reference NANO_GOTODIR_(ALT|F)?KEY instead of
return isblank((unsigned char)*c);
}
+/* This function is equivalent to iscntrl(), except in that it only
+ * handles non-high-bit control characters. */
+bool is_ascii_cntrl_char(int c)
+{
+ return (0 <= c && c < 32);
+}
+
/* This function is equivalent to iscntrl(), except in that it also
* handles high-bit control characters. */
bool is_cntrl_char(int c)
#endif
);
+ /* If we got a non-high-bit control key or a Meta key sequence, and
+ * it's not a shortcut or toggle, ignore it, and indicate this on
+ * the statusbar. */
+ if (*s_or_t == FALSE) {
+ if (is_ascii_cntrl_char(input) || *meta_key == TRUE) {
+ input = ERR;
+ *meta_key = FALSE;
+ statusbar(_("Unknown Command"));
+ }
+ }
+
if (allow_funcs) {
/* If we got a character, and it isn't a shortcut or toggle,
* it's a normal text character. Display the warning if we're
/* Set s_or_t to TRUE if we got a shortcut. */
*s_or_t = have_shortcut;
+ /* If we got a non-high-bit control key or a Meta key sequence, and
+ * it's not a shortcut or toggle, ignore it. */
+ if (*s_or_t == FALSE) {
+ if (is_ascii_cntrl_char(input) || *meta_key == TRUE) {
+ input = ERR;
+ *meta_key = FALSE;
+ }
+ }
+
if (allow_funcs) {
/* If we got a character, and it isn't a shortcut or toggle,
* it's a normal text character. Display the warning if we're
bool is_byte(int c);
bool is_alnum_mbchar(const char *c);
bool is_blank_mbchar(const char *c);
+bool is_ascii_cntrl_char(int c);
bool is_cntrl_char(int c);
#ifdef ENABLE_UTF8
bool is_cntrl_wchar(wchar_t wc);
&ignore_seq);
/* If the escape sequence is unrecognized and
- * not ignored, put back all of its characters
- * except for the initial escape. */
+ * not ignored, indicate this on the
+ * statusbar. */
if (retval == ERR && !ignore_seq)
- unget_input(seq, seq_len);
+ statusbar(_("Unknown Command"));
free(seq);
}