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
JavaSE Documentation
OnButtonEvent

Class OnButtonEvent

Hierarchy

java.lang.Object
     com.smartdevicelink.proxy.RPCStruct
         com.smartdevicelink.proxy.RPCMessage
             com.smartdevicelink.proxy.RPCNotification

Package
com.smartdevicelink.proxy.rpc

Overview

Notifies application that user has depressed or released a button to which the application has subscribed.Further information about button events and button-presses can be found at SubscribeButton.

HMI Status Requirements:
    HMILevel:
    • The application will receive OnButtonEvent notifications for all subscribed buttons when HMILevel is FULL.
    • The application will receive OnButtonEvent notifications for subscribed media buttons when HMILevel is LIMITED.
    • Media buttons include SEEKLEFT, SEEKRIGHT, TUNEUP, TUNEDOWN, and PRESET_0-PRESET_9.
    • The application will not receive OnButtonEvent notification when HMILevel is BACKGROUND.
    AudioStreamingState:
    • Any
    SystemContext:
    • MAIN, VR. In MENU, only PRESET buttons. In VR, pressing any subscribable button will cancel VR.

Parameter List:
Name Type Description Req Notes SmartDeviceLink Ver Available
buttonName ButtonName Name of the button which triggered this event SmartDeviceLink 1.0
buttonEventMode ButtonEventMode Indicates button was depressed (DOWN) or released (UP) SmartDeviceLink 1.0
customButtonID Integer If ButtonName is CUSTOM_BUTTON", this references the integer ID passed by a custom button. (e.g. softButton ID) N Minvalue=0 Maxvalue=65536 SmartDeviceLink 2.0

Fields

KEY_BUTTON_EVENT_MODE

public static final java.lang.String KEY_BUTTON_EVENT_MODE
Constant Value
"buttonEventMode"

KEY_BUTTON_NAME

public static final java.lang.String KEY_BUTTON_NAME
Constant Value
"buttonName"

KEY_CUSTOM_BUTTON_ID

public static final java.lang.String KEY_CUSTOM_BUTTON_ID
Constant Value
"customButtonID"

Inherited Fields

From Class Fields
com.smartdevicelink.proxy.RPCMessage KEY_REQUEST, KEY_RESPONSE, KEY_NOTIFICATION, KEY_FUNCTION_NAME, KEY_PARAMETERS, KEY_CORRELATION_ID, messageType, parameters, function
com.smartdevicelink.proxy.RPCStruct KEY_BULK_DATA, KEY_PROTECTED, store

Constructors

OnButtonEvent()

Constructs a newly allocated OnButtonEvent object

public OnButtonEvent()

OnButtonEvent( java.util.Hashtable<java.lang.String, java.lang.Object> hash )

Constructs a newly allocated OnButtonEvent object indicated by the Hashtable parameter

public OnButtonEvent(java.util.Hashtable<java.lang.String, java.lang.Object> hash)

Constructor Parameters

hash
The Hashtable to use to create this RPC

OnButtonEvent( ButtonName buttonName, ButtonEventMode buttonEventMode )

Constructs a newly allocated OnButtonEvent object

public OnButtonEvent(ButtonName buttonName,ButtonEventMode buttonEventMode)

Constructor Parameters

buttonName
name of the button
buttonEventMode
indicates the button is pressed or released

Methods

getButtonName()

Returns ButtonName the button's name

public com.smartdevicelink.proxy.rpc.enums.ButtonName getButtonName()

setButtonName( ButtonName buttonName )

Set the button's name

public com.smartdevicelink.proxy.rpc.OnButtonEvent setButtonName(ButtonName buttonName)

Method Parameters

buttonName
name of the button

getButtonEventMode()

Return ButtonEventMode indicates the button was depressed or released

public com.smartdevicelink.proxy.rpc.enums.ButtonEventMode getButtonEventMode()

setButtonEventMode( ButtonEventMode buttonEventMode )

Set the event mode of the button,pressed or released

public com.smartdevicelink.proxy.rpc.OnButtonEvent setButtonEventMode(ButtonEventMode buttonEventMode)

Method Parameters

buttonEventMode
indicates the button is pressed or released

setCustomButtonID( Integer customButtonID )

public com.smartdevicelink.proxy.rpc.OnButtonEvent setCustomButtonID(Integer customButtonID)

Method Parameters

customButtonID

getCustomButtonID()

public java.lang.Integer getCustomButtonID()

Inherited Methods

From Class Methods
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
View on GitHub.com
Previous Section Next Section