# Perspective event scripts-touch event vs mouse event

**URL:** <https://forum.inductiveautomation.com/t/perspective-event-scripts-touch-event-vs-mouse-event/61261>\
**Category:** Ignition\
**Tags:** perspective\
**Created:** [June 27, 2022, 7:13pm UTC](https://forum.inductiveautomation.com/t/perspective-event-scripts-touch-event-vs-mouse-event/61261 "2022-06-27T19:13:11Z")\
**Posts on this page:** 3\
**Page:** 1

<div class="post-metadata">

**Author:** ![Bradley\_Peay](https://avatars.discourse-cdn.com/v4/letter/b/e495f1/32.png) [@Bradley\_Peay](https://forum.inductiveautomation.com/u/Bradley_Peay)\
**Post date:** [June 27, 2022, 7:13pm UTC](https://forum.inductiveautomation.com/t/perspective-event-scripts-touch-event-vs-mouse-event/61261/1 "2022-06-27T19:13:11Z")

</div>

Hello,

I am looking for some advice on touch events vs. mouse events for running button scripts. I am using a Hope HMI as the terminal screen and an android tablet as a remote viewer. The scripts work great when executing from my laptop or from the Hope HMI, but I have to repeatedly tap buttons of the HMI to fire the script. Also, I tried adding scripts to both event types on the same button but that didnt help. Any advice on how manage this without creating HMI buttons and Tablet buttons?

---

<div class="post-metadata">

**Author:** ![jd1](https://sea1.discourse-cdn.com/inductiveautomation/user_avatar/forum.inductiveautomation.com/jd1/32/18928_2.png) [@jd1](https://forum.inductiveautomation.com/u/jd1)\
**Post date:** [June 27, 2022, 7:15pm UTC](https://forum.inductiveautomation.com/t/perspective-event-scripts-touch-event-vs-mouse-event/61261/2 "2022-06-27T19:15:33Z")

</div>

When using a button component I have always had the best luck using the “On Action Performed” event. Works with mouse, Touchscreen, and Perspective app.

---

<div class="post-metadata">

**Author:** ![Cory.grube](https://sea1.discourse-cdn.com/inductiveautomation/user_avatar/forum.inductiveautomation.com/cory.grube/32/20476_2.png) [@Cory.grube](https://forum.inductiveautomation.com/u/Cory.grube)\
**Post date:** [June 27, 2022, 10:44pm UTC](https://forum.inductiveautomation.com/t/perspective-event-scripts-touch-event-vs-mouse-event/61261/3 "2022-06-27T22:44:06Z")

</div>

If you’re using a component that doesn’t have ‘On Action Performed’ e.g. an embedded view, label, etc, using onClick may be causing your problems. onClick requires mouse-down and mouse-up (click and release) to occur on the same pixel. Touchscreens tend to have some jitter while you press, hence the script not working unless you press very diligently. I tend to use mouse down in these scenarios.

Note: this knowledge is from Vision but I think it applies to Perspective onClick too. Also, I think there’s nuance based on your hardware’s touch drivers and whether they’re programmed to report mouse or touch events (or both?).
