Mapbox Right Mouse Click - leaflet

I'm using the L.map contextmenu to listen for right clicks on the map. However, when I right click the map, in addition to the contextmenu event being fired, it also fires the mousedown event and the MouseEvent data does not indicate which mouse button was pressed, so the "left press" code is executed in addition to the "right press" code. Is there a way to get around this?
Thanks in advance.
Tony

If you want to listen to left click you must use the click event, if you want to listen for rightclick you must use the contextmenu event. The mousedown event fires on left and right click. It does exactly what it's supposed to do.

Related

OnClick events starts on leaving the finger

is there a way to trigger onclick events by the on click and not by leaving the finger because the onclick event only triggers when you leave the finger from the button.
Thanks
These are some of the helper UI that I collected a long time ago and I don't remember the source of them
I uploaded it to github now
There is a script name is ( LeanButton )
From which you can choose OnClick or DownClick
Like Image
You can use the GetMouseButtonDown. https://docs.unity3d.com/ScriptReference/Input.GetMouseButtonDown.html
Or potentially GetMouseButton
https://docs.unity3d.com/ScriptReference/Input.GetMouseButton.html
Depending if you want your event to happen once on pressed or repeatedly while pressed.
OnClick is triggered on MouseUp after MouseDown on the same object.
You can use PointerDown() that is sent the first time a finger touches the screen or a mouse button is pressed.

How to have fusioncharts time marker mouse click event keep tooltip open

I'd like to be able to trigger a mouse click event on this: https://www.fusioncharts.com/dev/fusiontime/fusiontime-component/time-marker so that the tooltip does not close.
Is there anyway to do this?
As of now FusionCharts do not have support for triggering timeMarkerClick or timeMarkerRollover event to keep the tool-tip of the time marker open without any actual timeMarkerClick or timeMarkerRollover action over it.
Hope this would help.

WPF MouseEnter does not fire when MouseButton is Pressed

In short: If any mouse button is Pressed when the mouse enters a WPF window, all mouse events are ignored regardless of whether the mouse is captured by any process.
The Challenge
Create two WPF 4.5 projects. In the first one, add a Border with a MouseDown handler. Inside that handler, do everything you can think of to release mouse capture:
this.ReleaseMouseCapture();
element.ReleaseMouseCapture(); // "sender"
Mouse.Capture(null);
while (Mouse.Captured != null)
Mouse.Captured.ReleaseMouseCapture();
ReleaseCapture(); //Win32.ReleaseCapture()
In the other project, add a MouseEnter handler to the default grid that will change its Background.
Start them both up, MouseDown on the border and "drag" to the other window. Until you release the mouse button, the second Window's background will not change.
What's really annoying is that if you stay within the first window, the attempts to "uncapture" the mouse appear to work. Add another element in the first window with a MouseEnter handler, and it will fire just fine. This implies that WPF doesn't know or care about cross-process capture. It just ignores events if any mouse button is in the Pressed state when the mouse first enters an application.
Anyone know if it's possible to have WPF elements respond to mouse events when the mouse was pressed before entering them?

GWT MouseClickEvent vs MouseDownEvent

Is there a standard way to separate MouseClick and MouseDown events in GWT?
If I click and hold button I still get MouseClick event together with MouseUp.
if I just click I still get MouseDown event together with MouseClick.
These events have some differences. Handle events which you need in a particular situation.
The thing is that in a general case ClickEvent includes MouseDownEvent and MouseUpEvent and cannot take place without of them. MouseDownEvent and MouseUpEvent precede ClickEvent. The same way as ClickEvent precedes DoubleClickEvent. But MouseDownEvent doesn't garantee that an ClickEvent will occur.
MouseDownEvent occurs every time when a user presses on one of the mouse buttons inside any element.
MouseUpEvent occurs when a user releases one of any mouse buttons.
and ClickEvent consists of both of these events. ClickEvent occurs when there're both these events on the same element. It's something like a combination of the mouse down and mouse up events. ClickEvent is generated only for the left mouse button unlike MouseDownEvent and MouseUpEvent.
That's ClickEvent is generated when a mouse is down then up while over an elem.
However, the mouse must stay within the same element, otherwise it won't occur.
For example, you pressed mouse down and moved outside of the element and release it. ClickEvent will not generated but MouseDownEvent will in this case.
And if you press mouse down and move outside the element, and move back in, then release it. ClickEvent will occur. And MouseDownEvent with MouseUpEvent will too.
If a user did click then this is the sequence of events:
MouseDownEvent
MouseUpEvent
ClickEvent
ClickEvent fires only after a user has released his mouse button.
Butt there's a way to create ClickEvent without generating of MouseDownEvent and MouseUpEvent:
click event will fire if a user used tab key to move the focus to a link and press Enter, but the MouseDown and MouseUp events will not.
Alternatively, you can open a link without generating ClickEvent:
click right button on a link and select on a item of dropdown list (in this case only MouseDownEvent and MouseUpEvent will fire)
also you can just pick up and drag a link to a new tab

selecting by mouse clicks instead of press-drag action in MFC

I am quite new to MFC. I am currently using the CrectTracker class of MFC to draw a selection rectangle to select an area on a graphic in MFC based application. However, I would like to do the selection using mouse clicks instead of L button press and drag and release action.
Can somebody point me to an example where the crectracker class can be used to select an area using mouse clicks, first click to start the selection and second to end? Or do I have to implement my own OnLButtonUp actions for this?
Thanks.
You need to implement the MouseMove event.
http://msdn.microsoft.com/en-us/library/3158baat%28v=vs.80%29.aspx
This functions gives you 2 Parameters.
Flag : Here you can check the Left Mouse Button is Clicked
Point : Position of the Mouse cursor.