Page 1 of 1

How to distinguish the number of fingers touched in the function OnManipulationdelta?

Posted: 28 Jan 2021, 04:19
by SenlyCamile
Hello,
I wanna to select things with one finger pan gesture and move the canvas with two fingers pan gesture. How can I distinguish them in the function OnManipulationdelta? Or how to make one finger pan gesture do not call the function OnManipulationdelta? Hope for your reply.

Re: How to distinguish the number of fingers touched in the function OnManipulationdelta?

Posted: 28 Jan 2021, 11:21
by jsantos
In WPF, ManipulationDeltaEventArgs provides a Manipulators property for that purpose. It is not implemented in Noesis, please create a ticket about it.

An easy workaround is manually counting the number of fingers using TouchDown and TouchUp events.

Re: How to distinguish the number of fingers touched in the function OnManipulationdelta?

Posted: 28 Jan 2021, 11:52
by SenlyCamile
In WPF, ManipulationDeltaEventArgs provides a Manipulators property for that purpose. It is not implemented in Noesis, please create a ticket about it.

An easy workaround is manually counting the number of fingers using TouchDown and TouchUp events.
Thanks for your reply.OnManipulationdelta is called after touchdown. But TouchUP wouldn’t be called after OnManipulationdelta.So I can not count the number of fingers using TouchDown and TouchUp events.Is there any other way to solve this problem? And I am sorry I can not get “ create a ticket about it”.

Re: How to distinguish the number of fingers touched in the function OnManipulationdelta?

Posted: 28 Jan 2021, 14:02
by jsantos
TouchDown happens before the manipulation, so you could use that to count the number of fingers and reset the counter when the manipulation ends. But yes, this solution is far from perfect and won't always work.

Please, open a ticket at the tracker for implementing the vector of Manipulators (as in WPF).

Re: How to distinguish the number of fingers touched in the function OnManipulationdelta?

Posted: 29 Jan 2021, 10:00
by SenlyCamile
TouchDown happens before the manipulation, so you could use that to count the number of fingers and reset the counter when the manipulation ends. But yes, this solution is far from perfect and won't always work.

Please, open a ticket at the tracker for implementing the vector of Manipulators (as in WPF).
Thanks for your reply.It has worked in my app.And the ticket has been created.

Re: How to distinguish the number of fingers touched in the function OnManipulationdelta?

Posted: 29 Jan 2021, 10:24
by SenlyCamile
TouchDown happens before the manipulation, so you could use that to count the number of fingers and reset the counter when the manipulation ends. But yes, this solution is far from perfect and won't always work.

Please, open a ticket at the tracker for implementing the vector of Manipulators (as in WPF).
And one more question,e.deltaManipulation.translation is similar when I pinch and pan with two fingers in the function OnManipulationdelta.And it is hard to keep the distance when I pan with two fingers. I wanna to pan with no pinch and pinch witch no pan. But It is not so robust judging them just by e.manipulation.scale.Any suggestions about it?

Re: How to distinguish the number of fingers touched in the function OnManipulationdelta?

Posted: 29 Jan 2021, 11:18
by jsantos
You could ignore the rotation component when only one finger is active, and ignore the translation component when two fingers are active. Or the first time you detect a scale (pinch) enter a special mode where only scale (no rotation) is allowed. Just random ideas. This is also a UX decision.