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: 1303 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
|
|
|
Goto Forum:
Current Time: Wed May 14 20:19:52 CEST 2025
Total time taken to generate the page: 0.04005 seconds
|