From 106c1bf3d102d0140db680ee76b7d5eb79e0c2ec Mon Sep 17 00:00:00 2001 From: David Lawrence Ramsey Date: Sat, 3 Jun 2006 19:36:02 +0000 Subject: [PATCH] beep when we get an unhandled shortcut or toggle, as Pico does git-svn-id: svn://svn.savannah.gnu.org/nano/trunk/nano@3616 35c25a1d-7b9e-4130-9fde-d3aeb78583b8 --- ChangeLog | 4 ++-- src/nano.c | 1 + src/prompt.c | 1 + src/winio.c | 4 +++- 4 files changed, 7 insertions(+), 3 deletions(-) diff --git a/ChangeLog b/ChangeLog index 0c7f5d69..b476f610 100644 --- a/ChangeLog +++ b/ChangeLog @@ -98,8 +98,8 @@ CVS code - do_scroll_down(), do_input(), do_search(), do_research(), and do_delete(). (DLR) - 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 + sequences, indicate it on the statusbar, and beep 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(), diff --git a/src/nano.c b/src/nano.c index 1d7ed8ef..72cd6924 100644 --- a/src/nano.c +++ b/src/nano.c @@ -1311,6 +1311,7 @@ int do_input(bool *meta_key, bool *func_key, bool *s_or_t, bool if (is_ascii_cntrl_char(input) || *meta_key == TRUE || *func_key == TRUE) { statusbar(_("Unknown Command")); + beep(); *meta_key = FALSE; *func_key = FALSE; input = ERR; diff --git a/src/prompt.c b/src/prompt.c index f75f2b88..3fcc180e 100644 --- a/src/prompt.c +++ b/src/prompt.c @@ -111,6 +111,7 @@ int do_statusbar_input(bool *meta_key, bool *func_key, bool *s_or_t, if (*s_or_t == FALSE) { if (is_ascii_cntrl_char(input) || *meta_key == TRUE || *func_key == TRUE) { + beep(); *meta_key = FALSE; *func_key = FALSE; input = ERR; diff --git a/src/winio.c b/src/winio.c index 8fc99d6f..8c500635 100644 --- a/src/winio.c +++ b/src/winio.c @@ -1158,8 +1158,10 @@ int parse_escape_seq_kbinput(int kbinput) /* If the escape sequence is unrecognized and not ignored, throw it * out, and indicate this on the statusbar. */ - if (retval == ERR && !ignore_seq) + if (retval == ERR && !ignore_seq) { statusbar(_("Unknown Command")); + beep(); + } free(seq); -- 2.39.5