java.lang.Object
com.smartdevicelink.proxy.RPCStruct
com.smartdevicelink.proxy.RPCMessage
com.smartdevicelink.proxy.RPCRequest
Establishes a subscription to button notifications for HMI buttons. Buttons are not necessarily physical buttons, but can also be "soft" buttons on a touch screen, depending on the display in the vehicle. Once subscribed to a particular button, an application will receive both OnButtonEvent and OnButtonPress notifications whenever that button is pressed. The application may also unsubscribe from notifications for a button by invoking the UnsubscribeButton operation
When a button is depressed, an OnButtonEvent notification is sent to the application with a ButtonEventMode of BUTTONDOWN. When that same button is released, an OnButtonEvent notification is sent to the application with a ButtonEventMode of BUTTONUP
When the duration of a button depression (that is, time between depression and release) is less than two seconds, an OnButtonPress notification is sent to the application (at the moment the button is released) with a ButtonPressMode of SHORT. When the duration is two or more seconds, an OnButtonPress notification is sent to the application (at the moment the two seconds have elapsed) with a ButtonPressMode of LONG
The purpose of OnButtonPress notifications is to allow for programmatic detection of long button presses similar to those used to store presets while listening to the radio, for example
When a button is depressed and released, the sequence in which notifications will be sent to the application is as follows:
For short presses:
For long presses:
HMILevel needs to be FULL, LIMITED or BACKGROUND
Parameter List
Name | Type | Description | Reg. | Notes | Version |
---|---|---|---|---|---|
buttonName | ButtonName | Name of the button to subscribe. | Y | SmartDeviceLink 1.0 |
public static final java.lang.String KEY_BUTTON_NAME
Constructs a new SubscribeButton object
public SubscribeButton()
Constructs a new SubscribeButton object indicated by the Hashtable parameter
public SubscribeButton(java.util.Hashtable<java.lang.String, java.lang.Object> hash)
Constructs a new SubscribeButton object
public SubscribeButton(ButtonName buttonName)
Gets the name of the button to subscribe to
public com.smartdevicelink.proxy.rpc.enums.ButtonName getButtonName()
Sets a name of the button to subscribe to
public com.smartdevicelink.proxy.rpc.SubscribeButton setButtonName(ButtonName buttonName)
From Class | Methods |
---|---|
com.smartdevicelink.proxy.RPCRequest | getCorrelationID, setCorrelationID, setOnRPCResponseListener, getOnRPCResponseListener |
com.smartdevicelink.proxy.RPCMessage | getFunctionID, getFunctionName, setFunctionName, getMessageType, setParameters, getParameters, getObject, getString, getInteger, getFloat, getDouble, getBoolean, getLong |
com.smartdevicelink.proxy.RPCStruct | getStoreValue, getStore, deserializeJSON, serializeJSON, serializeJSON, format, getBulkData, setBulkData, setPayloadProtected, isPayloadProtected, getMessageTypeName, hasKey, setValue, getValue, getObject, formatObject, getValueForString, getString, getInteger, getDouble, getFloat, getBoolean, getLong, clone, equals, hashCode |
java.lang.Object | getClass, hashCode, equals, clone, toString, notify, notifyAll, wait, wait, wait, finalize |