diff --git a/ChangeLog b/ChangeLog index feb4c889dc8932157095fafa6a543eca8f7ece95..6b269db4f088baa93224c8bd6b02f590bca20614 100644 --- a/ChangeLog +++ b/ChangeLog @@ -6,6 +6,9 @@ General - Previous change to #ifdefs DISABLE_TABCOMP and NANO_SMALL rolled back. (Rocco) - Various #ifdef & #ifndef cleanups. (Rocco) + - Added message for when keypad goes awry. Added code in main and + function print_numlock_warning() to notify user, and added an + apropriate section in the faq to refer to this brokenness. - configure.in: - Fix for _use_keypad check breaking slang support (Christian Weisgerber). @@ -14,6 +17,7 @@ General - faq.html: - Added some info on making the binary smaller with the configure script. + - Added section on keypad bugginess. - files.c: real_dir_from_tilde() - Oops, fix case where buf ="~", silly crash (bug discovered by diff --git a/faq.html b/faq.html index af02eb8d653c81c7d371642138f2cfea85ea5ef0..4e96418f1ce121ad2545e0fcd85fc9adff4a3831 100644 --- a/faq.html +++ b/faq.html @@ -1,5 +1,6 @@ <!doctype html public "-//w3c//dtd html 4.0 transitional//en"> <html> +<title>The nano editor FAQ</title> <head> <meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1"> <meta name="GENERATOR" content="Mozilla/4.73 [en] (X11; U; Linux 2.2.16 i586) [Netscape]"> @@ -66,8 +67,11 @@ my window. How can I fix that?</a></font> <br><font color="#330000"><a href="#4.5">4.5. When I type in a search string, the string I last searched for is already in front of my cursor! !What happened?!</a></font> -<br><a href="#4.6">4.6 How do I make nano my default editor (in Pine, -mutt, etc.)?</a></blockquote> +<br><font color="#330000"><a href="#4.6">4.6. I get the message "NumLock +glitch detected. Keypad will malfunction without NumLock on." What +gives?</a></font> +<br><font color="#330000"><a href="#4.7">4.7. How do I make nano my +default editor (in Pine, mutt, etc.)?</a></font></blockquote> <h2> <font color="#330000"><a href="#5">5. Internationalization</a></font></h2> @@ -422,7 +426,26 @@ Meta-P while in nano (see the ^G help text for more details).</font></blockquote> <h2> -<a NAME="4.6"></a>4.6. How do I make nano my default editor (in Pine, +<a NAME="4.6"></a>I get the message "NumLock glitch detected. Keypad +will malfunction without NumLock on." What gives?</h2> + +<blockquote> +Nano (actually almost all console editors do) has issues when cycling +the NumLock key in certain X terminals (rxvt, aterm, wterm, etc...). When +you switch NumLock on to off, you put the terminal into an "application +mode" that changes what sequences are sent by the keypad. These sequences +vary sufficiently from terminal to terminal that it is nearly impossible +to work around them from within nano. +<br><br> +In a nutshell, if you want to be able to use the keypad with the arrow and +page up/down functionality, you have to exit nano and reset your terminal +(presumably with "reset" or "stty sane" or similar) and then run nano +again with NumLock off. If you know an easier way to restore "normal +mode", please mail <A href="nano@nano-editor.org">nano@nano-editor.org</A>. +<br> </blockquote> + +<h2> +<a NAME="4.7"></a>4.7. How do I make nano my default editor (in Pine, mutt, etc)?</h2> <blockquote>You need to make nano your $EDITOR. If you want this diff --git a/nano.c b/nano.c index 7b3dcdfc3cb63a1b32e5565b2b26300228cccebb..d859148e589129943350575da5a39f46c3cc40be 100644 --- a/nano.c +++ b/nano.c @@ -2028,6 +2028,17 @@ void do_toggle(int which) #endif } +/* If the NumLock key has made the keypad gone awry, print an error + message, hopefully we can address it later. */ +void print_numlock_warning(void) +{ + static int didmsg = 0; + if (!didmsg) { + statusbar(_("NumLock glitch detected. Keypad will malfunction without NumLock on")); + didmsg = 1; + } +} + /* This function returns the correct keystroke, given the A,B,C or D input key. This is a common sequence of many terms which send Esc-O-[A-D] or Esc-[-[A-D]. */ @@ -2297,7 +2308,9 @@ int main(int argc, char *argv[]) kbinput = wgetch(edit); if (kbinput <= 'D' && kbinput >= 'A') kbinput = ABCD(kbinput); - if (kbinput <= 'S' && kbinput >= 'P') + else if (kbinput <= 'z' && kbinput >= 'j') + print_numlock_warning(); + else if (kbinput <= 'S' && kbinput >= 'P') kbinput = KEY_F(kbinput - 79); #ifdef DEBUG else {