linux-input.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Supasak Sutha <blur.3rd@gmail.com>
To: unlisted-recipients:; (no To-header on input)
Cc: blur.3rd@gmail.com, Jiri Kosina <jikos@kernel.org>,
	Benjamin Tissoires <benjamin.tissoires@redhat.com>,
	linux-input@vger.kernel.org, linux-kernel@vger.kernel.org
Subject: [PATCH] HID: magicmouse: Add parameter to be able to adjust middle button position.
Date: Wed, 17 Aug 2022 17:50:13 +0700	[thread overview]
Message-ID: <20220817105013.28036-1-blur.3rd@gmail.com> (raw)

Apparently the driver fixed the offset of middle button to [-350, +350].
Which separated the area to 3 equally space for 3 buttons.
Lead to a lot of mis-clicking as the magicmouse has no real button.
Users should be able to adjust the buttons to suite their fingers.

This patch add parameters to adjust theses offsets,
while keeping the default values to [-350, +350].

Signed-off-by: Supasak Sutha <blur.3rd@gmail.com>
---
 drivers/hid/hid-magicmouse.c | 5 +++++
 1 file changed, 5 insertions(+)

diff --git a/drivers/hid/hid-magicmouse.c b/drivers/hid/hid-magicmouse.c
index 664a624a363d..9709085647fb 100644
--- a/drivers/hid/hid-magicmouse.c
+++ b/drivers/hid/hid-magicmouse.c
@@ -25,7 +25,12 @@ module_param(emulate_3button, bool, 0644);
 MODULE_PARM_DESC(emulate_3button, "Emulate a middle button");
 
 static int middle_button_start = -350;
+module_param(middle_button_start, int, 0644);
+MODULE_PARM_DESC(middle_button_start, "Middle button beginning offset");
+
 static int middle_button_stop = +350;
+module_param(middle_button_stop, int, 0644);
+MODULE_PARM_DESC(middle_button_stop, "Middle button end offset");
 
 static bool emulate_scroll_wheel = true;
 module_param(emulate_scroll_wheel, bool, 0644);
-- 
2.37.1


                 reply	other threads:[~2022-08-17 10:50 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=20220817105013.28036-1-blur.3rd@gmail.com \
    --to=blur.3rd@gmail.com \
    --cc=benjamin.tissoires@redhat.com \
    --cc=jikos@kernel.org \
    --cc=linux-input@vger.kernel.org \
    --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;
as well as URLs for NNTP newsgroup(s).