From: "Sigrid Solveig Haflínudóttir" <ftrvxmtrx@gmail.com>
To: 9front@9front.org
Subject: kbdfs: "glenda" key modifier
Date: Sat, 11 Apr 2020 19:27:24 +0200 [thread overview]
Message-ID: <20200411172724.GB51717@fukken.whatever> (raw)
[-- Attachment #1: Type: text/plain, Size: 503 bytes --]
I added support for "glenda" key (the one that usually has Windows
logo) support to kbdfs as an additional modifier to be used by
whoever needs it. I use it with https://github.com/ftrvxmtrx/riow
to get window management shortcuts although I plan to make riow
depend solely on kbdfs change alone without having any rio mods
by having a "filter" on top of kbdfs to intercept this modifier.
If there is not much objection I would like to merge this change
alone to 9front.
Comments and ideas are welcome.
[-- Attachment #2: kbdfs-glenda.patch --]
[-- Type: text/plain, Size: 4653 bytes --]
diff -r 9d154a594d99 sys/include/keyboard.h
--- a/sys/include/keyboard.h Sat Apr 11 14:20:41 2020 +0200
+++ b/sys/include/keyboard.h Sat Apr 11 18:50:50 2020 +0200
@@ -44,6 +44,8 @@
Kscrolloneup= KF|0x20,
Kscrollonedown= KF|0x21,
+ Kglenda= KF|0x22,
+
Ksoh= 0x01,
Kstx= 0x02,
Ketx= 0x03,
diff -r 9d154a594d99 sys/lib/kbmap/fi
--- a/sys/lib/kbmap/fi Sat Apr 11 14:20:41 2020 +0200
+++ b/sys/lib/kbmap/fi Sat Apr 11 18:50:50 2020 +0200
@@ -32,6 +32,8 @@
1 52 ':
1 53 '_
1 86 '>
+2 91 0xf022
+2 125 0xf022
3 3 '@
3 4 '£
3 5 '$
@@ -44,3 +46,5 @@
3 27 '~
3 46 '¢
3 86 '|
+3 91 0xf022
+4 91 0xf022
diff -r 9d154a594d99 sys/lib/kbmap/us
--- a/sys/lib/kbmap/us Sat Apr 11 14:20:41 2020 +0200
+++ b/sys/lib/kbmap/us Sat Apr 11 18:50:50 2020 +0200
@@ -345,7 +345,7 @@
2 88 0
2 89 0
2 90 0
-2 91 0
+2 91 0xf022
2 92 0
2 93 0
2 94 0
@@ -379,7 +379,7 @@
2 122 0
2 123 0
2 124 0
-2 125 0
+2 125 0xf022
2 126 0
2 127 0
3 0 0
@@ -473,7 +473,7 @@
3 88 0
3 89 0
3 90 0
-3 91 0
+3 91 0xf022
3 92 0
3 93 0
3 94 0
@@ -601,7 +601,7 @@
4 88 ^L
4 89 0
4 90 0
-4 91 0
+4 91 0xf022
4 92 0
4 93 0
4 94 0
diff -r 9d154a594d99 sys/src/cmd/aux/kbdfs/kbdfs.c
--- a/sys/src/cmd/aux/kbdfs/kbdfs.c Sat Apr 11 14:20:41 2020 +0200
+++ b/sys/src/cmd/aux/kbdfs/kbdfs.c Sat Apr 11 18:50:50 2020 +0200
@@ -42,6 +42,7 @@
int ctl;
int alt;
int altgr;
+ int glenda;
int leds;
};
@@ -178,11 +179,11 @@
[0x40] 0, 0, 0, 0, 0, 0, Kbreak, Khome,
[0x48] Kup, Kpgup, 0, Kleft, 0, Kright, 0, Kend,
[0x50] Kdown, Kpgdown,Kins, Kdel, 0, 0, 0, 0,
-[0x58] 0, 0, 0, 0, 0, 0, 0, 0,
+[0x58] 0, 0, 0, Kglenda, 0, 0, 0, 0,
[0x60] 0, 0, 0, 0, 0, 0, 0, 0,
[0x68] 0, 0, 0, 0, 0, 0, 0, 0,
[0x70] 0, 0, 0, 0, 0, 0, 0, 0,
-[0x78] 0, Kup, 0, 0, 0, 0, 0, 0,
+[0x78] 0, Kup, 0, 0, 0, Kglenda, 0, 0,
};
Rune kbtabshiftesc1[Nscan] =
@@ -198,11 +199,11 @@
[0x40] 0, 0, 0, 0, 0, 0, 0, 0,
[0x48] Kup, 0, 0, 0, 0, 0, 0, 0,
[0x50] 0, 0, 0, 0, 0, 0, 0, 0,
-[0x58] 0, 0, 0, 0, 0, 0, 0, 0,
+[0x58] 0, 0, 0, Kglenda, 0, 0, 0, 0,
[0x60] 0, 0, 0, 0, 0, 0, 0, 0,
[0x68] 0, 0, 0, 0, 0, 0, 0, 0,
[0x70] 0, 0, 0, 0, 0, 0, 0, 0,
-[0x78] 0, Kup, 0, 0, 0, 0, 0, 0,
+[0x78] 0, Kup, 0, 0, 0, Kglenda, 0, 0,
};
Rune kbtabctrlesc1[Nscan] =
@@ -218,11 +219,11 @@
[0x40] 0, 0, 0, 0, 0, 0, 0, 0,
[0x48] Kup, 0, 0, 0, 0, 0, 0, 0,
[0x50] 0, 0, 0, 0, 0, 0, 0, 0,
-[0x58] 0, 0, 0, 0, 0, 0, 0, 0,
+[0x58] 0, 0, 0, Kglenda, 0, 0, 0, 0,
[0x60] 0, 0, 0, 0, 0, 0, 0, 0,
[0x68] 0, 0, 0, 0, 0, 0, 0, 0,
[0x70] 0, 0, 0, 0, 0, 0, 0, 0,
-[0x78] 0, Kup, 0, 0, 0, 0, 0, 0,
+[0x78] 0, Kup, 0, 0, 0, Kglenda, 0, 0,
};
Rune kbtabaltgr[Nscan] =
@@ -238,11 +239,11 @@
[0x40] 0, 0, 0, 0, 0, 0, Kbreak, Khome,
[0x48] Kup, Kpgup, 0, Kleft, 0, Kright, 0, Kend,
[0x50] Kdown, Kpgdown,Kins, Kdel, 0, 0, 0, 0,
-[0x58] 0, 0, 0, 0, 0, 0, 0, 0,
+[0x58] 0, 0, 0, Kglenda, 0, 0, 0, 0,
[0x60] 0, 0, 0, 0, 0, 0, 0, 0,
[0x68] 0, 0, 0, 0, 0, 0, 0, 0,
[0x70] 0, 0, 0, 0, 0, 0, 0, 0,
-[0x78] 0, Kup, 0, 0, 0, 0, 0, 0,
+[0x78] 0, Kup, 0, 0, 0, Kglenda, 0, 0,
};
Rune kbtabctl[Nscan] =
@@ -258,11 +259,11 @@
[0x40] '\x06', '\a', '\f', '\r', '\x0e', '\x05', '\x06', '\x17',
[0x48] '\x18', '\x19', '\r', '\x14', '\x15', '\x16', '\v', '\x11',
[0x50] '\x12', '\x13', '\x10', '\x0e', 0, 0, 0, '\x0f',
-[0x58] '\f', 0, 0, 0, 0, 0, 0, 0,
+[0x58] '\f', 0, 0, Kglenda, 0, 0, 0, 0,
[0x60] 0, 0, 0, 0, 0, 0, 0, 0,
[0x68] 0, 0, 0, 0, 0, 0, 0, 0,
[0x70] 0, 0, 0, 0, 0, 0, 0, 0,
-[0x78] 0, '\a', 0, '\b', 0, 0, 0, 0,
+[0x78] 0, '\a', 0, '\b', 0, Kglenda, 0, 0,
};
Rune kbtabshiftaltgr[Nscan] =
@@ -344,7 +345,7 @@
if(scan->esc2){
scan->esc2--;
return;
- } else if(c == 0xe1 || c == 0xe2){
+ } else if(c == 0xe1 || c == 0xe2 || c == 0xe3){
scan->esc2 = 2;
return;
} else if(c == 0xe0){
@@ -412,6 +413,9 @@
case Kcaps:
scan->caps ^= key.down;
break;
+ case Kglenda:
+ scan->glenda ^= key.down;
+ break;
}
scan->esc1 = 0;
}
@@ -464,7 +468,7 @@
}
}
/* button unknown to kbtab, use rune if no modifier keys are active */
- if(k.b == 0 && !a->shift && !a->altgr && !a->ctl)
+ if(k.b == 0 && !a->shift && !a->altgr && !a->ctl && !a->glenda)
k.b = k.r;
if(k.r == Kshift)
a->shift = k.down;
@@ -472,6 +476,8 @@
a->altgr = k.down;
else if(k.r == Kctl)
a->ctl = k.down;
+ else if(k.r == Kglenda)
+ a->glenda = k.down;
send(keychan, &k);
break;
@@ -664,6 +670,7 @@
case Knum:
case Kshift:
case Kaltgr:
+ case Kglenda:
/* ignore modifiers */
continue;
next reply other threads:[~2020-04-11 17:27 UTC|newest]
Thread overview: 10+ messages / expand[flat|nested] mbox.gz Atom feed top
2020-04-11 17:27 Sigrid Solveig Haflínudóttir [this message]
2020-04-11 21:39 ` [9front] " kvik
2020-04-11 21:49 ` ori
2020-04-11 21:41 ` kvik
2020-04-11 21:50 ` kvik
2020-04-21 18:43 ` kvik
2020-04-21 18:48 ` ori
2020-04-21 18:56 ` Sigrid Solveig Haflínudóttir
2020-04-21 19:03 ` Jstsmthrgk
2020-04-21 19:07 ` Jstsmthrgk
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:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=20200411172724.GB51717@fukken.whatever \
--to=ftrvxmtrx@gmail.com \
--cc=9front@9front.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* 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).