int get_escape_seq_kbinput(const int *seq, size_t seq_len, bool
*ignore_seq);
int get_escape_seq_abcd(int kbinput);
-int parse_escape_seq_kbinput(int kbinput);
+int parse_escape_seq_kbinput(int kbinput, bool *ignore_seq);
int get_byte_kbinput(int kbinput);
#ifdef ENABLE_UTF8
long add_unicode_digit(int kbinput, long factor, long *uni);
if (get_key_buffer_len() == 0) {
*meta_key = TRUE;
retval = tolower(*kbinput);
- } else
- retval = parse_escape_seq_kbinput(*kbinput);
+ } else {
+ bool ignore_seq;
+
+ retval = parse_escape_seq_kbinput(*kbinput,
+ &ignore_seq);
+
+ /* If the escape sequence is unrecognized and
+ * not ignored, throw it out. */
+ if (retval == ERR && *ignore_seq == FALSE) {
+ if (win == edit)
+ statusbar(_("Unknown Command"));
+ beep();
+ }
+ }
break;
case 2:
/* Two escapes followed by one or more decimal
}
/* Interpret the escape sequence in the keystroke buffer, the first
- * character of which is kbinput. Assume that the keystroke buffer
- * isn't empty, and that the initial escape has already been read in. */
-int parse_escape_seq_kbinput(int kbinput)
+ * character of which is kbinput. If we want to ignore the escape
+ * sequence, set retval to ERR and ignore_seq to TRUE. Assume that the
+ * keystroke buffer isn't empty, and that the initial escape has already
+ * been read in. */
+int parse_escape_seq_kbinput(int kbinput, bool *ignore_seq)
{
int retval, *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
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"));
- beep();
- }
+ retval = get_escape_seq_kbinput(seq, seq_len, ignore_seq);
free(seq);
#ifdef DEBUG
- fprintf(stderr, "parse_escape_seq_kbinput(): kbinput = %d, seq_len = %lu, ignore_seq = %d, retval = %d\n", kbinput, (unsigned long)seq_len, (int)ignore_seq, retval);
+ fprintf(stderr, "parse_escape_seq_kbinput(): kbinput = %d, ignore_seq = %d, seq_len = %lu, retval = %d\n", kbinput, (int)ignore_seq, (unsigned long)seq_len, retval);
#endif
return retval;