From 26f0f6867fa0aba9e007468e7dcdeb11e6286461 Mon Sep 17 00:00:00 2001 From: TheGeneralist <180094941+thegeneralist01@users.noreply.github.com> Date: Sun, 7 Jun 2026 11:12:06 +0200 Subject: [PATCH] Extend Logitech Button3 passthrough mappings --- modules/darwin/karabiner.nix | 65 +++++++++++++++++++++++++++++++++++- 1 file changed, 64 insertions(+), 1 deletion(-) diff --git a/modules/darwin/karabiner.nix b/modules/darwin/karabiner.nix index 53f2112..d42182c 100644 --- a/modules/darwin/karabiner.nix +++ b/modules/darwin/karabiner.nix @@ -134,8 +134,35 @@ let name = "Complex Modifications"; rules = [ { - description = "Logitech mouse Button3 sends Fn, or middle click with Hyper or Button2"; + description = "Logitech mouse Button3 sends Fn, or middle click with Hyper, Shift, Button1, or Button2"; manipulators = [ + { + from.pointing_button = "button1"; + to = [ + { pointing_button = "button1"; } + { + set_variable = { + name = "logitech_mouse_button1_held"; + value = 1; + }; + } + ]; + to_after_key_up = [ + { + set_variable = { + name = "logitech_mouse_button1_held"; + value = 0; + }; + } + ]; + conditions = [ + { + type = "device_if"; + identifiers = [ logitechMouseIdentifiers ]; + } + ]; + type = "basic"; + } { from.pointing_button = "button2"; to = [ @@ -163,6 +190,25 @@ let ]; type = "basic"; } + { + from = { + pointing_button = "button3"; + modifiers.optional = [ "any" ]; + }; + to = [ { pointing_button = "button3"; } ]; + conditions = [ + { + type = "device_if"; + identifiers = [ logitechMouseIdentifiers ]; + } + { + type = "variable_if"; + name = "logitech_mouse_button1_held"; + value = 1; + } + ]; + type = "basic"; + } { from = { pointing_button = "button3"; @@ -177,6 +223,23 @@ let ]; type = "basic"; } + { + from = { + pointing_button = "button3"; + modifiers = { + mandatory = [ "shift" ]; + optional = [ "any" ]; + }; + }; + to = [ { pointing_button = "button3"; } ]; + conditions = [ + { + type = "device_if"; + identifiers = [ logitechMouseIdentifiers ]; + } + ]; + type = "basic"; + } { from = { pointing_button = "button3";