Key Binds - Middle Mouse Button with Sublime Text

2019-03-28 15:53发布

问题:

Does anybody know if it's possible to bind the middle mouse button to an action in Sublime Text 2?

I know that some mouse interaction is possible, because you can use the back and forward buttons.

Basically, I was going to use this button to upload a file with the sFTP plugin so it would decrease the amount of buttons I would need to press from 3 to 1.

Currently, I have:

{ "keys": ["ctrl+shift+u"], "command": "sftp_upload_file" }

Ideally it would be something like this:

{ "keys": ["mouse4"], "command": "sftp_upload_file" }

回答1:

You can look at the mouse mappings by opening Packages/Default/Default (operating system).sublime-mousemap. You can then change what you want and save it in Packages/User.



回答2:

I figured it out thanks to @MattDMo pointer.

I created a file in

Packages\User\Default (Windows).sublime-mousemap

inside the file I placed

[ 
    { "button": "button3", "modifiers": [], "command": "sftp_upload_file" }
]