diff --git a/ChangeLog b/ChangeLog
index a5e42347581dfa1f1b1fc2ff0d2c7be031826c0f..208a43195311cac6f500811d08db840c00da37b3 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -3,6 +3,10 @@ CVS code -
 	- Better integration of View mode (-v) and multibuffer.
 	  Fixes to new_file(), do_insertfile_void(), shortcut_init()
 	  (David Lawrence Ramsey).
+	- The keypad handling has changed (again).  We now use 
+	  the keypad() function by default.  New flag -K, --keypad
+	  allows the old behavior for those using the keypad arrow keys
+	  and rxvt-based terminals.
 - nano.c:
   die()
 	- Only save files that were modified (David Lawrence Ramsey).
diff --git a/nano.1 b/nano.1
index a67f6a9dd6d0fffff421dead72d135da46239b7c..e2b79666f7c7b004b0e86a49308f02269985877b 100644
--- a/nano.1
+++ b/nano.1
@@ -37,6 +37,11 @@ Write file in DOS format.
 .B \-F (\-\-multibuffer)
 Enable multiple file buffers (if available).
 .TP
+.B \-K (\-\-keypad)
+Do not use the ncurses keypad() call unless necessary.  Try this flag if 
+you find that the arrow keys on the numeric keypad do not work for you 
+under nano.
+.TP
 .B \-M (\-\-mac)
 Write file in Mac format.
 .TP
diff --git a/nano.c b/nano.c
index 06eb5dfcc9374f94dea26ea2c91d084f4ea8e18d..2da1085096d065022daa137ac2ee1f4b545bd7bb 100644
--- a/nano.c
+++ b/nano.c
@@ -419,6 +419,8 @@ void usage(void)
 	(_
 	 (" -F 		--multibuffer		Enable multiple file buffers\n"));
 #endif
+    printf(_
+	 (" -K 		--keypad		Use alternate keypad routines\n"));
 #ifndef NANO_SMALL
     printf
 	(_
@@ -493,14 +495,15 @@ void usage(void)
 #ifdef ENABLE_MULTIBUFFER
     printf(_(" -F 		Enable multiple file buffers\n"));
 #endif
+    printf(_(" -K		Use alternate keypad routines\n\n"));
 #ifndef NANO_SMALL
     printf(_(" -M 		Write file in Mac format\n"));
 #endif
-    printf(_(" -T [num]	Set width of a tab to num\n"));
     printf(_(" -R		Use regular expressions for search\n"));
 #ifndef NANO_SMALL
     printf(_(" -S		Smooth scrolling\n"));
 #endif
+    printf(_(" -T [num]	Set width of a tab to num\n"));
     printf(_(" -V 		Print version information and exit\n"));
     printf(_(" -c 		Constantly show cursor position\n"));
     printf(_(" -h 		Show this message\n"));
@@ -2710,6 +2713,8 @@ int main(int argc, char *argv[])
 #ifndef NANO_SMALL
 	{"smooth", 0, 0, 'S'},
 #endif
+	{"keypad", 0, 0, 'K'},
+
 	{0, 0, 0, 0}
     };
 #endif
@@ -2730,11 +2735,11 @@ int main(int argc, char *argv[])
 #endif /* ENABLE_NANORC */
 
 #ifdef HAVE_GETOPT_LONG
-    while ((optchr = getopt_long(argc, argv, "h?DFMRST:Vabcefgijklmo:pr:s:tvwxz",
+    while ((optchr = getopt_long(argc, argv, "h?DFKMRST:Vabcefgijklmo:pr:s:tvwxz",
 				 long_options, &option_index)) != EOF) {
 #else
     while ((optchr =
-	    getopt(argc, argv, "h?DFMRST:Vabcefgijklmo:pr:s:tvwxz")) != EOF) {
+	    getopt(argc, argv, "h?DFKMRST:Vabcefgijklmo:pr:s:tvwxz")) != EOF) {
 #endif
 
 	switch (optchr) {
@@ -2749,6 +2754,9 @@ int main(int argc, char *argv[])
 	    SET(MULTIBUFFER);
 	    break;
 #endif
+	case 'K':
+	    SET(ALT_KEYPAD);
+	    break;
 #ifndef NANO_SMALL
 	case 'M':
 	    SET(MAC_FILE);
@@ -2926,6 +2934,11 @@ int main(int argc, char *argv[])
     window_init();
     mouse_init();
 
+    if (!ISSET(ALT_KEYPAD)) {
+	keypad(edit, TRUE);
+	keypad(bottomwin, TRUE);
+    }
+
 #ifdef ENABLE_COLOR
     do_colorinit();
 
diff --git a/nano.h b/nano.h
index 7b4bb2a5058187774e9a6daa1416991f97c0def1..709fa0f3c35cd96223f82921fca1eebb0ec225c8 100644
--- a/nano.h
+++ b/nano.h
@@ -165,6 +165,7 @@ typedef struct colortype {
 #define MAC_FILE		(1<<22)
 #define SMOOTHSCROLL		(1<<23)
 #define DISABLE_CURPOS		(1<<24)	/* Damn, we still need it */
+#define ALT_KEYPAD		(1<<25)	/* Damn, we still need it */
 
 /* Control key sequences, changing these would be very very bad */
 
diff --git a/rcfile.c b/rcfile.c
index 29ed11539a9f59e5f059a890b5072d336b185720..2655777f69bc09d9fef907c5e252d20771862458 100644
--- a/rcfile.c
+++ b/rcfile.c
@@ -40,9 +40,9 @@
 #endif
 
 #ifndef DISABLE_WRAPJUSTIFY
-    #define NUM_RCOPTS 18
+    #define NUM_RCOPTS 19
 #else
-    #define NUM_RCOPTS 17
+    #define NUM_RCOPTS 18
 #endif
 
 /* Static stuff for the nanorc file */
@@ -69,7 +69,8 @@ rcoption rcopts[NUM_RCOPTS] =
 {"nohelp", NO_HELP}, 
 {"suspend", SUSPEND},
 {"multibuffer", MULTIBUFFER},
-{"smooth", SMOOTHSCROLL}};
+{"smooth", SMOOTHSCROLL},
+{"keypad", ALT_KEYPAD}};
 
 /* We have an error in some part of the rcfile; put it on stderr and
   make the user hit return to continue starting up nano */