I'm mocking up a wp7 app in Expression Blend and looking for set up an event handler in response to certain gestures. Some Bing-ing shows some people recommending to use "on click" or something and check the time between taps oneself, but it seems like there should be an easier way.
Is there an event for Silverlight controls that fires for gestures (or specific types of gestures?)
Silverlight for Windows Phone 7 doesn't natively contain any support for gestures. However, there are a number of options available:
The Silverlight for Windows Phone Toolkit contains a GestureService/GestureListener which I'd recommend looking at first.
Laurent Bugnion has created some MultiTouch behaviours which may be of interest, dependeing on your specific requirements.
A final option would be to use some of the gestures supported by the XNA Framework. Mike Ormond has written a good introduction to using them.
Beyond that you'll have to detect/determine gestures yourself through use of the ManipulationStarted, ManipulationDelta and ManipulationCompleted events. MSDN also has a guide to handling manipulation events which you could also use as a pointer to detecting gestures yourself.
Related
I'm working on implementing native Windows touch support in a legacy WinForms app for .NET 4.0+. The app is being developed in VS 2013, and the main test system is Win 8.1 Pro. Doing this in a custom control, which is a descendant of the Control class.
According to the Windows Touch Gestures Overview MSDN article, "the default gesture handler maps some gestures to Windows messages that were used in previous versions of Windows" (see the 'Legacy Support' subsection). However, in my tests the basic pan gesture one can use to scroll a control in the vertical direction using one finger, isn't translated to WM_VSCROLL. The protected OnMouseWheel method isn't also raised.
Have I missed any important settings or anything else we need to turn on to enable this default mapping for the basic touch gestures?
I have test it on windows 10. Window without WS_VSCROLL style will not receive the legacy WM_VSCROLL for touch pan gesture.
You need to translate itself, but it is very simple. Handle WM_GESTURE in your custom control's wndproc and translate the GID_PAN action to WM_VSCROLL should do the work.
I have been looking but have been unable to find as yet a nice comparison of the differences in touch / gesture support between the Windows Store app API's and WPF.
I have seen that WPF includes some basic touch events but do the WPF controls handle gestures such as swipe, hold and tap or would we need to implement our own identification of these getsures using the basic touch events?
Thanks
Gavin
Here is the full list of Windows Store App controls:
wpf controls
When developing a Windows Store App, you will use there controls. They have (where applicable) built in gesture support.
I am trying to create a multitouch application.
I have the hardware which will allow me to do this. On the software side I want to be able to have WPF textboxes, WPF web browsers, multiple focuses, multiple keyboards and multiple users at the same time.
From what I've seen, I can't be focused on two controls at the same time.
What is the Microsoft MultiTouch approach for this kind of job ?
The OS limitations are what they are (and don't appear to change in Win8): only one hWnd at a time can have focus.
Since you are using WPF though, everything within your application (with the exception of the WebBrowser control ActiveX widgets you may be using) is rendered within one big hWnd.
WPF 4 introduced native support for multitouch, including multi-touch capture. The APIs for this are many but pretty intuitive so I'll just say this... go to http://msdn.microsoft.com/en-us/library/ms590078.aspx and search within the page for all of the members with "Touch" in their name.
The catch however is that the controls shipping with WPF 4 don't work with the touch input events... you'll only be able to interact with one of those controls at a time. To take advantage of the multi-touch capture APIs, you'll have to create controls that are designed with it in mind. Fortunately, the Surface team at Microsoft has you covered on that... the "Surface 2.0 SDK" includes a suite of controls (usable on any Win7 machine, not just for Surface) that were built with this stuff in mind.
To create application with MultiTouch UI, use MultiTouch Framework in .Net
Go to http://multitouchvista.codeplex.com/
I'm developing a touchscreen application, touchscreen overlay comes with its own SDK which disables all of the WPF default features. For example if I don't use this SDK i can easily draw on InkCanvas, program sees the overlay as a mouse input, but when I use this SDK it just doesn't recognize gestures, there are great features in SDK so I really want to use that, I can get the position of the touch point so how can I configure the InkCanvas to recognize this point and make me able draw based on this point.
BTW, I can draw with mouse when I use the SDK.
Any idea?
Thanks in advance,
The best way is to not use the SDK if you can help it, and just use a multitouch driver. This simplifies things greatly. Once you have this driver you need to:
enable pen and touch in windows
respond to the TouchDown, TouchMove, and TouchUp events. the touches don't get translated into events the same way mouse clicks / drags do. Look at the "Raw Touch" section of this article.
if you dont have a driver, or you insist on using their SDK, you should still look into the Touch events I listed above, as these are most likely what you need.
Silverlight provides only Touch.FrameReported event and doesnt provide any events for the UIElements like it does for mouse events(ex: MouseDown, MouseUp). Is there any touch library available for the silverlight which provides these touch events and supports gestures.
Google did not help me much or may be my search terms are not correct. Any pointers will be appreciated.
Here is some useful stuff, but it is nowhere near a complete library:
http://www.jebishop.com/2009/11/05/multi-touch-gesture-recognition-in-silverlight-3/
have you seen this article: http://msdn.microsoft.com/en-us/magazine/ee336026.aspx its all about multi-touch support for silverlight