Double click, triple click, etc / multiple click events per button

Aix file: Update: (allow multiple click events per button + unset function)
com.extensions.clicks.aix (19.8 KB)

Source files: Update: (much cleaner code and just one file)
Clicks.java

This just works on buttons... for now...

There are 4 arguments, the first being the button to use, the second being the amount of clicks the buttons takes to trigger the event (this can also be a list of integers for multiple events per button), the third is if the event should repeat or just happen once if false. The final parameter resets the internal counter every Xmilliseconds. For example to simulate a triple click, or double, I've been using 300ms.

The bellow fires every time the user clicks button1.
image

The bellow fires if the user rapidly presses the button 7 times.
image

The bellow shows more complexity of the simple extension.

The bellow shows how to allow multiple click events per button (useful in small screens)
image

The bellow shows how to unset button1
image

*There is also a error event that's thrown (has already helped!)
image

The idea behind this extension and its future is to maximize small screens.. I hope to spend lots of time on my watch apps and pull useful stuff into this extension and maybe rename it small-screen-tools. I didn't really want to release this because its pretty basic but in the hopes someone gives me pointers on the code i decided to just post it right away.. and i got some reading material and am coming back :slight_smile:

15 Likes

Wow, Nice extension :+1:

3 Likes

5 posts were split to a new topic: Extensions that are open source

com.extensions.clicks.aix (19.8 KB)
Clicks.java

No changes, minor refactor.

2 Likes

Great extension! Thanks for sharing!!!

1 Like

I am using this extension to create a three number combination but I get the following error

Senza titolo2
Senza titoloerror

Looks to be an issue with the timer in the extension itself.
The error only seems to happen on the first click, after that no issues.
If you set the reset time to 0 the error does not arise first time, but is unusable for multiple clicks.

We should be able to replicate this extension just using blocks...

The basics:

image