Expand Minimize Picture-in-picture Power Device Status Voice Recognition Skip Back Skip Forward Minus Plus Play Search
Documentation
Sidebar

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.OnButtonSubscription 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 Example Notification

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