Well, that was no help, but here's what I found: Don't count on keycode
or charcode - with webKit, they're non-standard. BUT, and this was kind
of cool, use keyIdentifier. Here's what I got, and it works fine:
$(document).bind('keypress', function(evt){
switch(evt.keyIdentifier) {
case 'Up':
// Do some processing ...
break;
case 'Down':
// Do some processing ...
break;
case 'Left':
// Do some processing ...
break;
case 'Right':
// Do some processing ...
break;
}
};
Rey Bango wrote:
Hi Tobias,
I'm not sure if this will help but there's a free Adobe Air for
JavaScript PDF available here:
http://ajaxian.com/archives/adobe-air-free-book-download
It might be able to point you to a solution.
Rey
Tobias Parent wrote:
Ah. keypress is set to something screwy for the arrow keys, I think.
For alphanumeric, keypress works fine in Safari.
Glen Lipka wrote:
Did you try this plugin?
http://rikrikrik.com/jquery/shortkeys/
Glen
On 7/31/07, *Tobias Parent * <[EMAIL PROTECTED]
<mailto:[EMAIL PROTECTED]>> wrote:
OK, so Adobe AIR is built on the WebKit engine, same as Safari.
Which, I
think, means screwy keypress handling. If I change my bind() to the
keydown, it works fine, although I have to keep hitting it over
and over
to register the event.
My question is, does anybody successfully handle keypresses in
Safari
(and, I assume by extension, in AIR)? If so, how?!
Thanks!
-Toby