From: "J.R. Mauro" <jrm8005@gmail.com>
To: Fans of the OS Plan 9 from Bell Labs <9fans@9fans.net>
Subject: [9fans] Scrolling for plan9port sam
Date: Wed, 1 Jul 2009 00:31:56 -0400 [thread overview]
Message-ID: <3aaafc130906302131se1c415bk3fa1dbeace41ce4e@mail.gmail.com> (raw)
could someone help clean this crappy patch up a bit? i'm drunk and sam
not being able to understand my scrollwheel is really pissing me off.
at least this works despite it being ugly and steeped in cheap
whiskey...
--jorden
diff -r 5f1b36ecd9db src/cmd/samterm/main.c
--- a/src/cmd/samterm/main.c Tue Jun 09 09:26:13 2009 -0700
+++ b/src/cmd/samterm/main.c Wed Jul 01 00:29:48 2009 -0400
@@ -142,6 +142,10 @@
scroll(which, 3);
else
menu3hit();
+ } else if((mousep->buttons&8)) {
+ scroll(nwhich, 1);
+ } else if((mousep->buttons&16)) {
+ scroll(nwhich, 3);
}
mouseunblock();
}
diff -r 5f1b36ecd9db src/cmd/samterm/scroll.c
--- a/src/cmd/samterm/scroll.c Tue Jun 09 09:26:13 2009 -0700
+++ b/src/cmd/samterm/scroll.c Wed Jul 01 00:29:48 2009 -0400
@@ -100,7 +100,7 @@
void
scroll(Flayer *l, int but)
{
- int in = 0, oin;
+ int in = 0, oin, scw = 0;
long tot = scrtotal(l);
Rectangle scr, r, s, rt;
int x, y, my, oy, h;
@@ -116,9 +116,10 @@
do{
oin = in;
in = abs(x-mousep->xy.x)<=FLSCROLLWID/2;
+ scw = ((mousep->buttons&8) | (mousep->buttons&16));
if(oin && !in)
scrunmark(l, r);
- if(in){
+ if(in || scw){
scrmark(l, r);
oy = y;
my = mousep->xy.y;
next reply other threads:[~2009-07-01 4:31 UTC|newest]
Thread overview: 2+ messages / expand[flat|nested] mbox.gz Atom feed top
2009-07-01 4:31 J.R. Mauro [this message]
2009-07-02 0:06 ` J.R. Mauro
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=3aaafc130906302131se1c415bk3fa1dbeace41ce4e@mail.gmail.com \
--to=jrm8005@gmail.com \
--cc=9fans@9fans.net \
/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).