• Global community
    • Language:
      • Deutsch
      • English
      • Español
      • Français
      • Português
  • 日本語コミュニティ
    Dedicated community for Japanese speakers
  • 한국 커뮤니티
    Dedicated community for Korean speakers
Exit
Locked
0

StageWebView and keyboard events

Explorer ,
Nov 23, 2010 Nov 23, 2010

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?

TOPICS
Development

Views

1.7K

Translate

Translate

Report

Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines

correct answers 1 Correct answer

Engaged , Nov 28, 2010 Nov 28, 2010

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);

Votes

Translate

Translate
Adobe Employee ,
Nov 24, 2010 Nov 24, 2010

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

Votes

Translate

Translate

Report

Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Explorer ,
Nov 24, 2010 Nov 24, 2010

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.

Votes

Translate

Translate

Report

Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Engaged ,
Nov 28, 2010 Nov 28, 2010

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);

Votes

Translate

Translate

Report

Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Explorer ,
Nov 29, 2010 Nov 29, 2010

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

Votes

Translate

Translate

Report

Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Explorer ,
Nov 29, 2010 Nov 29, 2010

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!

Votes

Translate

Translate

Report

Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Explorer ,
Nov 30, 2010 Nov 30, 2010

Copy link to clipboard

Copied

LATEST

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.

Votes

Translate

Translate

Report

Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines