Key Binds - Middle Mouse Button with Sublime Text 2

纵然是瞬间 提交于 2020-01-01 05:26:08

问题


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" }
]


来源:https://stackoverflow.com/questions/16965652/key-binds-middle-mouse-button-with-sublime-text-2

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!