2

I am trying to use Karabiner-Elements to map Ctrl+Click to Cmd+Click -- for IntelliJ IDEA only.

I came up with this JSON rule, which seems valid and correct:

{
    "description": "Ctrl+Left Click => Cmd+Left Click (IntelliJ IDEA only)",
    "manipulators": [
        {
            "conditions": [
                {
                    "bundle_identifiers": [
                        "^com\\.jetbrains\\.intellij$"
                    ],
                    "type": "frontmost_application_if"
                }
            ],
            "from": {
                "modifiers": {
                    "mandatory": [
                        "control"
                    ],
                    "optional": [
                        "any"
                    ]
                },
                "pointing_button": "button1"
            },
            "to": [
                {
                    "modifiers": [
                        "command"
                    ],
                    "pointing_button": "button1"
                }
            ],
            "type": "basic"
        }
    ]
}

But for some reason, it doesn't do anything (except for displaying a notification by Karabiner about needing to press the Ctrl key once again).

What have I missed?

4
  • Is this for rebinding "Find Usages"? Is there a reason you want to change the binding in Karabiner instead of IntelliJ's builtin keymap?
    – JMY1000
    Commented Sep 15, 2023 at 17:27
  • @JMY1000 No, it is an additional binding for the existing Cmd+Click (drill down to method definition). On IntelliJ, I prefer having both do the same.
    – dbatno
    Commented Sep 18, 2023 at 7:09
  • 2
    IntelliJ supports multiple bindings; it seems like it'd be easier just to add Ctrl + Click as a binding in IntelliJ.
    – JMY1000
    Commented Sep 19, 2023 at 13:46
  • @JMY1000 That's a great idea. It works great for Ctrl+F. How do I do that for Ctrl+Click? Thank you.
    – dbatno
    Commented Sep 20, 2023 at 9:01

1 Answer 1

0

I'd recommend adding a new binding via IntelliJ's builtin keymap rather than using Karabiner for this. You can do this via Preferences → Keymap → Go to Declaration or Usages → (Right click) → Add Mouse Shortcut:

enter image description here

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .