"Shake device" in if clause, not as trigger

zanglebert

New member
I'm trying to write a macro that triggers on device shake, then waits approximately 5 seconds for another shake event. if that happens, some action triggers, otherwise nothing should happen.

I didn't find a way to use "Shake device" as a condition in if/then clauses. Am I just missing it somehow or is it not implemented (maybe for a good reason, don't know).

I started trying to make some hack-y work around with a helper macro and global variable changes, but this seems needlessly complicated if there would be a simple test for it in the main macro.
 

lara

New member
Try this
Code:
if (Boolean expression 1)
{
    // code 1
}
else if (Boolean expression 2)
{
    // code 2
}
else
{
    // code 3
}
In this way, Boolean expression 1 is tested. If it is satisfied, code block 1 is executed. If it is not, we test expression 2. If it is met, code block 2 is executed. If it is not met, the program executes code block 3.

Be aware that we can create several else if's, which allows us to respond to scenarios with three or more conditions to be evaluated.
 
Top