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.

long press --> ciclyc sending
#2
Use this for Short/long press widget. This example will send a counter value to 0/0/13 every 500ms during long press hold. Change widgetId and other parameters as needed.
Code:
const widgetId = 98 Visu.on('widget-ready', widgetId, ({ widget }) => {   let timer   let counter   const timerFn = () => {     localbus.write('0/0/13', counter)     counter++   }   widget.compactModeLongPress = () => {     widget.setPressed(true)          counter = 0     timer = setInterval(timerFn, 500)     timerFn()   }   widget.compactModeLongRelease = () => {     clearInterval(timer)     widget.setPressed(false)   } })
Reply


Messages In This Thread
long press --> ciclyc sending - by toujour - 16.09.2026, 13:52
RE: long press --> ciclyc sending - by admin - Yesterday, 07:56

Forum Jump: