shithub: riow

Download patch

ref: 1b76299cd07cc240cc29f74b2b8a25e80d47e3ee
parent: 41ad3df95a6ac98a5133c850c4aea9dad1589719
author: Sigrid Haflínudóttir <ftrvxmtrx@gmail.com>
date: Sun Mar 29 12:30:22 EDT 2020

gkbd: add more keys and print keys as is when isprint==true

--- a/gkbd.c
+++ b/gkbd.c
@@ -7,18 +7,19 @@
 	Rune r;
 	char *k;
 }keys[] = {
-	{Kglenda, "glenda"},
-	{Kshift, "shift"},
-	{Kctl, "ctl"},
+	{'\t', "tab"},
+	{0x0a, "enter"},
+	{0x20, "space"},
 	{Kalt, "alt"},
+	{Kctl, "ctl"},
+	{Kdel, "del"},
+	{Kdown, "down"},
+	{Kesc, "esc"},
+	{Kglenda, "glenda"},
 	{Kleft, "left"},
 	{Kright, "right"},
-	{Kdown, "down"},
+	{Kshift, "shift"},
 	{Kup, "up"},
-	{10, "enter"},
-	{Kdel, "del"},
-	{0x20, "space"},
-	{Kesc, "esc"},
 };
 
 void
@@ -53,7 +54,7 @@
 			}
 
 			if(i >= nelem(keys)){
-				if(isalnum(r))
+				if(isprint(r))
 					n += sprint(out+n, "%C ", r);
 				else
 					n += sprint(out+n, "0x%x ", r);