The implementation above does the job. However, it looks too hacky to me and I am not sure it’s the best approach.
I wonder if I could use something similar to GetArgumentAsString(“MOUSEBUTTON”) to evaluate the button clicked, instead of that chain of ANDs inside the OR in the first picture.
The “mouse button” conditions won’t accept expressions, it seems.
You can split in three blocks if you want to get rid of the AND and ORs.
You’ll get three “Set to true” in exchange.
Is one approach better than the other in terms of stability or performance? If there is a benefit, I don’t mind having more events and return statements. It will be encapsulated in the extension anyways.
I exported both versions to HTML5 and compared. Profiling in Google Chrome, no significant difference, code-wise the 3-events approach generates a simpler code, which I guess is less prone to eventual bugs.