9front - general discussion about 9front
 help / color / mirror / Atom feed
* [9front] [PATCH] allow kbdfs to rewrite altgr combinations from drawterm
@ 2022-10-07 13:31 Jacob Moody
  0 siblings, 0 replies; only message in thread
From: Jacob Moody @ 2022-10-07 13:31 UTC (permalink / raw)
  To: 9front

Currently most drawterm guis simply map right alt to to left alt. This is fine, but we do have support
for making use of altgr so why not send that? Once we are sending altgr, this tweaks how kbdfs ingests
those 'R/r' messages and allows it to switch over in to the altgr page on matching runes. This only
effects the processing for /dev/kbd messages _in to_ kbdfs which is seemingly only used by drawterm.

This also captures when the algr combination may have been precomposed by the host
running drawterm, and sets k.b correctly.

diff 59d978eeb6d9f987d2c2b17d2799f3c15655284f uncommitted
--- a/sys/src/cmd/aux/kbdfs/kbdfs.c
+++ b/sys/src/cmd/aux/kbdfs/kbdfs.c
@@ -514,12 +514,14 @@
 		k.b = 0;
 		k.down = (p[0] == 'r');
 		for(i=0; i<Nscan; i++){
-			if(kbtab[i] == k.r || kbtabshift[i] == k.r || (i >= 16 && kbtabctl[i] == k.r)){
+			if(kbtab[i] == k.r || kbtabshift[i] == k.r || (i >= 16 && kbtabctl[i] == k.r) || kbtabaltgr[i] == k.r){
 				/* assign button from kbtab */
 				k.b = kbtab[i];
 				/* handle ^X forms */
 				if(k.r == kbtab[i] && kbtabctl[i] && !a->shift && !a->altgr && a->ctl)
 					k.r = kbtabctl[i];
+				else if(k.r == kbtab[i] && kbtabaltgr[i] && !a->shift && a->altgr && !a->ctl)
+					k.r = kbtabaltgr[i];
 				break;
 			}
 		}

^ permalink raw reply	[flat|nested] only message in thread

only message in thread, other threads:[~2022-10-07 13:33 UTC | newest]

Thread overview: (only message) (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2022-10-07 13:31 [9front] [PATCH] allow kbdfs to rewrite altgr combinations from drawterm Jacob Moody

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).