Home » U++ Library support » U++ Widgets - General questions or Mixed problems » *Triple() mouse event issue
*Triple() mouse event issue [message #56736] |
Thu, 08 April 2021 13:01  |
Tom1
Messages: 1301 Registered: March 2007
|
Ultimate Contributor |
|
|
Hi,
LeftTriple(), MiddleTriple() and RightTriple() mouse events do not work well in Linux. It is nearly impossible to fire a triple click in Linux e.g. to select a row in editor. (Well sometimes I get lucky and it happens.) The reason for the trouble is that all successive clicks after the first one come in as DOUBLE events instead of alternating DOWN events and cannot, therefore, be translated to TRIPLE events with current tracking of DOWN events.
In Windows, the first TRIPLE is coming in as DOWN, and is correctly identified, but the next one is a DOUBLE again and therefore we get alternating DOUBLE/TRIPLE events for a longer series of successive clicking.
The following change in Ctrl::DispatchMouse() in CtrlMouse.cpp fixes both Linux and Windows multi click (3 or more in series) behavior to always result in *Triple() events only:
if(e == LEFTDOUBLE) {
if(sDistMax(leftdblpos, p) < GUI_DragDistance() && sDblTime(leftdbltime))
e = LEFTTRIPLE;
leftdbltime = msecs();
leftdblpos = p;
UPP::SetTimeCallback(GetKbdDelay(), callback(&Ctrl::LRep), &mousepos);
repeatTopCtrl = this;
}
if(e == RIGHTDOUBLE) {
if(sDistMax(rightdblpos, p) < GUI_DragDistance() && sDblTime(rightdbltime))
e = RIGHTTRIPLE;
rightdbltime = msecs();
rightdblpos = p;
UPP::SetTimeCallback(GetKbdDelay(), callback(&Ctrl::RRep), &mousepos);
repeatTopCtrl = this;
}
if(e == MIDDLEDOUBLE) {
if(sDistMax(middledblpos, p) < GUI_DragDistance() && sDblTime(middledbltime))
e = MIDDLETRIPLE;
middledbltime = msecs();
middledblpos = p;
UPP::SetTimeCallback(GetKbdDelay(), callback(&Ctrl::MRep), &mousepos);
repeatTopCtrl = this;
}
Best regards,
Tom
EDIT: Fixed typos in text...
[Updated on: Thu, 08 April 2021 17:49] Report message to a moderator
|
|
|
|
Re: *Triple() mouse event issue [message #56750 is a reply to message #56742] |
Fri, 09 April 2021 16:27  |
Tom1
Messages: 1301 Registered: March 2007
|
Ultimate Contributor |
|
|
You are right; It's certainly better to fix it there.
It works now just the same way as in Windows. I tested with my own code as I don't have upptst here, just the default: examples, reference, tutorial and uppsrc.
Thanks and best regards,
Tom
|
|
|
Goto Forum:
Current Time: Sat Apr 26 20:22:21 CEST 2025
Total time taken to generate the page: 0.03688 seconds
|