Posted 8 years ago by Ralph
Avatar

I like the Mouse Wheel Gesture in the Shared Library, what about creating a similar gesture supporting side buttons X1 and X2?

Microsoft are still in early 90-ties, their MouseBinding only allows MouseActions for Left, Right and Middle button.  Nowadays the X1 and X2 buttons became a standard, but still in order to bind commands to them we have to revert to writing ugly code behind.

Comments (2)

Answer - Posted 8 years ago by Actipro Software Support - Cleveland, OH, USA
Avatar

Hi Ralph,

It's pretty simple to add that.  Just add a class like this:

private class MouseX1ButtonGesture : MouseGesture {
	public override bool Matches(object targetElement, InputEventArgs inputEventArgs) {
		var mouseEventArgs = inputEventArgs as MouseButtonEventArgs;
		return ((mouseEventArgs != null) && (mouseEventArgs.ChangedButton == MouseButton.XButton1));
	}
}


Actipro Software Support

Posted 8 years ago by Ralph
Avatar

Thank you for the code.
Anyway, I still think it would be a good idea to add it to the Shared Libraries just to keep all mouse gestures in one place.

The latest build of this product (v25.1.0) was released 29 days ago, which was after the last post in this thread.

Add Comment

Please log in to a validated account to post comments.