lkml.org 
[lkml]   [2022]   [Aug]   [17]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
Patch in this message
/
From
Subject[PATCH] HID: magicmouse: Add parameter to be able to adjust middle button position.
Date
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
\
 
 \ /
  Last update: 2022-08-17 12:51    [W:0.252 / U:0.008 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site