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:

9 Likes

Wow, Nice extension :+1:

2 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.

Great extension! Thanks for sharing!!!