Sublime Forum

Remap Ctrl + mouse wheel

#1

Hello there. I’m using Sublime Text 3, and I want to change Ctrl + mouse wheel to be fast scroller instead of font sizer. :smile: I believe I need this commands:

{ "keys": "pageup"], "command": "move", "args": {"by": "pages", "forward": false} }, { "keys": "pagedown"], "command": "move", "args": {"by": "pages", "forward": true} },

But what’s the right key-words for mouse wheel up and down in Sublime? Thanks.

0 Likes

How to *properly* disable ctrl+scroll zooming?
#2

it would be

	{ "button": "scroll_down", "modifiers": "ctrl"], "command": "move", "args": {"by": "pages", "forward": false} },
	{ "button": "scroll_up", "modifiers": "ctrl"], "command": "move", "args": {"by": "pages", "forward": true} }

and it goes to Packages/User/Default.sublime-mousemap

0 Likes

#3

Yup, this worked. But it’s:

   { "button": "scroll_down", "modifiers": "ctrl"], "command": "move", "args": {"by": "pages", "forward": true} },
   { "button": "scroll_up", "modifiers": "ctrl"], "command": "move", "args": {"by": "pages", "forward": false} }
]

Thanks!

0 Likes

#4

Bump! This doesn’t work anymore. File Packages/User/Default.sublime-mousemap is not there.

I tried to add this in Preferences -> Key bindings - User, but it doesn’t work too:

[
    { "keys": ["ctrl+scroll_down"], "command": "move", "args": {"by": "pages", "forward": false} },
    { "keys": ["ctrl+scroll_up"], "command": "move", "args": {"by": "pages", "forward": true} },
]
0 Likes

#5

scroll_up and scroll_down won’t work in a sublime-keymap file, they have to be in the sublime-mousemap.

Considering that the Default (Windows).sublime-mousemap file contains this:

{ "button": "scroll_down", "modifiers": ["ctrl"], "command": "decrease_font_size" },
{ "button": "scroll_up", "modifiers": ["ctrl"], "command": "increase_font_size" },

I think it is fair to say that you should follow suit.

Create a Packages/User/Default (Windows).sublime-mousemap file and paste in the following:

[
    { "button": "scroll_down", "modifiers": ["ctrl"], "command": "move", "args": { "by": "pages", "forward": true } },
    { "button": "scroll_up", "modifiers": ["ctrl"], "command": "move", "args": { "by": "pages", "forward": false } },
]

Naming it as anything else won’t override the default font size behavior.

2 Likes

[Solved] Is there any manner to paginate with mouse wheel + any key?
Is there any way to ignore whether the Command key is pressed when scrolling?
#6

Nope, doesn’t work. I don’t have Default (Windows).sublime-mousemap file. I don’t have any files that contain mouse in a name. And creating it in Packages/User/ doesn’t work. Maybe I should’ve replace Default (Windows) to something?

0 Likes

#7

works for me. What OS are you using?

0 Likes

#8

Windows 10 x64.

0 Likes

#9

Hi (first post here, thanks, very nice community and platform). @kingkeith is right. You must to create the file into your User folder, as he indicated. My settings is almost the same as the mentioned example, but with an extra option to control the speed:

[
	{ "button": "scroll_down", "modifiers": ["ctrl"], "command": "scroll_lines", "args": {"amount": -40.0 }, "press_command": "" },
	{ "button": "scroll_up", "modifiers": ["ctrl"], "command": "scroll_lines", "args": {"amount": 40.0 }, "press_command": "" }
]

For the record:

1) Create a file named Default (Windows).sublime-mousemap into this folder: C:\Users\Your User\AppData\Roaming\Sublime Text 3\Packages\User.

2) Open the file and paste the code I posted above. That’s it.

No need to restart the program, the effect is immediate.

0 Likes