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,10 +136,22 @@ let
{
description = "Logitech mouse Button3 sends Fn, or middle click with Hyper, Shift, Button1, or Button2";
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";
to = [ { from_event = true; } ];
to_if_other_key_pressed = [
{
other_keys = [
{
pointing_button = "button3";
modifiers.optional = [ "any" ];
}
];
to = [
{ pointing_button = "button1"; }
{
set_variable = {
name = "logitech_mouse_button1_held";
@ -147,6 +159,8 @@ let
};
}
];
}
];
to_after_key_up = [
{
set_variable = {
@ -165,8 +179,16 @@ let
}
{
from.pointing_button = "button2";
to = [ { from_event = true; } ];
to_if_other_key_pressed = [
{
other_keys = [
{
pointing_button = "button3";
modifiers.optional = [ "any" ];
}
];
to = [
{ pointing_button = "button2"; }
{
set_variable = {
name = "logitech_mouse_button2_held";
@ -174,6 +196,8 @@ let
};
}
];
}
];
to_after_key_up = [
{
set_variable = {