Sublime Forum

API: Query Mouse Position

#1

Hey John,
I’ve been playing in an amateurish capacity with the API as a way of cutting my teeth on Python, and generally finding it to be amazing. Thanks for all your hard work at making Sublime so extensible. I wonder, though, if it’d be possible and feasible to add a way to query the current mouse position. Since right-clicking an area of the text doesn’t move the cursor, there’s currently no way that I can see to find out whether the user right-clicked on text pertinent to a package. This makes determining whether contextual menu items are visible or enabled a little hairy, in that users need—as far as, again, I can tell—to first left-click to move the cursor, then right-click to display the menu. If is_visible and is_enabled calls could check whether the mouse is over a certain region of text, this’d be just a bit smoother.

Thanks for considering it! And good luck with the rest of your ST3 work.

0 Likes