LogicMachine Forum
Short and long press - Printable Version

+- LogicMachine Forum (https://forum.logicmachine.net)
+-- Forum: LogicMachine eco-system (https://forum.logicmachine.net/forumdisplay.php?fid=1)
+--- Forum: Visu (https://forum.logicmachine.net/forumdisplay.php?fid=24)
+--- Thread: Short and long press (/showthread.php?tid=6122)



Short and long press - DGrandes - 18.09.2025

Hi,

I was trying to create a button with short and long press functionality, but I can’t do that. First, I’m not sure if the jQuery library has been disabled, and on the other hand, I can’t achieve it directly with querySelector. I want something similar to this: https://forum.logicmachine.net/showthread.php?tid=275
I also realized that JavaScript is loaded before the document, and I need to add a delay before reading classes or values.

Thanks!


RE: Short and long press - admin - 18.09.2025

Old JS won't work in new Visu. New JS documentation is still being worked on.
What is the use case for short/long press?


RE: Short and long press - DGrandes - 19.09.2025

I imagined that Smile.

It’s to do something similar. For example, run scenes or save with a long press, send a general off (off with long press). Or, what would be easier, configure the action in the button and only execute with a long press… Basically, those would be the two I want to do. I imagine that by having the code for these two, I’ll be able to create something else if I need it.

Thanks!


RE: Short and long press - gtsamis - 11.06.2026

Any update on this?


RE: Short and long press - admin - 12.06.2026

It can already be done using Custom JS. Explain your task in more detail so a working example can be provided.


RE: Short and long press - gtsamis - 12.06.2026

Hi admin,

A basic use case would be requiring a long press to open a gate, in order to avoid accidental activation.

Another common use case, as suggested by other members, would be scene control, for example:
- short press: recall scene
- long press: save scene

In my specific case, a Custom JS example for long-press detection would be perfect.

However, I think it would also be very useful if the switch/button widget functionality could be extended to work more like a common KNX push button, with configurable short/long press actions, similar to devices such as the Vimar 01580.

This would make the widget much more practical for standard KNX visualizations, without having to use Custom JS for such a typical function.
   


RE: Short and long press - Daniel - 19.06.2026

See latest beta version:
https://forum.logicmachine.net/showthread.php?tid=6282&pid=42412#pid42412


RE: Short and long press - gtsamis - 19.06.2026

That was fast!!! Thanks


RE: Short and long press - gtsamis - 19.06.2026

Hi,

I just tested the new widgets. They work fine locally, but they are not displayed when accessing the visu remotely.


RE: Short and long press - Daniel - 19.06.2026

Only stable versions are in cloud, this is beta.