9front - general discussion about 9front
 help / color / mirror / Atom feed
From: umbraticus@prosimetrum.com
To: 9front@9front.org
Subject: Re: [9front] nusb/kb mouse handling
Date: Wed, 09 Dec 2020 00:37:30 +1300	[thread overview]
Message-ID: <72DC97BA0FC4F691CD6779E728387B9E@prosimetrum.com> (raw)
In-Reply-To: <FB974048B2649E428C3392848A4D06D7@prosimetrum.com>

Thanks to sigrid, who committed the part of the patch that fixes my
trackball.  We decided to leave the button mapping for the time being.

Currently, if a USB mouse has more than three buttons, b4 acts as
another b2 and anything above that is ignored.  I had suggested
instead just sending through b4 and higher as is.  This results in b4
and b5 acting as alternatives for the scroll wheel; perhaps a nice
side effect for some mice:

	b |= s->b & ~6 | (s->b & 2) << 1 | (s->b & 4) >> 1;

Or perhaps extra buttons should be exposed in case anyone wants to
make use of them but not overlap with scroll wheel:

	b |= s->b & 1 | (s->b & 2) << 1 | (s->b & 4) >> 1 | (s->b & ~7) << 2;

The current behaviour was introduced with revison 3acb9fdd26cc
nusb/kb: map button 4 to middle button 2 (for logitech 5 button mouse)
so I assume someone wanted it.  What about b5 though?  Perhaps this
should be mapped to b3 for some kind of consistency?

 			/* map to mouse buttons */
 			b |= s->b & 1;
 			if(s->b & (4|8))
 				b |= 2;
-			if(s->b & 2)
+			if(s->b & (2|16))
 				b |= 4;

What do others think should happen to buttons >3?

umbraticus

  reply	other threads:[~2020-12-08 11:38 UTC|newest]

Thread overview: 6+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2020-12-08  0:59 umbraticus
2020-12-08  8:44 ` umbraticus
2020-12-08 11:37   ` umbraticus [this message]
2020-12-08 13:50     ` kvik
2020-12-08 21:18       ` umbraticus
2020-12-09  0:14         ` kvik

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=72DC97BA0FC4F691CD6779E728387B9E@prosimetrum.com \
    --to=umbraticus@prosimetrum.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).