I'm looking for some help here folks. I'm working on a new blog series for InsideRIA (don't forget folks, most of my RIA stuff is there) involving jQuery and AIR. I've done a few entries already on using Aptana to build an application and now I want to dig a bit deeper into jQuery/AIR integration. I've built a simple application that's going to be the starting point for the new series. Right now it is barely AIR. By that I mean it doesn't use any of the APIs at all. Outside of running as an application, it's just a HTML window. That being said, while working on the application I noticed something truly odd I wanted to share with folks.
My application is a simple Hangman game. (I've included a zip if you want to try it out.) In order to play the game, I monitor key strokes so the user can guess at the word. Here is how I've done it:2 $("BODY").keypress(function(e) {
3 //only care if between A and z
4 if(e.which >= 65 && e.which <= 122) {
5 var c = String.fromCharCode(e.which)
6 handleGuess(c)
7 }
8 })
Comment 1 written by Jason Dean on 23 September 2009, at 9:05 AM
document.addEventListener('keypress', function(e) {
air.Introspector.Console.log(e);
var c = String.fromCharCode(e.which)
handleGuess(c)
})
The same problem occurs. So it does not appear to be jQuery causing the issue. I also tried it in Firefox, which I'm sure you also did, and the problem did not show up. So it seems like a good guess that it must be something in AIR that is causing it.