Karabiner-elements: Mouse Button 4 to Back/Forward

Created on 28 Jan 2018  Â·  5Comments  Â·  Source: pqrs-org/Karabiner-Elements

Hi,

I'm trying to replica the set up I had with the old Karabiner, namely:
Mouse Button 4 > CMD + [
Alt + Mouse Button 4 > CMD + ]

So far I was only able to get the first one working. Could anyone help me get the second one down?
Here's what I've got:

{
  "rules": [
    {
      "description": "Mouse button4 → command + [",
      "manipulators": [
        {
          "from": {
            "pointing_button": "button4"
          },
          "to": [
            {
              "key_code": "open_bracket",
              "modifiers": [
                "command"
              ]
            }
          ],
          "type": "basic"
        }
      ]
    },
    {
      "description": "Alt + Mouse Button 4 → command + ]",
      "manipulators": [
        {
          "from": {
            "pointing_button": "button4",
            "modifiers": {
              "optional": [
                "left_option"
              ]
            }
          },
          "to": [
            {
              "key_code": "close_bracket",
              "modifiers": [
                "command"
              ]
            }
          ],
          "type": "basic"
        }
      ]
    }
  ]
}

I'm using Microsoft Sculpt Comfort Mouse.

Most helpful comment

Just put in under Simple Modifications and add modifiers list:

"simple_modifications": [
{
    "from":
    {
        "pointing_button": "button4"
    },
    "to":
    {
        "key_code": "open_bracket",
        "modifiers": [
            "left_command"
        ]
    }
},
{
    "from":
    {
        "pointing_button": "button5"
    },
    "to":
    {
        "key_code": "close_bracket",
        "modifiers": [
            "left_command"
        ]
    }
}]

Ends up looking this:
Screen Shot 2019-05-20 at 11 26 31 AM

All 5 comments

@ArtemGordinsky I don't have my Mac with me to test the theory but I believe the issue is your "Optional" left_option. The "Optional" modifier condition states that events are manipulated even IF the modifier is pressed; meaning that the event would manipulate without the modifier pressed. I would try changing the Optional condition to Mandatory. That would limit the second event to manipulate ONLY if left_option is pressed. I think Karabiner is getting confused as you are essentially binding two different events to the same button press.

@jthedwalker Thanks! I already gave up and switched to USB Overdrive though.

I still can't set up this shortcut there but at least I don't get repeating keys and sluggish cursor as I did with Karabiner.

@jthedwalker Thanks a lot for the suggestion, it actually works!

Just put in under Simple Modifications and add modifiers list:

"simple_modifications": [
{
    "from":
    {
        "pointing_button": "button4"
    },
    "to":
    {
        "key_code": "open_bracket",
        "modifiers": [
            "left_command"
        ]
    }
},
{
    "from":
    {
        "pointing_button": "button5"
    },
    "to":
    {
        "key_code": "close_bracket",
        "modifiers": [
            "left_command"
        ]
    }
}]

Ends up looking this:
Screen Shot 2019-05-20 at 11 26 31 AM

@JoeFerrucci It works for me. Thanks a lot!

Was this page helpful?
0 / 5 - 0 ratings