<?xml version="1.0" encoding="utf-8"?>
<rss version="2.0" xml:base="http://community.activestate.com" xmlns:dc="http://purl.org/dc/elements/1.1/">
<channel>
 <title>ActiveState Community Site - Middle Click to set Bookmarks - Comments</title>
 <link>http://community.activestate.com/forum-topic/middle-click-set-bookmarks</link>
 <description>Comments for &quot;Middle Click to set Bookmarks&quot;</description>
 <language>en</language>
<item>
 <title>Middle Click to set Bookmarks</title>
 <link>http://community.activestate.com/forum-topic/middle-click-set-bookmarks</link>
 <description>&lt;p&gt;Here&#039;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 &quot;After file open&quot;.  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.&lt;/p&gt;
&lt;div class=&quot;geshi-block&quot;&gt;
&lt;div class=&quot;geshifilter javascript&quot; style=&quot;font-family: monospace;&quot;&gt;&lt;span style=&quot;color: #009900; font-style: italic;&quot;&gt;/* add middle click support for adding/removing a bookmark */&lt;/span&gt;&lt;br /&gt;
&lt;span style=&quot;color: #003366; font-weight: bold;&quot;&gt;var&lt;/span&gt; view = ko.&lt;span style=&quot;color: #006600;&quot;&gt;views&lt;/span&gt;.&lt;span style=&quot;color: #006600;&quot;&gt;manager&lt;/span&gt;.&lt;span style=&quot;color: #006600;&quot;&gt;currentView&lt;/span&gt;;&lt;br /&gt;
view.&lt;span style=&quot;color: #006600;&quot;&gt;addEventListener&lt;/span&gt;&lt;span style=&quot;color: #66cc66;&quot;&gt;&amp;#40;&lt;/span&gt;&lt;span style=&quot;color: #3366CC;&quot;&gt;&amp;quot;click&amp;quot;&lt;/span&gt;, &lt;span style=&quot;color: #003366; font-weight: bold;&quot;&gt;function&lt;/span&gt; &lt;span style=&quot;color: #66cc66;&quot;&gt;&amp;#40;&lt;/span&gt;event&lt;span style=&quot;color: #66cc66;&quot;&gt;&amp;#41;&lt;/span&gt; &lt;span style=&quot;color: #66cc66;&quot;&gt;&amp;#123;&lt;/span&gt;&lt;br /&gt;
&amp;nbsp; &amp;nbsp; &lt;span style=&quot;color: #000066; font-weight: bold;&quot;&gt;if&lt;/span&gt; &lt;span style=&quot;color: #66cc66;&quot;&gt;&amp;#40;&lt;/span&gt;event.&lt;span style=&quot;color: #006600;&quot;&gt;button&lt;/span&gt; == &lt;span style=&quot;color: #CC0000;&quot;&gt;1&lt;/span&gt; &amp;amp;&amp;amp; event.&lt;span style=&quot;color: #006600;&quot;&gt;detail&lt;/span&gt; == &lt;span style=&quot;color: #CC0000;&quot;&gt;1&lt;/span&gt;&lt;span style=&quot;color: #66cc66;&quot;&gt;&amp;#41;&lt;/span&gt; &lt;span style=&quot;color: #66cc66;&quot;&gt;&amp;#123;&lt;/span&gt;&lt;br /&gt;
&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; ko.&lt;span style=&quot;color: #006600;&quot;&gt;commands&lt;/span&gt;.&lt;span style=&quot;color: #006600;&quot;&gt;doCommand&lt;/span&gt;&lt;span style=&quot;color: #66cc66;&quot;&gt;&amp;#40;&lt;/span&gt;&lt;span style=&quot;color: #3366CC;&quot;&gt;&amp;quot;cmd_bookmarkToggle&amp;quot;&lt;/span&gt;&lt;span style=&quot;color: #66cc66;&quot;&gt;&amp;#41;&lt;/span&gt;;&lt;br /&gt;
&amp;nbsp; &amp;nbsp; &lt;span style=&quot;color: #66cc66;&quot;&gt;&amp;#125;&lt;/span&gt;&lt;br /&gt;
&lt;span style=&quot;color: #66cc66;&quot;&gt;&amp;#125;&lt;/span&gt;, &lt;span style=&quot;color: #003366; font-weight: bold;&quot;&gt;true&lt;/span&gt;&lt;span style=&quot;color: #66cc66;&quot;&gt;&amp;#41;&lt;/span&gt;;&lt;/div&gt;
&lt;pre class=&quot;geshi-plain&quot;&gt;/* add middle click support for adding/removing a bookmark */
var view = ko.views.manager.currentView;
view.addEventListener(&amp;quot;click&amp;quot;, function (event) {
    if (event.button == 1 &amp;amp;&amp;amp; event.detail == 1) {
        ko.commands.doCommand(&amp;quot;cmd_bookmarkToggle&amp;quot;);
    }
}, true);&lt;/pre&gt;&lt;/div&gt;
&lt;p&gt;A bug has been added for a better implementation later:&lt;br /&gt;
&lt;a href=&quot;http://bugs.activestate.com/show_bug.cgi?id=75317&quot; title=&quot;http://bugs.activestate.com/show_bug.cgi?id=75317&quot;&gt;http://bugs.activestate.com/show_bug.cgi?id=75317&lt;/a&gt;&lt;/p&gt;
</description>
 <comments>http://community.activestate.com/forum-topic/middle-click-set-bookmarks#comments</comments>
 <category domain="http://community.activestate.com/forums/komodo-extensions-0">Komodo Macros and Extensions</category>
 <category domain="http://community.activestate.com/os/all-any">All / Any</category>
 <pubDate>Mon, 03 Mar 2008 17:34:18 -0800</pubDate>
 <dc:creator>shanec</dc:creator>
 <guid isPermaLink="false">1999 at http://community.activestate.com</guid>
</item>
</channel>
</rss>
