Sublime Forum

[Question] Show mouse buttons in console like keys

#1

1. Briefly

I can not find, how I can to see mouse buttons clicks in console.

2. Detail

If I insert in console sublime.log_input (True), I can see keys, that I press, for example:

chr evt: q (0x71)
key evt: browser_search
key evt: control+super+y

Can I also see in console clicking to supported in mousemap mouse buttons — button1, button2, … , button5?

Thanks.

0 Likes

#2

As far as I know this isn’t possible. log_input only seems to log keyboard input despite seeming universal from its name.

1 Like

#3

I guess that mousemaps aren’t really designed to be touched:

  1. there is no menu entry to get to them
  2. they don’t support contexts so plugins should NEVER override them
  3. there is no mouse input logging for debug purposes

that said, I can see that it would be useful, for mice with many buttons, to add mappings for those extra buttons, and I personally change the ctrl+mousewheel behavior to scrolling pages rather than adjusting font size.

2 Likes

#4

I made a mistake, Sublime Text show mouse clicks in console. Example:

chr evt: q (0x71)
command: drag_select {"event": {"button": 1, "x": 317.5, "y": 535.5}}
command: word_highlight_click {"event": {"button": 1, "x": 317.5, "y": 535.5}}
key evt: browser_search
key evt: shift+control+y

"button": 1 — left mouse click, "button": 2 — right mouse click, and so on.

Thanks.

0 Likes

#5

ah right, sublime.log_commands(True) will show the mouse event passed to the command, if it is bound in the .sublime-mousemap file, but it still doesn’t help for logging when the button isn’t mapped to a command (yet).

2 Likes

#6

@kingkeith, feature request in Sublime Text Core?

Thanks.

0 Likes