SCLFlicButtonTriggerBehavior Constants Reference

Declared in SCLFlicPoicButton.h

SCLFlicButtonTriggerBehavior

@enum SCLFlicButtonTriggerBehavior

Represents the different trigger event behaviors that can be configured on the button. The buttonUp and buttonDown events will be active no matter which of these alternatives you choose.

Definition

typedef NS_ENUM(NSInteger, SCLFlicButtonTriggerBehavior ) {
   SCLFlicButtonTriggerBehaviorClickAndHold = 0,
   SCLFlicButtonTriggerBehaviorClickAndDoubleClick,
   SCLFlicButtonTriggerBehaviorClickAndDoubleClickAndHold,
};

Constants

SCLFlicButtonTriggerBehaviorClickAndHold

Used to distinguish between only click and hold.

Click will be fired when the button is released if it was pressed for maximum 1 second. Otherwise, hold will be fired 1 second after the button was pressed. Click will then not be fired upon release. Since this option will only distinguish between click and hold it does not have to take double click into consideration. This means that the click event can be sent immediately on button release rather than to wait for a possible double click.

Note: this will be the default behavior.

Declared In SCLFlicPoicButton.h.

SCLFlicButtonTriggerBehaviorClickAndDoubleClick

Used to distinguish between only single click and double click.

Double click will be registered if the time between two button down events was at most 0.5 seconds. The double click event will then be fired upon button release. If the time was more than 0.5 seconds, a single click event will be fired; either directly upon button release if the button was down for more than 0.5 seconds, or after 0.5 seconds if the button was down for less than 0.5 seconds.

To summarize this, a small delay will be added to the click event (if it was released within 0.5 s) in order to see if a double click will happen next. This ensures that a click event will not be sent prior to the double click.

Declared In SCLFlicPoicButton.h.

SCLFlicButtonTriggerBehaviorClickAndDoubleClickAndHold

Used to distinguish between single click, double click and hold.

If the time between the first button down and button up event was more than 1 second, a hold event will be fired.

Else, double click will be fired if the time between two button down events was at most 0.5 seconds. The double click event will then be fired upon button release. If the time was more than 0.5 seconds, a single click event will be fired; either directly upon button release if the button was down for more than 0.5 seconds, or after 0.5 seconds if the button was down for less than 0.5 seconds.

Note: Three fast consecutive clicks means one double click and then one single click. Four fast consecutive clicks means two double clicks.

Declared In SCLFlicPoicButton.h.

Declared In

SCLFlicPoicButton.h