From: Junji Kanemaru <junji.kanemaru@oracle.com>
To: linux-kernel@vger.kernel.org
Subject: patch: logips2pp.c - Wheel(middle) button fix
Date: Fri, 31 Oct 2003 13:58:53 +0900 [thread overview]
Message-ID: <200310311358.54109.junji.kanemaru@oracle.com> (raw)
Dear Linux Kernel Hackers
Recently I switched to 2.6.0-test8,9 kernel and encountered
a problem that my mouse's middle button no longer works.
My mouse, Arvel MFS07MT, has a wheel and it is also
a button, I was able to paste text by pressing it with 2.4.x
kernel but 2.6.0-8,9.
I looked into input driver code and found where the problem
resides. The problem is my mouse is buggy.
There's code that clears BTN_MIDDLE bit in logips2pp.c
line 157-158 if the mouse says it has less than 3 buttons.
My mouse should set 3 in param[1] but it sets 2.
So that's why my mouse's middle button gets disabled.
But I really need my mouse's middle button working and
I think there may be other mice have same problem out
there we have to work out on this problem.
First I thought setting the BTN_MIDDLE bit back at the enf of
ps2pp_detect_model() function, right before it's returning
zero(0) when it fails to detect model. But even with this fix
there might be some buggy mice are still there that they are
detected as valid model and report they have two buttons
though they have wheel-button at middle.
So probably the best way to fix this problem without getting
into complicated mouse detection, just leave BTN_MIDDLE bit
on if param[1] >= 2, clear it when param[1] < 2.
Below is my tiny fix. Not 100% sure if I did right thing or not.
If this fix is acceptable for maintainer of logips2pp.c then
please apply.
Thanks,
-- Junji Kanemaru
Data Centrix Co., Ltd.
Tokyo Japan
--- linux-2.6.0-test9/drivers/input/mouse/logips2pp.c 2003-10-26
03:43:59.000000000 +0900
+++ linux-2.6.0-test9-debug/drivers/input/mouse/logips2pp.c 2003-10-31
13:48:38.000000000 +0900
@@ -154,10 +154,18 @@
psmouse->vendor = "Logitech";
psmouse->model = ((param[0] >> 4) & 0x07) | ((param[0] << 3) & 0x78);
- if (param[1] < 3)
- clear_bit(BTN_MIDDLE, psmouse->dev.keybit);
- if (param[1] < 2)
+ /*
+ * We clear middle BTN_MIDDLE only when the mouse says
+ * there's only one button on it(param[1] < 2).
+ * This is a workaround for some buggy mice which report
+ * they have only 2 buttons though they have wheel-button
+ * which also works as middle button.
+ * 10/31/2003 - junji.kanemaru@datacentrix.co.jp
+ */
+ if (param[1] < 2) {
clear_bit(BTN_RIGHT, psmouse->dev.keybit);
+ clear_bit(BTN_MIDDLE, psmouse->dev.keybit);
+ }
psmouse->type = PSMOUSE_PS2;
reply other threads:[~2003-10-31 4:55 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:
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=200310311358.54109.junji.kanemaru@oracle.com \
--to=junji.kanemaru@oracle.com \
--cc=junji.kanemaru@datacentrix.co.jp \
--cc=linux-kernel@vger.kernel.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
all inboxes | Powered by JetHome®