'How to use Karabiner to Map Ctrl + Left Mouse Click to Move left a space

I'm trying to use complex rules in Karabiner to map Ctrl+Left-Mouse-Click and Ctrl+Right-Mouse-Click to switch MacOS desktop spaces to the left and right -- basically map them to Ctrl+Left-Arrow and Ctrl+Right-Arrow respectively.

Does this rule exist somewhere?

Thanks!



Solution 1:[1]

If you have a mouse that has side buttons, you might use my karabiner complex modification for mapping side buttons to desktop switch.

Hopefully you can edit this for your use.

{
  "title": "Switch desktop with mouse side buttons 4,5",
  "rules": [
    {
      "description": "Maps button 4, 5 to left desktop and right desktop switch",
      "manipulators": [
        {
          "type": "basic",
          "from": {
            "pointing_button": "button5"
          },
          "to": [
            {
              "key_code": "left_arrow",
              "modifiers": "left_control"
            }
          ]
        },
        {
          "type": "basic",
          "from": {
            "pointing_button": "button4"
          },
          "to": [
            {
              "key_code": "right_arrow",
              "modifiers": "left_control"
            }
          ]
        }
      ]
    }
  ]
}

Sources

This article follows the attribution requirements of Stack Overflow and is licensed under CC BY-SA 3.0.

Source: Stack Overflow

Solution Source
Solution 1 Balkon