diff --git a/src/winio.c b/src/winio.c
index 2d6d74050fa092e394322e996fd477b3dfa5ca35..345bd927361a2454f177cd7ca1b891f63ab18057 100644
--- a/src/winio.c
+++ b/src/winio.c
@@ -1415,10 +1415,10 @@ const shortcut *get_shortcut(const shortcut *s_list, int kbinput, bool
 	 * 4. func_key is TRUE and the key is a function key in the
 	 *    shortcut list. */
 
-	if (kbinput != NANO_NO_KEY && kbinput == s->ctrlval ||
+	if (kbinput != NANO_NO_KEY && (kbinput == s->ctrlval ||
 		(*meta_key == TRUE && (kbinput == s->metaval ||
 		kbinput == s->miscval)) || (*func_key == TRUE &&
-		kbinput == s->funcval)) {
+		kbinput == s->funcval))) {
 	    break;
 	}