diff --git a/src/browser.c b/src/browser.c
index c39ac3431ddb75915468416e32839c21c661e35c..814753f7f00012ab1d2f29317e714af5ce0aab7b 100644
--- a/src/browser.c
+++ b/src/browser.c
@@ -147,7 +147,7 @@ char *do_browser(char *path)
 		/* If we selected the same filename as last time, fake a
 		 * press of the Enter key so that the file is read in. */
 		if (old_selected == selected)
-		    unget_kbinput(the_code_for(do_enter, 0), FALSE);
+		    unget_kbinput(KEY_ENTER, FALSE);
 	    }
 
 	    continue;
diff --git a/src/prompt.c b/src/prompt.c
index 7dbb89dd910f066291fb93959407c3c27a95132d..5e0cce2fcf137fbe6984bccf63be03930d7d9c70 100644
--- a/src/prompt.c
+++ b/src/prompt.c
@@ -148,7 +148,7 @@ int do_statusbar_input(bool *ran_func, bool *finished)
 	     * fake a press of Enter, and indicate that we're done. */
 	    if (got_newline) {
 		get_input(NULL, 1);
-		input = the_code_for(do_enter, 0);
+		input = KEY_ENTER;
 		*finished = TRUE;
 	    }
 	} else if (s->scfunc == do_cut_text_void)