Perspective touchscreen long press context menu

Version: Ignition Edge 8.3.3

I need to have a jog button to run something as long as the button is pressed.
To do this, I made a button with 2 events: onMouseDown and onMouseUp which sets and resets a bit.

This works fine when using a mouse. However: with a touchscreen, I experience right-click behaviour:

I tried disabling the press-and-hold right click setting:

But it still didn’t work. Still get the context menu.

I was reading these topics:

It seems that I need to add the following somewhere to a css file:

* {
-webkit-touch-callout: none;
-webkit-user-select:none;
}

Tried adding it here but doesn’t work:

I’m not sure if I added it in the right place?

Also tried to just add it to the button:

But that also doesn’t work…

I tried Chrome kiosk mode, then I don’t get the context menu. But I also cannot click the button with a long press…

Any help is highly appreciated!

After fiddling a lot more, I found these touch events.
I added the same scripts to set/reset the bit and now it works in Chrome Kiosk mode.

If anyone has a better solution, I’d love to hear about that!

Everyone here will highly suggest you to not use a momentary button at all in perspective. You need to use start and stop buttons to accomplish this as you'll run into issues trying to use a momentary style button beyond what you've already experienced.

5 Likes

Most notably and notoriously that the momentary button will not turn off and leave your tag high

4 Likes

I would agree that you should not use a momentary button if possible. In our situation, the operators really wanted this feature and we provided a fail safe button if it did get stuck. I also added some PLC timeout logic if this happened too. With that said, we use this all the time on a 24/7 operation and have zero issues. The CSS code was added to the following file:

C:\program files\Inductive Automation\Ignition\data\modules\com.inductiveautomation.perspective\themes\light.css

See screenshot for code added.

I haven't tested it myself but I believe the standard theme files are replaced on ignition upgrade with defaults meaning you’ll lose your edits.

Regardless, editing the base theme files is not recommended for multiple reasons such as mentioned above, inability to identify what modifications have been made to defaults which is particularly important for diagnosing potential issues that are a result of modifications, and others

1 Like