extra mouseup event needed after firing e.handled

Dec 9, 2013 at 4:10 PM
I am writing an application that handles mouse gestures. When my app detects that a gesture is being performed with the right mouse button, it sets a boolean value to true.

In my mouseup event I have the following vb code:

If Suppress Then
        Suppress = False
        e.Handled = True
else
        e.handled = false
end if

This works nicely not to show a context menu in other windows applications when I perform a mouse gesture. However, it does not reset the mouseup fired flag. The only way I can get it reset is to perform an actual right-click which defeats the purpose of using e.handled in the first place.

Is this a bug or am I missing something
Dec 9, 2013 at 4:45 PM
Edited Dec 9, 2013 at 4:47 PM
I came up with a very crude workaround, but would appreciate if someone can give me a better way to handle this.

for my workaround I created a wpf window with 1 percent opacity that starts up right underneath the mouse position and simulates a mouseup procedure.

so basically, now when i perform a gesture with my right mouse button, the mouseup event suppresses with e.handled = True and resets the suppress boolean value to false.
Imediatly after a 10 by 10 pixel wpf window with 1 percent opacity is opened underneath my mouse cursor and simulates mouseup. since the suppress boolean value is now false, the mouseup event sets e.handled to false, but because this happens on the wpf form no context menu pops up.

As I said it is crude, but it works.

I would love to hear back from you for a better solution.
Dec 10, 2013 at 4:03 PM
does anyone monitor these posts?
Dec 10, 2013 at 6:11 PM
Yes, anyone who subscribed.
This is an open source project and unfortunatelly there is no guaranteed reaction time.
If you suspect a bug or have an improvement proposal feel free to create an issue in issues section.
Regards George