Skip to main content
Version: v1.0

widget.removeEventListener(eventId, function)

Remove event listeners registered by the UI widget using the widget.addEventListener method.

Type

(eventId: EventId, callback) => void

Parameters

ParameterDescriptionType
eventIdEvent type (e.g., swipe, press, lift, etc.)number
callbackThe callback function to register.function

EventId

Refer to the EventId of addEventListener.

Code example

const img_bkg = hmUI.createWidget(hmUI.widget.IMG)
const listenerFunc = (info) => {
console.log(info.x)
}

img_bkg.addEventListener(hmUI.event.DOWN, listenerFunc)
img_bkg.removeEventListener(hmUI.event.DOWN, listenerFunc)