I’m interested in creating an interactive experience in which a users can do the following:
press a sequence of buttons followed by “submit” which launches an action.
press a different sequence of buttons following by “submit” which produces a different action;
and so on …
Therefore, I’d need to have a library, then I’d need to have the following options:
if A + B + C + Submit is pressed, then X action is launched;
if C + D + A + M + Submit is pressed, then Y is launched.
The attached image provides some context. It provides a map of all possible sounds/phonemes in English.
If the sequence of
If /b/ + /a/ + /t/ + SUBMIT is pressed, then an overlay with audio + text + images is presented
If /b/ + /a/ + /t/ + /m/ + /a/ + /n/ + SUBMIT is pressed, then a different overlay with audio + text + images is presented.
In sort … if I define each button as a unique identifies, is there a way for a sequence of button pushes to be remembered, which can launch a different action based on the sequence of button selections?
I’ll have another search. I have solutions for actions launched by single-button pushes as well as drag events, but not a sequence of button pushes (of varying lengths) that launch an action.
@h_classen : one thing I could not get to work as written in your code was the following line:
let concatString = hypeDocument.customData.toCheck + currKey;
It always gave just a single character (as per the “data-key”) but not for a whole sequence of clicked buttons. I moved this line to another function “sequenceSetup” where it was simply initialized.