How do I detect touch and hold input (right click) on the MapView control?

199
1
Jump to solution
04-11-2022 03:37 AM
LewisSmith
New Contributor II

It took a while to realise that the MapView control doesn't behave like standard WPF controls, since they trigger mouse, touch and stylus events consistently for all inputs, meaning you only have to implement mouse event handlers for any input type (unless using input-specific features).

I have tried detecting touch down and touch up, then triggering an event if it's longer than a certain time and in the same approximate location. This works when simulating touch input with the mouse (since I don't have a touch screen to test with) but when users with a real touch screen try it the windows right click box appears, but nothing happens.

Is this even possible while the esri MapView doesn't behave consistently with other WPF controls?

0 Kudos
1 Solution

Accepted Solutions
LewisSmith
New Contributor II

I've discovered that StylusSystemGesture when Gesture == RightTap allows me to detect a touch right click.

Hope it helps someone else.

View solution in original post

0 Kudos
1 Reply
LewisSmith
New Contributor II

I've discovered that StylusSystemGesture when Gesture == RightTap allows me to detect a touch right click.

Hope it helps someone else.

0 Kudos