From 5d22e55d6b2cb233b8c68794f704acefb1a58647 Mon Sep 17 00:00:00 2001 From: TheGeneralist <180094941+thegeneralist01@users.noreply.github.com> Date: Sat, 6 Jun 2026 19:13:25 +0200 Subject: [PATCH] Map Logitech mouse Button3 to Fn with Hyper override --- modules/darwin/karabiner.nix | 43 +++++++++++++++++++++++++++++++----- 1 file changed, 37 insertions(+), 6 deletions(-) diff --git a/modules/darwin/karabiner.nix b/modules/darwin/karabiner.nix index 102ccac..feded39 100644 --- a/modules/darwin/karabiner.nix +++ b/modules/darwin/karabiner.nix @@ -104,12 +104,8 @@ let is_pointing_device = true; }; - # Middle click sends Fn; side buttons navigate back and forward. + # Side buttons navigate back and forward. logitechMouseSimpleModifications = [ - { - from.pointing_button = "button3"; - to = [ { apple_vendor_top_case_key_code = "keyboard_fn"; } ]; - } { from.pointing_button = "button4"; to = [ @@ -133,6 +129,39 @@ let complex_modifications = { name = "Complex Modifications"; rules = [ + { + description = "Logitech mouse Button3 sends Fn, or middle click with Hyper"; + manipulators = [ + { + from = { + pointing_button = "button3"; + modifiers.mandatory = hyperModifiers; + }; + to = [ { pointing_button = "button3"; } ]; + conditions = [ + { + type = "device_if"; + identifiers = [ logitechMouseIdentifiers ]; + } + ]; + type = "basic"; + } + { + from = { + pointing_button = "button3"; + modifiers.optional = [ "any" ]; + }; + to = [ { apple_vendor_top_case_key_code = "keyboard_fn"; } ]; + conditions = [ + { + type = "device_if"; + identifiers = [ logitechMouseIdentifiers ]; + } + ]; + type = "basic"; + } + ]; + } # { # description = "Change numbers to symbols and vice versa"; # manipulators = manipulators; @@ -143,7 +172,9 @@ let { from = { key_code = "caps_lock"; - modifiers = { optional = [ "any" ]; }; + modifiers = { + optional = [ "any" ]; + }; }; to = [ {