Hi,

We are developing a mechanism to send event from nsAppShell to JS. (The event 
is hardware keyboard plug in and plug out).

We follow this way: nsAppShell notifys event to hal/Hal.cpp, then Hal will 
notify event to HardwareKeyboardManager. We added HardwareKeyboardManager to 
dom folder with following files:
gecko/dom/hardwarekeyboard/HardwareKeyboardManager.h
gecko/dom/hardwarekeyboard/HardwareKeyboardManager.cpp
gecko/dom/hardwarekeyboard/Types.h
gecko/dom/hardwarekeyboard/nsIDOMHardwareKeyboardManager.idl
gecko/dom/hardwarekeyboard/nsINavigatorHardwareKeyboardManager.idl

By this, we added new object(hardwareKeyboardManager) to navigator.

At the end, we can use navigator.hardwareKeyboardManager on JavaScript to get 
current state of hardware keyboard. At HardwareKeyboardManager, we also 
received the event from Hal.cpp through observer.

However, we always got crash when we DispatchTrustedEvent in 
HardwareKeyboardManager.cpp, (on JS we added listener 
navigator.hardwareKeyboardManager.addEventListener(...);

I need your help here. What is the cause of this crash and how to solve it?

Many thanks.
Tung.
_______________________________________________
dev-b2g mailing list
[email protected]
https://lists.mozilla.org/listinfo/dev-b2g

Reply via email to