Copy link to clipboard
Copied
I am trying to use the menu button on android phones, which just fires off keyboard events. I se the events firing just fine until I add a StageWebView instance. Once it has been created, the keyboard events stop firing. Anyone know if there is something I need to do to capture them? Is the StageWebView stealing focus or something?
I had a similar issue happening where keyboard events tied to the stage weren't heard after a specific senerio, I never figured it out. Instead i added the event Listener to native application and the problem was rectified.
NativeApplication.nativeApplication.addEventListener(KeyboardEvent.KEY_DOWN,keysDown);
Copy link to clipboard
Copied
If the StageWebView has focus, you should be able to capture only the hardware key events (like BACK, ..). All the others are handled internally by StageWebView.
Do you see otherwise? If yes, can you post your application ?
Thanks,
Raul
Copy link to clipboard
Copied
I had a standard keyboard event listener set up against the stage. Before the StageWebView is added I see the events firing from the menu button, etc. After its added those events are no longer received. I dont want the StageWebView to get focus at all, is there a way to prevent this? In this particular case the StageWebView is being used strictly to display a Google adsense ad.
Copy link to clipboard
Copied
I had a similar issue happening where keyboard events tied to the stage weren't heard after a specific senerio, I never figured it out. Instead i added the event Listener to native application and the problem was rectified.
NativeApplication.nativeApplication.addEventListener(KeyboardEvent.KEY_DOWN,keysDown);
Copy link to clipboard
Copied
I checked your scenario and I can see the keyboard events firing on Android even after the StageWebView is added to the stage.
Can you please provide a small sample for your case?
Thank you,
Mirela
Copy link to clipboard
Copied
Adding it to nativeApplication seems to work. I don't have anything small I can easily provide for comparison. Thanks for the help!
Copy link to clipboard
Copied
Recently realized this was working before my change on some phones. Probably not actually related to the phones though. I bet it had something to do with focus. For now I'm going to stick with using the nativeApplication fix though.