On Fri, 5 Apr 2013 08:18:02 -0700 (PDT)
brian <[email protected]> wrote:

>  
> 
> I'd like to have the following functionality:
> 
>    if double click node and node is url:
> 
>      open url
> 
>    else
> 
>      normal double click 
> 
>  if shift+double click node and node is url:
> 
>    then will edit node like normal

First look at the bookmarks.py plugin, this is sort of what it does.
Double click is tricky - to distinguish between a single and a double
click you need a timer...

[click]
start timer to execute single click action in 300 ms
[click withing 300 ms]
cancel timer for single click action, execute double click action

and I'm not sure if we're doing that currently, there was some concern
about the interaction of timers and the rest of the focus / event code.

but I see in mySettings I have 

@bool bookmarks-grab-dblclick = True
and
@bool single_click_auto_edits_headline = True
and
@bool quickmove_timer_hack = True

single_click_auto_edits_headline means that a single click
*on an already selected node* edits the headline.

bookmarks-grab-dblclick just does this:

    if g.app.config.getBool('bookmarks-grab-dblclick'):
        g.registerHandler('icondclick1', lambda t,k: open_bookmark(k))

which ideally could be handled as a "key" binding, and
quickmove_timer_hack... does not appear to do anything :)

So if I double click on a node under a @bookmarks ancestor, the node's
opened as an url (typically the url in the first line of the body
because it looks neater).  If it's not under a @bookmarks ancestor,
double click edits it.  And two single clicks edit it.  The funky part
is that if the node's already selected, double click doesn't open the
url because editing starts instead.  I'm so used to clicking off and on
the node to get around this it doesn't bother me.  But ideally the
single click action wouldn't fire until we've waited to exclude the
possibility of a double click.

Aren't you glad you asked :-)

Cheers -Terry

>  Would I need to write a plugin for this or is their an easier way? If 
> plugin is the route to go, can you give me some high level direction on 
> writing it. I'm looking for the interface with LEO and not the python 
> programming part. 
> 
> 
>  Brian
> 

-- 
You received this message because you are subscribed to the Google Groups 
"leo-editor" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to [email protected].
To post to this group, send email to [email protected].
Visit this group at http://groups.google.com/group/leo-editor?hl=en.
For more options, visit https://groups.google.com/groups/opt_out.


Reply via email to