9front - general discussion about 9front
 help / color / mirror / Atom feed
From: Jacob Moody <moody@mail.posixcafe.org>
To: 9front@9front.org
Subject: [9front] [PATCH] allow kbdfs to rewrite altgr combinations from drawterm
Date: Fri, 7 Oct 2022 07:31:41 -0600	[thread overview]
Message-ID: <0abf9b96-35dc-b490-1ede-4ae87ff36a62@posixcafe.org> (raw)

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];

                 reply	other threads:[~2022-10-07 13:33 UTC|newest]

Thread overview: [no followups] expand[flat|nested]  mbox.gz  Atom feed

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=0abf9b96-35dc-b490-1ede-4ae87ff36a62@posixcafe.org \
    --to=moody@mail.posixcafe.org \
    --cc=9front@9front.org \


* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
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).