From: "james palmer" <james@biobuf.link>
To: "9front mailing list" <9front@9front.org>
Subject: [9front] enable button 6 in devmouse and kbdfs
Date: Thu, 25 Feb 2021 18:47:57 +0000 [thread overview]
Message-ID: <86024e97-70f3-45e8-be71-d27f916483bc@www.fastmail.com> (raw)
[-- Attachment #1: Type: text/plain, Size: 479 bytes --]
hi there,
probably as a holdover from the ipaq port,
rio listens for button 6 and sends it to the keyboard set with the arguments.
bitsy/keyboard uses this to show/hide itself.
this is useful to me to toggle the keyboard when i am using my thinkpad x41t in tablet mode.
i have patched devmouse to let button 6 through and kbdfs to let it be bound to a key in the kbmap.
i hope this is useful to the small subset of 9front users with tablet/touchscreen devices.
thanks
- james
[-- Attachment #2.1: Type: text/plain, Size: 333 bytes --]
from postmaster@1ess:
The following attachment had content that we can't
prove to be harmless. To avoid possible automatic
execution, we changed the content headers.
The original header was:
Content-Disposition: attachment;filename="button6.diff"
Content-Type: text/x-patch; name="button6.diff"
Content-Transfer-Encoding: BASE64
[-- Attachment #2.2: button6.diff.suspect --]
[-- Type: application/octet-stream, Size: 1365 bytes --]
diff -r b2bea92dffd4 sys/src/9/port/devmouse.c
--- a/sys/src/9/port/devmouse.c Sat Feb 20 21:02:07 2021 -0800
+++ b/sys/src/9/port/devmouse.c Thu Feb 25 18:39:16 2021 +0000
@@ -273,8 +273,8 @@
iunlock(&mouse);
b = buttonmap[m.buttons&7];
- /* put buttons 4 and 5 back in */
- b |= m.buttons & (3<<3);
+ /* put buttons 4 and 5 and 6 back in */
+ b |= m.buttons & (4<<3);
if (scrollswap)
if (b == 8)
b = 16;
diff -r b2bea92dffd4 sys/src/cmd/aux/kbdfs/kbdfs.c
--- a/sys/src/cmd/aux/kbdfs/kbdfs.c Sat Feb 20 21:02:07 2021 -0800
+++ b/sys/src/cmd/aux/kbdfs/kbdfs.c Thu Feb 25 18:39:16 2021 +0000
@@ -626,7 +626,7 @@
nb = 0;
while(recv(keychan, &key) > 0){
- if(key.r >= Kmouse+1 && key.r <= Kmouse+5){
+ if(key.r >= Kmouse+1 && key.r <= Kmouse+6){
if(msinfd >= 0)
send(mctlchan, &key);
continue;
@@ -859,7 +859,7 @@
continue;
}
- if(msinfd >= 0 && key.r >= Kmouse+1 && key.r <= Kmouse+5){
+ if(msinfd >= 0 && key.r >= Kmouse+1 && key.r <= Kmouse+6){
i = 1<<(key.r-(Kmouse+1));
if(key.down)
mouseb |= i;
@@ -1226,7 +1226,7 @@
r -= 0x40;
else
goto Badarg;
- }else if(*lp == 'M' && ('1' <= lp[1] && lp[1] <= '5'))
+ }else if(*lp == 'M' && ('1' <= lp[1] && lp[1] <= '6'))
r = Kmouse+lp[1]-'0';
else if(*lp>='0' && *lp<='9') /* includes 0x... */
r = strtoul(lp, &lp, 0);
next reply other threads:[~2021-02-25 18:54 UTC|newest]
Thread overview: 4+ messages / expand[flat|nested] mbox.gz Atom feed top
2021-02-25 18:47 james palmer [this message]
2021-02-25 19:32 ` james palmer
2021-02-25 19:57 ` james palmer
2021-02-25 19:40 ` james palmer
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=86024e97-70f3-45e8-be71-d27f916483bc@www.fastmail.com \
--to=james@biobuf.link \
--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).