shithub: drawterm

Download patch

ref: 7ccc433d64fe03965debb1b4950e1bd23654b1fa
parent: 06d141d7fcdff9894cc1f1b160b98d1d93857901
author: cinap_lenrek <cinap_lenrek@felloff.net>
date: Fri Jan 6 18:15:13 EST 2023

devcons: we have to ignore modifier keys, just as kbdfs for raw mode

--- a/kern/devcons.c
+++ b/kern/devcons.c
@@ -299,16 +299,27 @@
 	static int collecting, nk;
 	static Rune kc[5];
 
-	 if(c == Kalt){
-		 collecting = 1;
-		 nk = 0;
-		 return 0;
-	 }
+	switch(c){
+	case 0:
+	case Kcaps:
+	case Knum:
+	case Kshift:
+	case Kaltgr:
+	case Kmod4:
+	case Kctl:
+		/* ignore modifiers */
+		return 0;
 
-	 if(!collecting){
-		 _kbdputc(c);
-		 return 0;
-	 }
+	case Kalt:
+		collecting = 1;
+		nk = 0;
+		return 0;
+	}
+
+	if(!collecting){
+		_kbdputc(c);
+		return 0;
+	}
 
 	kc[nk++] = c;
 	c = latin1(kc, nk);