Материал из Module developer
Перейти к: навигация, поиск

module.AddListener

Add listener

Синтаксис

module.AddListener(EventType, EventParent, Listener, [Pointer])

Название Пример Описание
EventType IR.EVENT_MODULE_START type: number
Event ID that is tracked by the listener
EventParent module.GetPopup("Popup 1").GetItem("Item 1") type: Object
Input parameter that is required to create a listener. If there is no parameter, put 0
Listener function(){...} type: Function
An Unnamed function or a link to a named function where actions are performed
Pointer type: Object
Pointer to an object, that services the function (optional)
На выходе
Boolean true type: Boolean
Result of adding a listener


Пример

module.AddListener(IR.EVENT_ITEM_PRESS,module.GetPopup("Popup 1").GetItem("Item 1"),function()
{
   IR.Log("Item 1 pressed");  
});

Events for a listener can be seen here: ссылка