50ButtonsEach / fliclib-linux-dist

114 stars 19 forks source link

events are duplicated #6

Closed CheapB closed 8 years ago

CheapB commented 8 years ago

It seems like the events are duplicated as per below. It would be annoying to have to filter these in the applciation

This is what I am getting with a click: Button down: 80:E4:DA:70:0E:A1 Button up: 80:E4:DA:70:0E:A1 Button click: 80:E4:DA:70:0E:A1 Button single click: 80:E4:DA:70:0E:A1 Button single click: 80:E4:DA:70:0E:A1

this is what I am getting with a double click Button down: 80:E4:DA:70:0E:A1 Button up: 80:E4:DA:70:0E:A1 Button click: 80:E4:DA:70:0E:A1 Button down: 80:E4:DA:70:0E:A1 Button up: 80:E4:DA:70:0E:A1 Button click: 80:E4:DA:70:0E:A1 Button double click: 80:E4:DA:70:0E:A1 Button double click: 80:E4:DA:70:0E:A1

This is what I am getting with a hold Button down: 80:E4:DA:70:0E:A1 Button hold: 80:E4:DA:70:0E:A1 Button hold: 80:E4:DA:70:0E:A1 Button up: 80:E4:DA:70:0E:A1 Button single click: 80:E4:DA:70:0E:A1

Emill commented 8 years ago

Hi. We have defined different scenarios for different use cases: Up / down Click / hold Single click / double click Single click / double click / hold You should only handle the callback function you are interested in. The same logic applies to the Android sdk. See https://flic.io/partners/developers/documentation/android/index.html for more information.

For example, if you only want to know when the button is pressed, use the down event in the up/down handler. If you want different actions on single and double click (no hold recognition), use the single click / double click handler.

CheapB commented 8 years ago

Thanks, I get that. I realize I am new to this SDK but i dont think it is right that a single click sends the "single click" event twice. I am completely fine with all the other events.

A single click produces: Button down: 80:E4:DA:70:0E:A1 Button up: 80:E4:DA:70:0E:A1 Button click: 80:E4:DA:70:0E:A1 Button single click: 80:E4:DA:70:0E:A1 Button single click: 80:E4:DA:70:0E:A1

CheapB commented 8 years ago

Looks like these are filtered in the python lib and may only e an issue in the Flic command line, so not a biggie.

fabianbergmark commented 8 years ago

The output from the flic executable isn't really meant to be parsed. The reason you see single click twice is because it's included in two callbacks. I will modify this output so that you can filter it. The output will be Button down (up/down): 80:E4:DA:70:0E:A1 Button up (up/down): 80:E4:DA:70:0E:A1 Button click (click/hold): 80:E4:DA:70:0E:A1 Button single click (single/double): 80:E4:DA:70:0E:A1 Button single click (single/double/hold): 80:E4:DA:70:0E:A1

CheapB commented 8 years ago

Sounds good. Feel free to close :-)

fabianbergmark commented 8 years ago

The new release is now uploaded