Sublime Forum

How to *properly* disable ctrl+scroll zooming?

#1

I’m on Windows 10, and using ST 4 (build 4126).

I recently started noticing (thanks I think to some windows/driver changes) an annoying “feature” that affects certain apps, Sublime (and my terminal) included. It never used to happen, but I’m sure Windows definitely changed something in the last 6 months or to make this start happening. But I haven’t had any luck trying to find support info on undoing/disabling that Windows change, though. So I’m stuck trying to “fix” it on a per-app basis.

I’m used to being able to scroll on the touchpad (two-finger up/down swipe), with momentum (flicking up or down, basically). This natural scrolling movement is quite nice, IMO.

But what now seems to happen is, if I press the ctrl key while the scrolling is happening (even just the momentum movement after the swipe is done), windows interprets this still as a scroll-to-zoom gesture, and Sublime responds accordingly by zooming the font size way down or up, respectively. There are some apps where ctrl+scroll zooming is nice, like image editors. But I don’t like it at all in text apps where scrolling is common.

I don’t care to have any scroll-to-zoom capabilities in Sublime, so I wanted to try to disable it entirely in Sublime. I do however want to keep ctrl +/- zooming working, as I use that regularly! Anyway, I couldn’t find any setting for disabling the scroll-to-zoom (apologies if missed).

Some googling turned up this stack exchange answer, and that mostly seems to work for me. The “solution” amounts to putting the following settings into a manually created settings file:

[
  // Change font size with ctrl+scroll wheel
  { "button": "scroll_down", "modifiers": ["ctrl"], "command": "null" },
  { "button": "scroll_up", "modifiers": ["ctrl"], "command": "null" }
]

However, there’s one remaining quirk which I’d still love to resolve, if possible. If I scroll-flick upward or downward, and then hit the ctrl key, it no longer zooms, but now it just abruptly stops the scroll momentum movement.

I would prefer if Sublime just let the scrolling continue unaffected. I’m guessing that the null command is being interpreted by Sublime to step in and do… nothing.

Is there some way to resolve this? Is there a setting to tell Sublime to ignore scroll-zoom that doesn’t interfere with scrolling? Is there a different value besides null in the above settings that would prevent the abrupt stopping of scroll momentum?


EDIT: here’s another likely deal breaker for me, for the above approach: it disables ALL scrolling while the ctrl key is held down. I am regularly in the habit of holding down ctrl+shift keys, scrolling to a different location in the document, then clicking to a certain spot, to have the highlight applied from the previous caret position to the new one. This is now impossible to do, since I cannot touchpad-scroll at all while holding the ctrl key. Ugh. Gonna have to delete these settings, probably.

0 Likes

#2

I found this after a bit of googling. It looks like it might help; what I’m hoping is that by me answering your question that’ll rally the forces so that someone who knows what they’re talking about will come and help you. :wink:

0 Likes

#3

Thanks for posting that link, that does offer interesting insight.

I went to the Command Palette and did the “View Package File” and opened up the default windows mousemap. Sure enough, the bindings for “increase_font_size” and “decrease_font_size” commands are in there for ctrl scroll-up/down. So that confirms why creating the AppData\Roaming\Sublime Text 3\Packages\User\Default (Windows).sublime-mousemap file to override those command mappings to "null" has an affect (though not quite what I hope).

It seems like what I want though is to unset them rather than map them to some other command, because otherwise I don’t know what command corresponds to “just keep doing normal inertia/momentum scrolling”. It’s clear that "null" means “stop and do nothing” rather than “ignore this mapping and continue on as normal”.

Hopefully someone speaks up and helps clarify what to do!

0 Likes

#4

For posterity, according to the release notes, build 4142 just added a “noop” command for keybindings (and I assume mouse bindings).

It’s unclear to me how that’s any different from “null”. From what I can tell, they both do the same thing. But maybe “noop” is the more proper setting now than “null”. Shrugs.

Unfortunately, the observed behavior still means that it disables any scrolling while holding the ctrl key. Annoying! Hope someday they add an “unset” option.

0 Likes

#5
	{ "button": "scroll_down", "modifiers": ["ctrl"], "command": "noop" },
	{ "button": "scroll_up", "modifiers": ["ctrl"], "command": "noop" },

is working as expected for me. null can’t work as it’s not a valid command and thus won’t block the execution of other keybindings.

"noop" isn’t expected to do what you want with scrolling though fwiw. It’ll pass the scroll events back to the OS, not letting the scroll area handle them as a scroll.

0 Likes