1
Fork 0
mirror of https://github.com/thegeneralist01/config.git synced 2026-07-21 19:05:19 +02:00

Fix Logitech mouse button chord handling

This commit is contained in:
TheGeneralist 2026-06-07 12:51:43 +02:00
parent 26f0f6867f
commit bb70a4f405
Signed by: thegeneralist01
SSH key fingerprint: SHA256:pp9qddbCNmVNoSjevdvQvM5z0DHN7LTa8qBMbcMq/R4

View file

@ -136,15 +136,29 @@ let
{ {
description = "Logitech mouse Button3 sends Fn, or middle click with Hyper, Shift, Button1, or Button2"; description = "Logitech mouse Button3 sends Fn, or middle click with Hyper, Shift, Button1, or Button2";
manipulators = [ manipulators = [
# Keep the forwarded button as the only `to` event so Karabiner
# preserves its down state. A variable in the same `to` sequence
# either releases the button immediately or resets too early, so
# detect Button3 through `to_if_other_key_pressed` instead.
{ {
from.pointing_button = "button1"; from.pointing_button = "button1";
to = [ to = [ { from_event = true; } ];
{ pointing_button = "button1"; } to_if_other_key_pressed = [
{ {
set_variable = { other_keys = [
name = "logitech_mouse_button1_held"; {
value = 1; pointing_button = "button3";
}; modifiers.optional = [ "any" ];
}
];
to = [
{
set_variable = {
name = "logitech_mouse_button1_held";
value = 1;
};
}
];
} }
]; ];
to_after_key_up = [ to_after_key_up = [
@ -165,13 +179,23 @@ let
} }
{ {
from.pointing_button = "button2"; from.pointing_button = "button2";
to = [ to = [ { from_event = true; } ];
{ pointing_button = "button2"; } to_if_other_key_pressed = [
{ {
set_variable = { other_keys = [
name = "logitech_mouse_button2_held"; {
value = 1; pointing_button = "button3";
}; modifiers.optional = [ "any" ];
}
];
to = [
{
set_variable = {
name = "logitech_mouse_button2_held";
value = 1;
};
}
];
} }
]; ];
to_after_key_up = [ to_after_key_up = [