pqrs-org / Karabiner-Elements

Karabiner-Elements is a powerful utility for keyboard customization on macOS Sierra (10.12) or later.
https://pqrs.org/osx/karabiner/
The Unlicense
18.88k stars 838 forks source link

Remapping Left click does not work on the trackpad #2157

Open genesy opened 4 years ago

genesy commented 4 years ago

The code below doesn't work.

{
  "type": "basic",
  "from": {
    "pointing_button": "button1"
  },
  "to": [
    {
      "key_code": "a"
    }
  ]
}

My goal is to rebind ctrl click to command click but simply rebinding button1 isn't working at all. the rules from the import page that relates to rebinding ctrl click to disable it don't work either.

I'm on macOS mojave 10.14.6 using Karabiner Elements 12.9.0

tfabris commented 4 years ago

Karabiner does not remap mouses by default. Go into the Karabiner Preferences screen, Devices tab, and see if the tickybox next to your mouse is ticked.

If that does not fix it, you might be running into a similar problem I'm having, which only occurs on the trackpad. I'm trying to remap command-left-click to ctrl-left-click for one particular application on MacOS Catalina.

As long as I enable the mouse in the Preferences/Devices tab, my remapping works successfully for an actual mouse, but it does not work for the trackpad (which is also enabled).

genesy commented 4 years ago

That might be it. I don't use a separate mouse and only use the track pad..

On Sun, Feb 23, 2020, 5:03 AM Tony Fabris, notifications@github.com wrote:

Karabiner does not remap mouses by default. Go into the Karabiner Preferences screen, Devices tab, and see if the tickybox next to your mouse is ticked.

If that does not fix it, you might be running into a similar problem I'm having, which only occurs on the trackpad. I'm trying to remap command-left-click to ctrl-left-click for one particular application on MacOS Catalina.

As long as I enable the mouse in the Preferences/Devices tab, my remapping works successfully for an actual mouse, but it does not work for the trackpad (which is also enabled).

— You are receiving this because you authored the thread. Reply to this email directly, view it on GitHub https://github.com/pqrs-org/Karabiner-Elements/issues/2157?email_source=notifications&email_token=AAJZDMC6JXU677PC5VECXB3REGHLXA5CNFSM4KV52I6KYY3PNVWWK3TUL52HS4DFVREXG43VMVBW63LNMVXHJKTDN5WW2ZLOORPWSZGOEMVKPHI#issuecomment-589997981, or unsubscribe https://github.com/notifications/unsubscribe-auth/AAJZDMADNB34GCBFWY43LZLREGHLXANCNFSM4KV52I6A .

tfabris commented 4 years ago

This is my code. It works perfectly with the mouse but does not work with the trackpad. I'm using MacOS catalina.

{
    "description": "Change Control-Click to Swizzlestick-Click (works only for enabled mouses so far)",
    "manipulators": [
        {
            "conditions": [
                {
                    "bundle_identifiers": [
                        "^com.google.Chrome"
                    ],
                    "type": "frontmost_application_if"
                }
            ],
            "from": {
                "modifiers": {
                    "mandatory": "left_control",
                    "optional": "any"
                },
                "pointing_button": "button1"
            },
            "to": [
                {
                    "modifiers": "left_gui",
                    "pointing_button": "button1"
                }
            ],
            "type": "basic"
        }
    ]
}
eyalroth commented 4 years ago

Same here, doesn't work with trackpad (haven't tried external mouse).

Configuration:

{
    "manipulators": [
        {
            "conditions": [
                {
                    "bundle_identifiers": [
                        "^com\\.google\\.Chrome"
                    ],
                    "type": "frontmost_application_if"
                }
            ],
            "description": "Ctrl+LMC -> Cmd+LMC in Chrome",
            "from": {
                "modifiers": {
                    "mandatory": [
                        "left_control"
                    ]
                },
                "pointing_button": "button1"
            },
            "to": {
                "modifiers": [
                    "left_command"
                ],
                "pointing_button": "button1"
            },
            "type": "basic"
        }
    ]
},

Also note that I can't enable the trackbad mouse in the devices settings:

Screen Shot 2020-03-24 at 12 23 50

Catalina 10.15.3, Karabiner 12.9.0

