Pebble Foundation Classes  0.2.0
C++ for Pebble
Pebble::ClickConfig Class Reference

Public Member Functions

void LongClick (ButtonId button_id, uint16_t delay_ms, ::ClickHandler down_handler, ::ClickHandler up_handler) const
 
void MultiClick (ButtonId button_id, uint8_t min_clicks, uint8_t max_clicks, uint16_t timeout, bool last_click_only, ::ClickHandler handler) const
 
void RawClick (ButtonId button_id, ::ClickHandler down_handler, ::ClickHandler up_handler) const
 
void SingleClick (ButtonId button_id, ::ClickHandler handler) const
 
void SingleRepeatingClick (ButtonId button_id, uint16_t repeat_interval_ms, ::ClickHandler handler) const
 

Member Function Documentation

◆ LongClick()

void Pebble::ClickConfig::LongClick ( ButtonId  button_id,
uint16_t  delay_ms,
::ClickHandler  down_handler,
::ClickHandler  up_handler 
) const
inline

Subscribe to long click events.

Note
Must be called from the ClickConfigProvider.
The back button cannot be overridden with a long click.
Parameters
button_idThe button events to subscribe to.
delay_msMilliseconds after which "handler" is fired. A value of 0 means to use the system default 500ms.
down_handlerThe ClickHandler to fire as soon as the button has been held for delay_ms. This may be NULL to have no down handler.
up_handlerThe ClickHandler to fire on the release of a long click. This may be NULL to have no up handler.

◆ MultiClick()

void Pebble::ClickConfig::MultiClick ( ButtonId  button_id,
uint8_t  min_clicks,
uint8_t  max_clicks,
uint16_t  timeout,
bool  last_click_only,
::ClickHandler  handler 
) const
inline

Subscribe to multi click events.

Note
Must be called from the ClickConfigProvider.
Parameters
button_idThe button events to subscribe to.
min_clicksMinimum number of clicks before handler is fired. Defaults to 2.
max_clicksMaximum number of clicks after which the click counter is reset. A value of 0 means use "min" also as "max".
timeoutThe delay after which a sequence of clicks is considered finished, and the click counter is reset. A value of 0 means to use the system default 300ms.
last_click_onlyDefaults to false. When true, only the handler for the last multi-click is called.
handlerThe ClickHandler to fire on this event. Fired for multi-clicks, as "filtered" by the last_click_only, min, and max parameters.

◆ RawClick()

void Pebble::ClickConfig::RawClick ( ButtonId  button_id,
::ClickHandler  down_handler,
::ClickHandler  up_handler 
) const
inline

Subscribe to raw click events.

Note
Must be called from within the ClickConfigProvider.
The back button cannot be overridden with a raw click.
Parameters
button_idThe button events to subscribe to.
down_handlerThe ClickHandler to fire as soon as the button has been pressed. This may be NULL to have no down handler.
up_handlerThe ClickHandler to fire on the release of the button. This may be NULL to have no up handler.
contextIf this context is not NULL, it will override the general context.

◆ SingleClick()

void Pebble::ClickConfig::SingleClick ( ButtonId  button_id,
::ClickHandler  handler 
) const
inline

Subscribe to single click events.

Note
Must be called from the ClickConfigProvider.
window_single_click_subscribe() and window_single_repeating_click_subscribe() conflict, and cannot both be used on the same button.
When there is a multi_click and/or long_click setup, there will be a delay before the single click
Parameters
button_idThe button events to subscribe to.
handlerThe ClickHandler to fire on this event. handler will get fired. On the other hand, when there is no multi_click nor long_click setup, the single click handler will fire directly on button down.
See also
ButtonId
Clicks
SingleRepeatingClick

◆ SingleRepeatingClick()

void Pebble::ClickConfig::SingleRepeatingClick ( ButtonId  button_id,
uint16_t  repeat_interval_ms,
::ClickHandler  handler 
) const
inline

Subscribe to single click event, with a repeat interval. A single click is detected every time "repeat_interval_ms" has been reached.

Note
Must be called from the ClickConfigProvider.
window_single_click_subscribe() and window_single_repeating_click_subscribe() conflict, and cannot both be used on the same button.
The back button cannot be overridden with a repeating click.
Parameters
button_idThe button events to subscribe to.
repeat_interval_msWhen holding down, how many milliseconds before the handler is fired again. A value of 0ms means "no repeat timer". The minimum is 30ms, and values below will be disregarded. If there is a long-click handler subscribed on this button, repeat_interval_ms will not be used.
handlerThe ClickHandler to fire on this event.
See also
SingleClick

The documentation for this class was generated from the following file: