diff --git a/src/nano.c b/src/nano.c
index 25601058c8f3f8c5286b86dbe7b63eb71414fcc2..b82245a531d8fe3f8242c4496a63e8e28e4d8804 100644
--- a/src/nano.c
+++ b/src/nano.c
@@ -1288,7 +1288,7 @@ RETSIGTYPE do_continue(int signal)
     terminal_init();
 #endif
     /* Tickle the input routine so it will update the screen. */
-    ungetch(KEY_F0);
+    ungetch(KEY_FLUSH);
 }
 
 #ifndef NANO_TINY
diff --git a/src/nano.h b/src/nano.h
index 2c1aef2a94c9443a0738892a19a5f72944c4b9c1..c6ea016d1c9cbad96be38b176c120b3f6408577f 100644
--- a/src/nano.h
+++ b/src/nano.h
@@ -576,6 +576,15 @@ enum
 #define SHIFT_HOME 0x40f
 #define SHIFT_END 0x410
 
+#ifdef USE_SLANG
+#ifdef ENABLE_UTF8
+#define KEY_BAD 0xFF  /* Clipped error code. */
+#endif
+#define KEY_FLUSH 0x91  /* User-definable control code. */
+#else
+#define KEY_FLUSH KEY_F0  /* Nonexistent function key. */
+#endif
+
 #ifndef NANO_TINY
 /* An imaginary key for when we get a SIGWINCH (window resize). */
 #define KEY_WINCH -2
diff --git a/src/winio.c b/src/winio.c
index fc058ac0b0e4cb7d6be2dee498fcfd832b6ab15c..d9bde4265c97d4707f429a432a60042f969f1804 100644
--- a/src/winio.c
+++ b/src/winio.c
@@ -704,7 +704,10 @@ int parse_kbinput(WINDOW *win)
 	/* Slang and SunOS 5.7-5.9 don't support KEY_RESIZE. */
 	case KEY_RESIZE:
 #endif
-	case KEY_F0:
+#if defined(USE_SLANG) && defined(ENABLE_UTF8)
+	case KEY_BAD:
+#endif
+	case KEY_FLUSH:
 	    return ERR;
     }