Skip to main content
Inspiring
August 27, 2016
Question

StageWebView problem with Backspace on Windows

  • August 27, 2016
  • 2 replies
  • 1174 views

Hi, I have a problem with StageWebView on Windows.

When I add a keydown listener to the html window or document object, it will not dispatch the event for the backspace. All other keys are working and this occurs only on Windows. Is this a bug or the expected behaviour? How can I detect a backspace keydown if it's the default behaviour?

I'm using StageWebView with the flag useNative=true.

Thanks, Solano

This topic has been closed for replies.

2 replies

August 30, 2016

What version of AIR and Windows are you using? Since you are using the "useNative=true" option, StageWebView should technically be trying to render using the OSes natively installed browsers rendering engine. With Windows that will either be IE or Edge depending on which version of Windows you are using. Doing a quick search on "internet explorer javascript backspace keydown" yields results on issues with detecting key presses for special characters in IE that you have to make considerations for.

Inspiring
August 30, 2016

wadedwalker​, Thank you for your response.

I made a very simple app and tested it with AIR 19, 20 and 22 on Windows 7, 8 and 10. So basically the html runs with the browsers IE10, 11 and Edge. The javascript works fine when I open the html directly in the browser and the backspace dispatches the event. But inside the AIR app the backspace won't dispatch the event, all other keys are working like expected.

This is the test html:

<html>
<head></head>
<body>
     Some text...
     <script>
          document.onkeydown = function(e)
          {
               e = e || window.event;
               alert('key down: '+e.keyCode);
          }
     </script>
</body>
</html>

I think it has something to do how Air invokes or instantiates the native browser. Maybe there is some bug and I wanted to know if somebody already faced this problem.

August 30, 2016

It sounds like you have been thoroughly testing this and I feel like I wasted your time. I'm sorry I didn't have a helpful response for you. A few questions/ideas for you to try if you haven't already. Have you tried using "useNative=false" so that it will use the built-in Webkit (the one used by HTMLLoader) to see if it has the same result? Also, can you have the StageWebView(useNative=true) go to website that displays your user agent to confirm that it is using the IE UA? I thought I remember reading someone else on these forums semi-recently having an issue that StageWebView(true) wasn't working as expected on Windows. Last question, what were you using the backspace detection for?

Inspiring
August 29, 2016

Nobody?