Sublime Forum

Maximum click count in sublime-mousemap

#1

Hi all,
I am trying to implement behavior where double-click expands selection, triple-click expands it more, quadruple-click expands it more, etc. (There is some other software I use which has this behavior and it is very useful.) My plan was to edit my sublime-mousemap to add these:

{
    "button": "button1", "count": 2,
    "press_command": "expand_select"
},
{
    "button": "button1", "count": 3,
    "press_command": "expand_select"
},
{
    "button": "button1", "count": 4,
    "press_command": "expand_select"
},
{
    "button": "button1", "count": 5,
    "press_command": "expand_select"
},
...

However, it seems that after you reach triple-click it wraps back around to double-click, and the quadruple-click is never triggered. For example, if you add this to the mousemap:

{
		"button": "button1", "count": 2,
		"press_command": "echo",
		"press_args": {"message": 2}
	},
	{
		"button": "button1", "count": 3,
		"press_command": "echo",
		"press_args": {"message": 3}
	},
	{
		"button": "button1", "count": 4,
		"press_command": "echo",
		"press_args": {"message": 4}
	},
	{
		"button": "button1", "count": 5,
		"press_command": "echo",
		"press_args": {"message": 5}
	},

and then repeatedly click, it prints this:

{'message': 2}
{'message': 3}
{'message': 2}
{'message': 3}
{'message': 2}
{'message': 3}

Does anyone know what’s going wrong or if there some way of getting around this?

Thanks

0 Likes

#2

There’s no official documentation on that particular resource type. As such I’m not sure if there’s a hard coded upper limit or perhaps it’s window of detection time for detecting the clicks is not large enough.

It might be worth logging it as an issue (in ST4, from the Help menu you can choose to report a bug). That will bring it to the dev’s attention so they can either verify that it’d a bug (in which case you can make a feature request) or resolve the issue.

1 Like

#3

Thanks, submitted:

0 Likes