Pebble.Button
Button subscriptions for Pebble watches.
Use onPress for simple handlers, or on / onLongPress for finer control. Combine multiple buttons with Pebble.Events.batch.
import Pebble.Button as Button
import Pebble.Events as Events
type Msg
= UpPressed
| SelectPressed
subscriptions _ =
Events.batch
[ Button.onPress Button.Up UpPressed
, Button.onPress Button.Select SelectPressed
]Native Pebble C API
- Clicks on developer.repebble.com
Types
Button
type Button
= Back
| Up
| Select
| DownPhysical buttons available on a Pebble watch.
Event
type Event
= Pressed
| Released
| LongPressedButton event edge to subscribe to.
Subscriptions
on
on : Button -> Event -> msg -> Sub msgSubscribe to a specific button event.
onPress
onPress : Button -> msg -> Sub msgSubscribe to a button press.
onRelease
onRelease : Button -> msg -> Sub msgSubscribe to a button release.
onLongPress
onLongPress : Button -> msg -> Sub msgSubscribe to a long button press.