Forum > LCL

[solved] triple click

(1/2) > >>

dbannon:
I'd like to detect a triple click in a control that does not support it. Seems easy enough to detect a double click, and if a third click happens in, say, 500mS, it must be a triple. I'll be overwriting anything the double click did so, seems safe :


--- Code: Pascal  [+][-]window.onload = function(){var x1 = document.getElementById("main_content_section"); if (x1) { var x = document.getElementsByClassName("geshi");for (var i = 0; i < x.length; i++) { x[i].style.maxHeight='none'; x[i].style.height = Math.min(x[i].clientHeight+15,306)+'px'; x[i].style.resize = "vertical";}};} ---const CountSinceDouble : qword = 0; procedure TForm.KMemo1MouseDown(Sender : TObject;  Button : TMouseButton; Shift : TShiftState; X, Y : Integer);begin    if ssDouble in Shift then        CountSinceDouble := gettickcount64()    else if (gettickcount64() - CountSinceDouble) < 500  then        showmessage('triple click');end;   

I don't want to delve too deeply into KMemo, the control in question, it's several layers down from TControl so restoring its ssTriple is too much trouble. Anyone know a better way or see an inherent flaw in what I have done ?

Thanks,

Davo

Martin_fr:
Not sure, but should multi clicks occur in the approx same location? => If the 3rd click appears some other place... E.g. another line or paragraph...

Or if there was a click to another control inbetween... (ok, needs a very fast user)

dbannon:
Hmm, I cannot both move and triple click. But I'm using a touchpad.  Might need to do some experiments with a real mouse. 

Good point Martin.

In the event of movement, I would have only the coordinates of the third click available. But I'd think that would probably the correct ones to select anyway, wouldn't you ?

Will report back ...

Davo

Tony Stone:
Does your touchpad have a real right and left button?  My Dell Laptop has them but they are annoying to press.  Usually I do clicks by tapping or double tapping anywhere on the touchpad.  But when I need to do a real triple click I almost always have to use the physical touch pad buttons.  Like in my browser to type in a new URL I use the button to triple click and select all of the text in the address bar.  So just letting you know in other applications on another popular Laptop with a touchpad "triple taps" don't really work as they should.


--- Quote from: dbannon on January 15, 2025, 12:23:40 pm ---Hmm, I cannot both move and triple click. But I'm using a touchpad.  Might need to do some experiments with a real mouse. 

Good point Martin.

In the event of movement, I would have only the coordinates of the third click available. But I'd think that would probably the correct ones to select anyway, wouldn't you ?

Will report back ...

Davo



--- End quote ---

jamie:
That should built from a tcontrol which does have a triple click message u should be able to capture if u subclass the control locally there intercepting the window procedure.

Navigation

[0] Message Index

[#] Next page

Go to full version