lua-users home
lua-l archive

[Date Prev][Date Next][Thread Prev][Thread Next] [Date Index] [Thread Index]

On 18/08/2008 16:49, Gavin Wraith wrote:
Thanks for this Philippe. However, I would like to be able to do as many
things as possible without touching the keyboard. It is very
unergonomic to have to be doing a dance from mouse to keyboard, and
pressing three keys simultaneously is probably beyond my digital
capabilities. On my ancient RISC OS system I often have useful sessions
where the keyboard is not used at all. After all, that is what GUIs are all
about. Alas it looks like Windows XP never really took that attitude
on board.

That's funny because some other people swear only by keyboard shortcuts...
I am a mixed guy which uses mouse a lot (selection, drag'n'drop for copy or move) but also the keyboard (Ctrl+D to duplicate line or selection, classical Ctrl+F/H/G and of course Ctrl+C/V/X, etc.).
To each their own.

Now, to go back to topic (and Lua), you can call this functionality in the Lua handler of the double-click event:

  function OnDoubleClick()
    return true	-- Don't let next handler to process event

I made it work by selecting the URL and double-clicking on the http part.
Of course, it is too simplistic, a more robust implementation would extend the selection started by the double-click to the whole URL and check if we have indeed an URL before calling the MenuCommand.

Philippe Lhoste
--  (near) Paris -- France
--  --  --  --  --  --  --  --  --  --  --  --  --  --