shithub: riscv

Download patch

ref: e7068420d08536df39488f40373ba9b99b0da2b1
parent: d4124d48f9c7e85fdaa50640035080174c94196e
author: cinap_lenrek <cinap_lenrek@felloff.net>
date: Wed Jun 7 13:03:44 EDT 2023

vmx: read /dev/kbmap in new format

--- a/sys/src/cmd/vmx/vga.c
+++ b/sys/src/cmd/vmx/vga.c
@@ -309,12 +309,23 @@
 		return;
 	}
 	for(;; free(s)){
+		static char *tab[] = {
+			"none", "shift", "esc", "altgr",
+			"ctl", "ctlesc", "shiftesc", "shiftaltgr",
+			"mod4", "altgrmod4",
+		};
 		s = Brdstr(bp, '\n', 1);
 		if(s == nil) break;
 		nf = getfields(s, f, nelem(f), 1, " \t");
 		if(nf < 3) continue;
-		x = strtol(f[0], &p, 0);
-		if(*p != 0) continue;
+		for(x = 0; x < nelem(tab); x++)
+			if(strcmp(f[0], tab[x]) == 0)
+				break;
+		if(x >= nelem(tab)){
+			x = strtol(f[0], &p, 0);
+			if(*p != 0)
+				continue;
+		}
 		y = strtol(f[1], &p, 0);
 		if(*p != 0) continue;
 		if(*f[2] == '\'' || *f[2] == '^'){