Overview
Examples
Screenshots
Comparisons
Applications
Download
Documentation
Tutorials
Bazaar
Status & Roadmap
FAQ
Authors & License
Forums
Funding Ultimate++
Search on this site
Search in forums












SourceForge.net Logo
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 Go to next message
Tom1
Messages: 1217
Registered: March 2007
Senior 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 #56742 is a reply to message #56736] Fri, 09 April 2021 10:22 Go to previous messageGo to next message
mirek is currently offline  mirek
Messages: 13986
Registered: November 2005
Ultimate Member
This is a good catch, however I have rather fixed it at the source (gtk code). Please check.

(Note upptst/HoldTriple is simple testcase created for this)
Re: *Triple() mouse event issue [message #56750 is a reply to message #56742] Fri, 09 April 2021 16:27 Go to previous message
Tom1
Messages: 1217
Registered: March 2007
Senior 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
Previous Topic: *Hold() mouse events only work for widgets at top-left corner
Next Topic: Explore widgets
Goto Forum:
  


Current Time: Fri Jun 21 23:22:03 CEST 2024

Total time taken to generate the page: 0.02053 seconds