ActiveState Powered by ActiveState

ActiveState Community


Middle Click to set Bookmarks

Posted by shanec on 2008-03-03 18:34
OS: All / Any

Here's a quick and dirty macro you can use to toggle bookmarks with a middle click on the mouse. It works best clicking in the document area, not on the margins. Create a macro, and in the macro triggers, select "After file open". This will get executed with each file open, attaching a mouse handler to the buffer that will initiate a bookmark toggle when you middle click the mouse.

/* add middle click support for adding/removing a bookmark */
var view = ko.views.manager.currentView;
view.addEventListener("click", function (event) {
    if (event.button == 1 && event.detail == 1) {
        ko.commands.doCommand("cmd_bookmarkToggle");
    }
}, true);
/* add middle click support for adding/removing a bookmark */
var view = ko.views.manager.currentView;
view.addEventListener("click", function (event) {
    if (event.button == 1 && event.detail == 1) {
        ko.commands.doCommand("cmd_bookmarkToggle");
    }
}, true);

A bug has been added for a better implementation later:
http://bugs.activestate.com/show_bug.cgi?id=75317

-->