cotfas commented 4 years ago

The same, Catalina 10.15.4, Karabiner 12.9.0

I`m interested when pressing any of the corners of the trackpad to do a shell action.

Tried with:

{ "from": { "pointing_button": "button1" }, "to": [ { "shell_command": "exec script" } ], "type": "basic" }

{ "from": { "key_code": 0 }, "to": [ { "shell_command": "exec script" } ], "type": "basic" }

This one works but I do not need it:

{ "from": { "key_code": "z" }, "to": [ { "pointing_button": "button2" } ], "type": "basic" }

This one also works when two fingers are on trackpad, but I do not want to press any key:

{ "from": { "key_code": "y", "modifiers": { "optional": [ "any" ] } }, "to": [ { "shell_command": "exec script" } ], "conditions": [ { "type": "variable_if", "name": "multitouch_extension_finger_count_total", "value": 2 } ], "type": "basic" }

image

Edit:

Also tried with Magic Mouse and the pointing_button is not taken, and the device shows as gray out in the main app.

stale[bot] commented 4 years ago

This issue has been automatically marked as stale because it has not had recent activity. It will be closed if no further activity occurs. Thank you for your contributions.

eyalroth commented 4 years ago

Not stale.

tfabris commented 4 years ago

Is there a particular reason why remapping clicks on the trackpad is programmatically trickier than remapping clicks on the mouse? I'm new to Mac software development, so I don't know how this sort of thing is handled at the low level. If this were Windows, you'd just intercept the left click event, regardless of the input device.

finite-state-machine commented 4 years ago

I'm also seeing this issue on macOS 10.14.6 and Karabiner 12.10.0; both the internal trackpad and external Magic Trackpad 2 (vendor 76, product 613) are greyed out in the Preferences->Devices tab.

I'm guessing modifying trackpads is something Karabiner can't do, but there's no open issue for this that I can find.

edit: the issue with trackpads is surprising; Kararbiner 10 could certainly intercept trackpad events.

stale[bot] commented 4 years ago

This issue has been automatically marked as stale because it has not had recent activity. It will be closed if no further activity occurs. Thank you for your contributions.

eyalroth commented 4 years ago

Not stale.

stale[bot] commented 3 years ago

This issue has been automatically marked as stale because it has not had recent activity. It will be closed if no further activity occurs. Thank you for your contributions.

eyalroth commented 3 years ago

Bad @stale bot!

eret9616 commented 3 years ago

How to remap trackpad click buttons in karabiner? can't believe this issue last so long...

capric98 commented 3 years ago

Same problem, seems like a restriction from Apple? Release notes 11.2.0{:target="_blank"}

stale[bot] commented 2 years ago

This issue has been automatically marked as stale because it has not had recent activity. It will be closed if no further activity occurs. Thank you for your contributions.

cotfas commented 2 years ago

I already remapped my trackpad, I made my private XCODE CLI app that does what I need on the OS level.

tfabris commented 2 years ago

This issue is still occurring for me on Karabiner Elements 14.3.0.

Remapping ctrl-click works when using an external mouse, but not when using the MacBook's built-in trackpad.

Code example which reproduces the issue:

    {
        "description": "Change Control-Click to Swizzlestick-Click (works only for enabled mouses so far)",
        "manipulators": [
            {
                "type": "basic",
                "conditions": [
                    {
                        "bundle_identifiers": [
                            "^com.google.Chrome"
                        ],
                        "type": "frontmost_application_if"
                    }
                ],
                "from": {
                    "modifiers": {
                        "mandatory": "control",
                        "optional": "any"
                    },
                    "pointing_button": "button1"
                },
                "to": [
                    {
                        "modifiers": "left_gui",
                        "pointing_button": "button1"
                    }
                ]
            }
        ]
    }
negruandrei commented 2 years ago

Any updates ?

MuhammedZakir commented 2 years ago

I am not sure, but this[1] might allow remapping trackpad clicks.

[1] https://github.com/pqrs-org/Karabiner-Elements/pull/2998

tfabris commented 1 year ago

For anyone coming back to this bug, the newer versions of Karabiner simply says that Apple pointing devices are not supported. Screen shot:

image
nkgm commented 1 year ago

You can enable "Pro mode" but I would recommend against it.

image