Recent

Author Topic: How can i invoke a UserCommand with doubble click of left mouse button  (Read 3428 times)

Pascal

  • Hero Member
  • *****
  • Posts: 932
Hallo,

how can i invoke a UserCommand with doubble click of left mouse button?

This code in constructor of own subclass doesn't work, while this works for keyboard shortcurts:
Code: [Select]
  with Keystrokes.Add do begin
    Command    := ecGoTo;
    Key        := VK_LBUTTON;
    Shift      := [ssDouble, ssLeft];
    ShiftMask  := [];
  end;


Regards
laz trunk x64 - fpc trunk i386 (cross x64) - Windows 10 Pro x64 (21H2)

Martin_fr

  • Administrator
  • Hero Member
  • *
  • Posts: 12297
  • Debugger - SynEdit - and more
    • wiki
Re: How can i invoke a UserCommand with doubble click of left mouse button
« Reply #1 on: September 23, 2015, 09:07:20 pm »
keystrokes will not do that.

there is something called mouseActions (also search wiki) and it must be enabled via the MouseOptions (enum / in object inspector)

mouseactions are also in object inspector, you need to choose if you want text only or gutter click also, or selection click only (see wiki for details)

Mouse actions can execute a syncommand (you may however have to specify it as integer)

Pascal

  • Hero Member
  • *****
  • Posts: 932
Re: How can i invoke a UserCommand with doubble click of left mouse button
« Reply #2 on: September 23, 2015, 11:00:08 pm »
Sorry Martin_fr,

i wasn't able to find anything suitable in the wiki. Can you post a Link?

Regards
Pascal
laz trunk x64 - fpc trunk i386 (cross x64) - Windows 10 Pro x64 (21H2)

Martin_fr

  • Administrator
  • Hero Member
  • *
  • Posts: 12297
  • Debugger - SynEdit - and more
    • wiki
Re: How can i invoke a UserCommand with doubble click of left mouse button
« Reply #3 on: September 24, 2015, 09:13:31 am »
http://wiki.lazarus.freepascal.org/IDE_Window:_EditorMouseOptionsAdvanced

this is how to do it in the IDE, but the structures are the same in code.


the key/command goes in one of the option fields. I have to search that myself.

 

TinyPortal © 2005-2018