Sublime Forum

Tune the Ctrl+Tab behavior

#1

Normally Ctrl+Tab triggers next_view_in_stack, which indeed is convenient, but it’s not that intuitive while hitting Tab with the Ctrl held down - personally I think it’s better to trigger next_view in this case.
I don’t find any way to bind different command for holding the Ctrl key or not, searched for the context field and there is not something like key_is_down either, so I came up with a little AHK script to do this: AHK script to tune the Ctrl+Tab behavior in Sublime Text.

The end result would be something like this:
Ctrl + Tab : next_view_in_stack
Ctrl(holding) + Tab: next_view
Ctrl(holding) + Shift + Tab: prev_view

Hope this might help someone.
Cheers.

0 Likes

#2

It took some time until I understood what you were trying to achieve but the AHK script clarified it well enough.

It’s a very interesting idea but you’re right, there is no way to detect if a key is is still being held down using only Sublime Text features. However, I think you can do it by using the ctypes module or at least github.com/facelessuser/Pywin32 via plugin. I don’t think it will turn out easier than your AHK script though.

1 Like