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. To get this to work properly, add a
- shortcut for moving to the next search/replace string. New
- function is_ascii_cntrl_char(); changes to shortcut_init(),
- do_input(), do_statusbar_input(), get_prompt_string(), and
- parse_kbinput(). (DLR, suggested by Nick Warne and Benno
- Schulenberg)
+ - Ignore unhandled meta key sequences, function keys, and escape
+ sequences, and indicate it on the statusbar when we get an
+ unhandled shortcut or toggle, as Pico does. To get this to
+ work properly, add a shortcut for moving to the next
+ search/replace string. New function is_ascii_cntrl_char();
+ changes to shortcut_init(), do_input(), do_statusbar_input(),
+ get_prompt_string(), and parse_kbinput(). (DLR, suggested by
+ Nick Warne and Benno Schulenberg)
- Explain the mouse support in more detail, and sync the text of
its description across all documentation. Changes to nano.1,
nanorc.5, nanorc.sample, and nano.texi. (Benno Schulenberg and
parse_kbinput()
- If we get NANO_CONTROL_8, properly handle it in all cases.
(DLR)
+ - If we get Escape followed by an escape sequence, interpret the
+ escape sequence for consistency. (DLR)
get_control_kbinput()
- Add Ctrl-/ as an alias for Ctrl-_. (DLR, found by Benno
Schulenberg)
#endif
);
- /* If we got a non-high-bit control key or a meta key sequence, and
- * it's not a shortcut or toggle, throw it out. */
+ /* If we got a non-high-bit control key, a meta key sequence, or a
+ * function key, and it's not a shortcut or toggle, throw it out. */
if (*s_or_t == FALSE) {
- if (is_ascii_cntrl_char(input) || *meta_key == TRUE) {
+ if (is_ascii_cntrl_char(input) || *meta_key == TRUE ||
+ *func_key == TRUE) {
statusbar(_("Unknown Command"));
if (*meta_key == TRUE)
*meta_key = FALSE;
/* 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, throw it out. */
+ /* If we got a non-high-bit control key, a meta key sequence, or a
+ * function key, and it's not a shortcut or toggle, throw it out. */
if (*s_or_t == FALSE) {
- if (is_ascii_cntrl_char(input) || *meta_key == TRUE) {
+ if (is_ascii_cntrl_char(input) || *meta_key == TRUE ||
+ *func_key == TRUE) {
if (*meta_key == TRUE)
*meta_key = FALSE;
input = ERR;
free(byte_mb);
free(seq);
}
- } else {
+ /* Two escapes followed by one or more non-decimal
+ * digits: control character sequence mode,
+ * interrupted byte sequence mode, or escape
+ * sequence mode. If there aren't any other keys
+ * waiting, we have either a control character
+ * sequence or an interrupted byte sequence. If
+ * there are other keys waiting, we have a true
+ * escape sequence preceded by an extra escape, so
+ * interpret it. */
+ } else if (get_key_buffer_len() == 0) {
/* Reset the escape counter. */
escapes = 0;
if (byte_digits == 0)
byte_digits = 0;
retval = *kbinput;
}
+ } else {
+ int *seq;
+ size_t seq_len;
+ bool ignore_seq;
+
+ /* Put back the non-escape character, get the
+ * complete escape sequence, translate the
+ * sequence into its corresponding key value,
+ * and save that as the result. */
+ unget_input(kbinput, 1);
+ seq_len = get_key_buffer_len();
+ seq = get_input(NULL, seq_len);
+ retval = get_escape_seq_kbinput(seq, seq_len,
+ &ignore_seq);
+
+ /* If the escape sequence is unrecognized and
+ * not ignored, throw it out, and indicate this
+ * on the statusbar. */
+ if (retval == ERR && !ignore_seq)
+ statusbar(_("Unknown Command"));
+
+ free(seq);
}
break;
}