We have a brand new look! Take a tour with us and explore the latest updates on Adobe Support Community.
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?
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 ?
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.
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.
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?
Adding it to nativeApplication seems to work. I don't have anything small I can easily provide for comparison. Thanks for the help!
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.