Expand Minimize Picture-in-picture Power Device Status Voice Recognition Skip Back Skip Forward Minus Plus Play Search
Internet Explorer alert
This browser is not recommended for use with smartdevicelink.com, and may not function properly. Upgrade to a different browser to guarantee support of all features.
close alert
To Top Created with Sketch. To Top
To Bottom Created with Sketch. To Bottom
HMI Documentation
OnButtonPress

OnButtonPress

Type
Notification
Sender
HMI
Purpose
Inform SDL about a Button Press

If the HMI reports to SDL via Buttons.GetCapabilities that it supports long and/or short button press modes, SDL expects the HMI to send the Buttons.OnButtonPress notification but buttons that have been subscribed via Buttons.SubscribeButton and custom buttons added in other RPCs as Soft Buttons.

Must

The HMI must send the name of the button pressed, the press mode detected, and ID of the button if it has type CUSTOM_BUTTON and the appID related to the button press. If only SHORT button press mode is supported, the HMI should send SHORT regardless of the time of the button press.

Note

The value of customButtonID is provided by SDL within the softButton struct for some RPCs such as UI.Alert

Notification

Parameters

Name Type Mandatory Additional
name Common.ButtonName true
mode Common.ButtonPressMode true
customButtonID Integer false minvalue: 0
maxvalue: 65536
appID Integer false

Sequence Diagrams

JSON Message Examples

Example Notification

{
  "jsonrpc" : "2.0",
  "method" : "Buttons.OnButtonPress",
  "params" :
  {
    "name" : "CUSTOM_BUTTON",
    "mode" : "SHORT",
    "customButtonID" : 564
  }
}
View on GitHub.com
Previous Section Next Section