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
iOS Documentation
SDLOnButtonPress

SDLOnButtonPress Class Reference

Section Contents

Overview

Notifies application of button press events for buttons to which the application is subscribed. SDL supports two button press events defined as follows:

SHORT - Occurs when a button is depressed, then released within two seconds. The event is considered to occur immediately after the button is released.

LONG - Occurs when a button is depressed and held for two seconds or more. The event is considered to occur immediately after the two second threshold has been crossed, before the button is released.

HMI Status Requirements:

HMILevel:

The application will receive OnButtonPress notifications for all subscribed buttons when HMILevel is FULL.

The application will receive OnButtonPress 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 OnButtonPress notification when HMILevel is BACKGROUND or NONE.

AudioStreamingState: Any

SystemContext: MAIN, VR. In MENU, only PRESET buttons. In VR, pressing any subscribable button will cancel VR.

@since SDL 1.0

buttonName

The button’s name

Required

Objective-C

@property (nonatomic, strong) SDLButtonName _Nonnull buttonName;

Swift

var buttonName: SDLButtonName { get set }

buttonPressMode

Indicates whether this is a LONG or SHORT button press event

Required

Objective-C

@property (nonatomic, strong) SDLButtonPressMode _Nonnull buttonPressMode;

Swift

var buttonPressMode: SDLButtonPressMode { get set }

customButtonID

If ButtonName is “CUSTOM_BUTTON”, this references the integer ID passed by a custom button. (e.g. softButton ID)

@since SDL 2.0

Optional, Integer 0 - 65536

Objective-C

@property (nonatomic, strong, nullable) NSNumber<SDLInt> *customButtonID;

Swift

var customButtonID: (NSNumber & SDLInt)? { get set }
View on GitHub.com
Previous Section Next Section