Answered by:
About GestureRecognizer

Question
-
Hi all,
I want to produce a Holding action by mouse, and the code is at the following, but it can't work, how to fix it?
GestureRecognizer gestureRecognizer = new Windows.UI.Input.GestureRecognizer(); gestureRecognizer.GestureSettings = Windows.UI.Input.GestureSettings.HoldWithMouse | GestureSettings.Hold; gestureRecognizer.Holding+=gestureRecognizer_Holding;
Wednesday, August 14, 2013 1:35 AM
Answers
-
Do you mean you don't see the gestureRecognizer_Holding event triggered ? If the answer is yes, then please check whether you're also handling the PointerPressed, PointerMoved and PointerReleased event handlers for the same control for which you're trying to detect holding. Please take a look at the Windows 8 gestures sample.
- Ram
If a post answers your question, please click "Mark As Answer" on that post and "Mark as Helpful".- Edited by Ramprasath R Wednesday, August 14, 2013 3:50 AM
- Marked as answer by Xiaoliang Chen - MSFTModerator Tuesday, August 20, 2013 6:34 AM
Wednesday, August 14, 2013 3:50 AM -
Hi dugufly ,
Welcome to MSDN forum!
Touch can produce a Holding action, but mouse devices generally can't. For more info, see Quickstart: Touch input.
There is a way to treat mouse actions as hold actions if you use your own GestureRecognizer and specify HoldWithMouse in settings.
There is a link below:
http://msdn.microsoft.com/en-us/library/windows/apps/windows.ui.xaml.uielement.holding
Best Regards!
- Marked as answer by Xiaoliang Chen - MSFTModerator Tuesday, August 20, 2013 6:34 AM
Thursday, August 15, 2013 3:34 AMModerator
All replies
-
Do you mean you don't see the gestureRecognizer_Holding event triggered ? If the answer is yes, then please check whether you're also handling the PointerPressed, PointerMoved and PointerReleased event handlers for the same control for which you're trying to detect holding. Please take a look at the Windows 8 gestures sample.
- Ram
If a post answers your question, please click "Mark As Answer" on that post and "Mark as Helpful".- Edited by Ramprasath R Wednesday, August 14, 2013 3:50 AM
- Marked as answer by Xiaoliang Chen - MSFTModerator Tuesday, August 20, 2013 6:34 AM
Wednesday, August 14, 2013 3:50 AM -
Hi dugufly ,
Welcome to MSDN forum!
Touch can produce a Holding action, but mouse devices generally can't. For more info, see Quickstart: Touch input.
There is a way to treat mouse actions as hold actions if you use your own GestureRecognizer and specify HoldWithMouse in settings.
There is a link below:
http://msdn.microsoft.com/en-us/library/windows/apps/windows.ui.xaml.uielement.holding
Best Regards!
- Marked as answer by Xiaoliang Chen - MSFTModerator Tuesday, August 20, 2013 6:34 AM
Thursday, August 15, 2013 3:34 AMModerator