doubleclick

Author: Robert Schirmer
License: BSD
Github: rbrt/control/doubleclick.axo

Inlets

bool32.rising trig

Outlets

bool32.pulse oneclick

bool32.pulse doubleclick

Attributes

spinner time

Declaration
uint32_t count;
bool trig;
bool doit;
Control Rate
outlet_oneclick = 0;
outlet_doubleclick = 0;

if (doit) {
  count++;
  if (count >= attr_time) {
    outlet_oneclick = 1;
    doit = 0;
  }
  if (inlet_trig && !trig) {
    doit = 0;
    if (count < attr_time) {
      outlet_doubleclick = 1;
      trig = 1;
    }
  }
}

if (inlet_trig && !trig) {
  trig = 1;
  doit = 1;
  count = 0;
}

if (!inlet_trig)
  trig = 0;

Privacy

© 2024 Zrna Research