# How detect touch mode in perspective session

**URL:** <https://forum.inductiveautomation.com/t/how-detect-touch-mode-in-perspective-session/53178>\
**Category:** Ignition Early Access\
**Created:** [November 17, 2021, 12:17pm UTC](https://forum.inductiveautomation.com/t/how-detect-touch-mode-in-perspective-session/53178 "2021-11-17T12:17:14Z")\
**Posts on this page:** 11\
**Page:** 1

<div class="post-metadata">

**Author:** ![nader.chinichian](https://sea1.discourse-cdn.com/inductiveautomation/user_avatar/forum.inductiveautomation.com/nader.chinichian/32/9261_2.png) [@nader.chinichian](https://forum.inductiveautomation.com/u/nader.chinichian)\
**Post date:** [November 17, 2021, 12:17pm UTC](https://forum.inductiveautomation.com/t/how-detect-touch-mode-in-perspective-session/53178/1 "2021-11-17T12:17:14Z")

</div>

Hi

I’d like to know is there any trick to know when perspective session change to touch mode in broswer.  
And also can I force to toggle this mode? Like chrome debug app. Something like full screen feature of broswer which now can be toggle in perspective script

---

<div class="post-metadata">

**Author:** ![victordcq](https://avatars.discourse-cdn.com/v4/letter/v/f6c823/32.png) [@victordcq](https://forum.inductiveautomation.com/u/victordcq)\
**Post date:** [November 17, 2021, 1:38pm UTC](https://forum.inductiveautomation.com/t/how-detect-touch-mode-in-perspective-session/53178/2 "2021-11-17T13:38:16Z")

</div>

There can some info be found in sessionprops device.userAgent and device.type  
To know if you are on a windows/browser or an andorid or something  
But other then that there isnt really a way to detect if you are a touchscreen (that i know off) from perspective. And you cant change it.

entering chrome debug mode can be done with  
ctrl +shit +i followed by ctrl+shift+m But that proabbly not what you need xd

---

<div class="post-metadata">

**Author:** ![nader.chinichian](https://sea1.discourse-cdn.com/inductiveautomation/user_avatar/forum.inductiveautomation.com/nader.chinichian/32/9261_2.png) [@nader.chinichian](https://forum.inductiveautomation.com/u/nader.chinichian)\
**Post date:** [November 17, 2021, 4:25pm UTC](https://forum.inductiveautomation.com/t/how-detect-touch-mode-in-perspective-session/53178/3 "2021-11-17T16:25:49Z")

</div>

what about javascript and creating module for that?

---

<div class="post-metadata">

**Author:** ![paul-griffith](https://sea1.discourse-cdn.com/inductiveautomation/user_avatar/forum.inductiveautomation.com/paul-griffith/32/37249_2.png) [@paul-griffith](https://forum.inductiveautomation.com/u/paul-griffith)\
**Post date:** [November 17, 2021, 4:46pm UTC](https://forum.inductiveautomation.com/t/how-detect-touch-mode-in-perspective-session/53178/4 "2021-11-17T16:46:51Z")

</div>

Even with Javascript it doesn’t seem like there’s any totally reliable way to do this:

> <https://stackoverflow.com/questions/3974827/detecting-touch-screen-devices-with-javascript>

---

<div class="post-metadata">

**Author:** ![victordcq](https://avatars.discourse-cdn.com/v4/letter/v/f6c823/32.png) [@victordcq](https://forum.inductiveautomation.com/u/victordcq)\
**Post date:** [November 17, 2021, 8:01pm UTC](https://forum.inductiveautomation.com/t/how-detect-touch-mode-in-perspective-session/53178/5 "2021-11-17T20:01:46Z")

</div>

Doesnt seem like there is a surefire way to find out, why do you need it tho? If you expect touch and mouse events you should program them both anyway?

---

<div class="post-metadata">

**Author:** ![nader.chinichian](https://sea1.discourse-cdn.com/inductiveautomation/user_avatar/forum.inductiveautomation.com/nader.chinichian/32/9261_2.png) [@nader.chinichian](https://forum.inductiveautomation.com/u/nader.chinichian)\
**Post date:** [November 18, 2021, 4:25am UTC](https://forum.inductiveautomation.com/t/how-detect-touch-mode-in-perspective-session/53178/6 "2021-11-18T04:25:05Z")

</div>

I create a view with panning and zooming functionality with the mouse when the user switch to touch mode I need to disable it because in this mode browser has pitch and zoom by default.

---

<div class="post-metadata">

**Author:** ![victordcq](https://avatars.discourse-cdn.com/v4/letter/v/f6c823/32.png) [@victordcq](https://forum.inductiveautomation.com/u/victordcq)\
**Post date:** [November 18, 2021, 7:38am UTC](https://forum.inductiveautomation.com/t/how-detect-touch-mode-in-perspective-session/53178/7 "2021-11-18T07:38:36Z")

</div>

And the pitch/zoom intereferes with your functionality? Cant you make yours only work with mouseclick event?

---

<div class="post-metadata">

**Author:** ![nader.chinichian](https://sea1.discourse-cdn.com/inductiveautomation/user_avatar/forum.inductiveautomation.com/nader.chinichian/32/9261_2.png) [@nader.chinichian](https://forum.inductiveautomation.com/u/nader.chinichian)\
**Post date:** [November 20, 2021, 4:15am UTC](https://forum.inductiveautomation.com/t/how-detect-touch-mode-in-perspective-session/53178/8 "2021-11-20T04:15:25Z")

</div>

That is exactly what I want to do I want to disable those functionality in touch enable Device so my page work on that devices too

---

<div class="post-metadata">

**Author:** ![victordcq](https://avatars.discourse-cdn.com/v4/letter/v/f6c823/32.png) [@victordcq](https://forum.inductiveautomation.com/u/victordcq)\
**Post date:** [November 20, 2021, 11:38pm UTC](https://forum.inductiveautomation.com/t/how-detect-touch-mode-in-perspective-session/53178/9 "2021-11-20T23:38:02Z")

</div>

how did you make the panning/zooming functionality now?

---

<div class="post-metadata">

**Author:** ![nader.chinichian](https://sea1.discourse-cdn.com/inductiveautomation/user_avatar/forum.inductiveautomation.com/nader.chinichian/32/9261_2.png) [@nader.chinichian](https://forum.inductiveautomation.com/u/nader.chinichian)\
**Post date:** [November 23, 2021, 4:38pm UTC](https://forum.inductiveautomation.com/t/how-detect-touch-mode-in-perspective-session/53178/10 "2021-11-23T16:38:10Z")

</div>

Hi Victor  
I just use mouse and wheel events to do this and try to transfer whole root by it.  
It is hard for me and but eventually it works compare to map component the performance is not good.

---

<div class="post-metadata">

**Author:** ![victordcq](https://avatars.discourse-cdn.com/v4/letter/v/f6c823/32.png) [@victordcq](https://forum.inductiveautomation.com/u/victordcq)\
**Post date:** [November 24, 2021, 7:31am UTC](https://forum.inductiveautomation.com/t/how-detect-touch-mode-in-perspective-session/53178/11 "2021-11-24T07:31:35Z")

</div>

Yea thats never gonna work as good without javascript
