Mouse Bindings
The mousemap files (which have the extension .sublime-mousemap) control what commands are executed when a user performs an action with a mouse, e.g. clicking a mouse button, scrolling the scroll wheel, etc.
File Format
Mousmap files are JSON files, following the naming schema of Keybindings.
Here is a small excerpt from Default/Default (Windows).sublime-mousemap:
[
// Basic drag select
{
"button": "button1", "count": 1,
"press_command": "drag_select"
},
{
"button": "button1", "count": 1, "modifiers": ["ctrl"],
"press_command": "drag_select",
"press_args": {"additive": true}
},
{
"button": "button1", "count": 1, "modifiers": ["alt"],
"press_command": "drag_select",
"press_args": {"subtractive": true}
},
]Following are the keys that a single JSON entry in a mousemap file can take.
buttonThe name of the button.
This defines the name of the button. There can be upto 16 buttons,
button1tobutton16along withscroll_up&scroll_downfor the scroll wheel.modifiersA list of modifier keys.
This defines a list of modifiers keys that have to be pressed simultaneously (along with the corresponding button click) for the command to be triggered, e.g.
["ctrl", "alt"]. A list of all the modifier keys can be found in the keybindings section on Modifiers.countThe count of the button press.
This defines the number of times the button has to be pressed for the corresponding
commandto trigger. Defaults to1.commandThe
commandto execute.This defines the command to be executed when the corresponding button is released.
argsThe arguments for
command.This is a mapping of arguments to be passed on to the
command.press_commandThe
press_commandto execute.This defines the command to be executed when the corresponding button is pressed.
press_argsThe arguments for
press_command.This is a mapping of arguments to be passed on to the
press_command.