# How to get touch position in perspective app on android

**URL:** <https://forum.inductiveautomation.com/t/how-to-get-touch-position-in-perspective-app-on-android/47240>\
**Category:** Ignition\
**Tags:** perspective, ignition80\
**Created:** [May 28, 2021, 2:39pm UTC](https://forum.inductiveautomation.com/t/how-to-get-touch-position-in-perspective-app-on-android/47240 "2021-05-28T14:39:04Z")\
**Posts on this page:** 9\
**Page:** 1

<div class="post-metadata">

**Author:** ![plamadeleine](https://avatars.discourse-cdn.com/v4/letter/p/dc4da7/32.png) [@plamadeleine](https://forum.inductiveautomation.com/u/plamadeleine)\
**Post date:** [May 28, 2021, 2:39pm UTC](https://forum.inductiveautomation.com/t/how-to-get-touch-position-in-perspective-app-on-android/47240/1 "2021-05-28T14:39:04Z")

</div>

Hello there,

I am trying to develop some kind of a virtual joystick for a robotic application. In principle, it should be simple. I just need to obtain the current touch position on the screen to update the position of the virtual joystick and send that to the robot.  
Right now, I can easily do that using the onMouseMove event and pageX/Y but I could only manage to make it work in the web browser with a mouse. I need it to be touch based. The onTouchMove would be perfect for what I need but I am not able to obtain the current touch position.  
Is there a way to obtain the current touch position?

Thank you

---

<div class="post-metadata">

**Author:** ![nminchin](https://sea1.discourse-cdn.com/inductiveautomation/user_avatar/forum.inductiveautomation.com/nminchin/32/6911_2.png) [@nminchin](https://forum.inductiveautomation.com/u/nminchin)\
**Post date:** [July 22, 2021, 2:57am UTC](https://forum.inductiveautomation.com/t/how-to-get-touch-position-in-perspective-app-on-android/47240/2 "2021-07-22T02:57:04Z")

</div>

Looking for the same thing here. The onTouchMove handler has nothing useful in it 😕

---

<div class="post-metadata">

**Author:** ![Corne\_de\_Jonge](https://sea1.discourse-cdn.com/inductiveautomation/user_avatar/forum.inductiveautomation.com/corne_de_jonge/32/46823_2.png) [@Corne\_de\_Jonge](https://forum.inductiveautomation.com/u/Corne_de_Jonge)\
**Post date:** [July 10, 2023, 11:48am UTC](https://forum.inductiveautomation.com/t/how-to-get-touch-position-in-perspective-app-on-android/47240/3 "2023-07-10T11:48:47Z")

</div>

Two years later, I'm revisiting this topic. Has anyone managed to capture the X/Y positions of touch movements in Perspective?

I'm working on creating an XY coordinate-like container with the ability to zoom and pan, specifically on mobile devices. In order to create a zoom and pan mechanism, I believe I need to know the touch positions, but I'm struggling with this part.

So far, I've managed to implement zoom functionality for mouse scroll events, but translating this for touch events on mobile devices is proving to be a challenge.

Has anyone tackled this issue, or is there another way of approaching this that I may not have considered? 🤔

---

<div class="post-metadata">

**Author:** ![nminchin](https://sea1.discourse-cdn.com/inductiveautomation/user_avatar/forum.inductiveautomation.com/nminchin/32/6911_2.png) [@nminchin](https://forum.inductiveautomation.com/u/nminchin)\
**Post date:** [July 10, 2023, 11:53am UTC](https://forum.inductiveautomation.com/t/how-to-get-touch-position-in-perspective-app-on-android/47240/4 "2023-07-10T11:53:47Z")

</div>

Haven't used this yet, but may be of interest?

> [@Pan Zoom Container](https://forum.inductiveautomation.com/t/pan-zoom-container/75093):
>
> BIJC is pleased to announce its latest module, a Pan Zoom container for Perspective. There have been a number of outstanding examples of Pan Zoom using an XY container but these are very specific and generally require advanced scripting and CSS skills. BIJC container simplifies this process and allows the XY container to be responsive. In its simplest deployment, a developed XY container can be placed inside BIJCs Pan Zoom container and it will automatically fit to any screen size. If the deve…

---

<div class="post-metadata">

**Author:** ![Corne\_de\_Jonge](https://sea1.discourse-cdn.com/inductiveautomation/user_avatar/forum.inductiveautomation.com/corne_de_jonge/32/46823_2.png) [@Corne\_de\_Jonge](https://forum.inductiveautomation.com/u/Corne_de_Jonge)\
**Post date:** [July 11, 2023, 9:47am UTC](https://forum.inductiveautomation.com/t/how-to-get-touch-position-in-perspective-app-on-android/47240/5 "2023-07-11T09:47:21Z")

</div>

> [@nminchin](#):
>
> Haven't used this yet, but may be of interest?

Thanks for the suggestion. It's indeed interesting, and they've done an excellent job creating a container with zoom and pan functionality.

However, because it's a .modl file, I believe we can't peek into how they've implemented the mechanics behind the scenes 🤔 We are aiming to build our own custom container, so that we can tweak it according to our project's needs and also understand the workings better.

Does anyone have suggestions on how we might go about creating a similar feature, or any way to learn from a .modl file?

---

<div class="post-metadata">

**Author:** ![pturmel](https://sea1.discourse-cdn.com/inductiveautomation/user_avatar/forum.inductiveautomation.com/pturmel/32/3295_2.png) [@pturmel](https://forum.inductiveautomation.com/u/pturmel)\
**Post date:** [July 11, 2023, 12:10pm UTC](https://forum.inductiveautomation.com/t/how-to-get-touch-position-in-perspective-app-on-android/47240/6 "2023-07-11T12:10:12Z")

</div>

> [@Corne\_de\_Jonge](#):
>
> or any way to learn from a .modl file?

Decompiling someone's module file to learn from it so you can avoid buying it is not appreciated, and is explicitly forbidden by that module's license. (There is similar language on my module licenses, too.)

You need to learn to do this on your own, or pay BIJC for consulting help, or buy the module and ask BIJC to accommodate your requirements in their product.

Really.

{ There are certain uses of decompiling that are considered fair use, varying by jurisdiction. Your intent isn't one of them, in any jurisdiction I'm aware of. But IANAL, yada, yada. }

---

<div class="post-metadata">

**Author:** ![Chris\_Taylor](https://sea1.discourse-cdn.com/inductiveautomation/user_avatar/forum.inductiveautomation.com/chris_taylor/32/3315_2.png) [@Chris\_Taylor](https://forum.inductiveautomation.com/u/Chris_Taylor)\
**Post date:** [July 11, 2023, 3:43pm UTC](https://forum.inductiveautomation.com/t/how-to-get-touch-position-in-perspective-app-on-android/47240/7 "2023-07-11T15:43:50Z")

</div>

Thanks for liking our Zoom Pan Module, it’s taken a year to get the functionality we needed and we thought the community might like to share the features and perhaps a tiny fraction of the cost.

I’d be happy to look at incorporating any requirements you might need if you reach out, we have done this before with our perspective calendar module. I can assure you that it would be more cost effective than starting from scratch.

Building a module like this is non-trivial and I would be distressed for my team if an actor replicated their good work by plagiarism.

---

<div class="post-metadata">

**Author:** ![Corne\_de\_Jonge](https://sea1.discourse-cdn.com/inductiveautomation/user_avatar/forum.inductiveautomation.com/corne_de_jonge/32/46823_2.png) [@Corne\_de\_Jonge](https://forum.inductiveautomation.com/u/Corne_de_Jonge)\
**Post date:** [July 13, 2023, 6:04am UTC](https://forum.inductiveautomation.com/t/how-to-get-touch-position-in-perspective-app-on-android/47240/8 "2023-07-13T06:04:19Z")

</div>

> [@Chris\_Taylor](#):
>
> Building a module like this is non-trivial and I would be distressed for my team if an actor replicated their good work by plagiarism.

I want to assure you that plagiarism is absolutely not my intention. Your Zoom Pan Module is indeed impressive, and my aim is not to replicate it without permission. Your team's hard work is evident in the functionality of your module, and it is not my aim to discredit or undermine that in any way.

That said, I appreciate your offer to consider incorporating our requirements. I'll be reaching out to discuss the possibilities.

---

<div class="post-metadata">

**Author:** ![Chris\_Taylor](https://sea1.discourse-cdn.com/inductiveautomation/user_avatar/forum.inductiveautomation.com/chris_taylor/32/3315_2.png) [@Chris\_Taylor](https://forum.inductiveautomation.com/u/Chris_Taylor)\
**Post date:** [July 13, 2023, 3:18pm UTC](https://forum.inductiveautomation.com/t/how-to-get-touch-position-in-perspective-app-on-android/47240/9 "2023-07-13T15:18:11Z")

</div>

[Corne\_de\_Jonge](https://forum.inductiveautomation.com/u/Corne_de_Jonge)

No worries, thanks for the kind words. I'll look out for an email
