Ambiguity in Firing Events - On Surface Device
-
Monday, April 30, 2012 12:19 PM
Hi,
I have a ScatterViewItem which contains an image, a grid (by default Visibility is false) and a SurfaceButton. On Click of this button, the grid will be made visible.
The same ScatterViewItem should also support Drag and Drop feature for which I have coded PreviewTouchMove.
Everything is working fine on Simulator.
But when I executed the code on Surface device, Surface touch is so sensitive that sometimes it is taking SurfaceButton click as PreviewTouchMove. (of coure, it depends on the way the user touches the button).
Now, my query is... is there any Possibility that I can minimise this ambiguity. I mean, when I touch SurfaceButton, PreviewTouchMove should never fire. It will be really helpful even if there are other ways to avoid such ambiguities.
Thanks,
Sai Kishore.
All Replies
-
Monday, April 30, 2012 10:04 PMModerator
Hi Sai,
What is probably happening is that you are getting "phantom touches" on the Microsoft Surface hardware (I am assuming you are targeting Samsung SUR40 for Microsoft Surface).
Phantom touches are false contacts reported by the system -- usually due to tough lightning conditions. You could potentially see touch visualizations being triggered in other places than the one where you are actually touching. Is that the case?
If that's the case, you could either:
1. Adjust the lightning conditions so that you minimize false recognitions by the hardware.
2. Make the detection a bit more restringent. -- just like Roy proposes in http://social.msdn.microsoft.com/Forums/en-US/surfaceappdevelopment/thread/dcda428e-2585-4668-83d6-d9d531e75df5 (i.e. only do something when the system returns that the touch is an actual finger)
I hope this is helpful,
Luis Cabrera
Luis Cabrera. Platform Program Manager -- Microsoft Surface @luisito_cabrera Disclaimer: This post is provided "AS IS" with no warranties, and confer no rights.
- Proposed As Answer by Luis Cabrera - SurfaceModerator Monday, April 30, 2012 10:04 PM
-
Tuesday, May 01, 2012 3:33 PM
Hi Luis,
Thanks for the reply. Yes, I'm targetting Samsung SUR40 for Microsoft Surface. And I will let you know after checking the lighting information.
I have one more doubt...
As my ScatterViewItem has more than two controls which receives Touch inputs (like a ScrollBar, a Custom Control, a SurfaceButton etc). When I coded PreviewTouchDown for Drag and Drop feature (by following Surface Samples), the problem I faced is...
1. When I clicked my CustomControl, PreviewTouchDown is fired,
2. When I clicked on Button, PreviewTouchDown is fired.... and I was also unable to move ScrollBar as PTD got fired.
To overcome this, I have replaced PreviewTouchDown with PreviewTouchMove to implement Drag and Drop. Is my implemention correct in this context. Will this cause any other problems??
I'm new to Surface development. So I'm not completely sure about my implementation.
Thanks,
Sai Kishore.
- Edited by Koya Kishore Tuesday, May 01, 2012 3:34 PM
-
Tuesday, May 01, 2012 6:36 PMModerator
PreviewTouchMove could work as the place to initiate a BeginDragDrop. In the ShoppingCart sample we actually use PreviewTouchMove as a place to call our internal function "StartDragDrop". What matters is that you know at that point that the user is causing a drag event as opposed to just moving the element, and that you trigger the BeginDragDrop at that point.
Luis Cabrera. Platform Program Manager -- Microsoft Surface @luisito_cabrera Disclaimer: This post is provided "AS IS" with no warranties, and confer no rights.
-
Wednesday, May 02, 2012 3:55 AM
Thanks Luis.
in reply to your first comment, I have ran the tool, and the entire screen is GREEN.
My simple doubt, When I click the button, why is PreviewTouchMove is being fired???? (Though I clicked carefully without moving the ScatterViewItem)
As a workaround, What I have done is..
(As PreviewTouchMove is being fired always...)
In PreviewTouchMove eventhandler, I have checked if SurfaceButton is clicked.. and if yes, I have executed some other code. But this is giving me a Flickering effect. As I mentioned, On click of this Button, Some part of ScatterViewItem will be made visible.
What is the main difference between TouchMove and PreviewTouchMove?? I guess, they are related to Tunneling and Bubbling. Will there be any change if I use TouchMove.
Thanks,
Sai Kishore.

