This forum uses cookies
This forum makes use of cookies to store your login information if you are registered, and your last visit if you are not. Cookies are small text documents stored on your computer; the cookies set by this forum can only be used on this website and pose no security risk. Cookies on this forum also track the specific topics you have read and when you last read them. Please confirm that you accept these cookies being set.

Short and long press
#1
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!
Reply
#2
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?
Reply
#3
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!
Reply
#4
Any update on this?
Reply
#5
It can already be done using Custom JS. Explain your task in more detail so a working example can be provided.
Reply
#6
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.
   
Reply


Forum Jump: