Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Key Binds - Middle Mouse Button with Sublime Text 2

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" }
like image 979
pleshy Avatar asked Jun 06 '13 15:06

pleshy


2 Answers

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.

like image 66
MattDMo Avatar answered Oct 13 '22 00:10

MattDMo


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" }
]
like image 32
pleshy Avatar answered Oct 12 '22 23:10

pleshy