Karabiner-Elements icon indicating copy to clipboard operation
Karabiner-Elements copied to clipboard

Is it possible to configure control+mouse scroll->zoom function on karabiner elements?

Open yongquan-hu opened this issue 3 years ago • 11 comments

I am a user who switched from Win to Mac, and I very much hope to be able to configure this function in the complex modifications part of Karabiner: control+scroll up-->zoom in, control+scroll down-->zoom out.

I tried to write configuration files like this but they didn't work:

"description": "mouse scroll to zoom", "manipulators": [ { "type": "basic", "from": { "mouse_key": { "vertical_wheel": 2 }, "modifiers": { "mandatory": ["left_control"] } }, "to": [ { "key_code": "=", "modifiers": ["command"] } ] }

Wondering if anyone knows how to implement this function correctly?

yongquan-hu avatar Dec 24 '21 04:12 yongquan-hu

Supplement: My mac is the M1 pro macbook pro 2021. I know that Mac has the control+scrolling global zoom function that comes with the Monterey 12.1 system. But it is just a magnifying glass, which is not the same as the command+/- zoom effect.

yongquan-hu avatar Dec 24 '21 04:12 yongquan-hu

Will you clarify the behavior you're after exactly? Are you wanting to be able to zoom in and out incrementally by only using the scroll wheel? If you've checked the box at System Preferences >> Accessibility >> Zoom >> Use scroll gesture with modifier keys to zoom, you can hold down CTRL on your keyboard and then scroll up or down with your mouse's scroll wheel to zoom in and out incrementally. Is that what you are trying to do?

03k64serenity avatar Feb 09 '22 08:02 03k64serenity

Or, are you trying to set it up so that holding CTRL on your keyboard and scrolling up or down turns Zoom on/off completely, moving all the way from it being zoomed in to off and vice versa?

If this is what you're after, have you configured the Zoom In/Out keyboard shortcut at System Preferences >> Keyboard >> Shortcuts >> Accessibility >> Zoom >> Turn zoom on/off / Zoom in to Command+=?

Have you checked the box at System Preferences >> Accessibility >> Zoom >> Use keyboard shortcuts to zoom? Do you see it showing Command+= assigned to the desired action?

03k64serenity avatar Feb 09 '22 08:02 03k64serenity

He is not talking about Macos global zoom behavior with a "magnify glass" effect. He is talking about being able to turn CTRL+ScrollUP/ScrolLDown into CTRL+ Minus and CTRL+ Plus

(which in chrome, or chromium based applications, uses the Build in zoom of the application to increase fontsize etc. )

I can see there is "TO" behavior to do Scrolling, but i see no triggers for "FROM" scrollup behavior.

I did find a google Chrome extensions that allows this behavior, and lets you set your own keybind for it, but this still doesnt give me this functionality in programs such as VSCode :( https://chrome.google.com/webstore/detail/zoomba/oifpkclgpipladdnaioaehmmccmljblh/related

WybeBosch avatar Feb 21 '22 18:02 WybeBosch

I modified a script to do that in a related issue: #1362 It works on chrome and vscode.

alexDevBR avatar Jul 08 '22 19:07 alexDevBR

I have this working as you describe, albeit with a different key binding, using Karabiner elements. It's a two step process.

  1. Got to https://ke-complex-modifications.pqrs.org and import "Mouse Keys Mode v4 (rev 2)". Enable it within Karabiner's Complex Modifications: Screen Shot 2022-09-11 at 14 11 33

  2. In accessibility, change to the following: image

Now, to zoom in you'll just need to hit (in succession) command + d + s (+ f optionally for faster zooming). While holding these three keys down, you can tap j and k (or hold if you have enabled repeating keys) to zoom in and out. Enjoy!

daniel-stafford avatar Sep 11 '22 12:09 daniel-stafford