Google Answers Logo
View Question
 
Q: Javascript, Safari, capturing keypresses without focus ( No Answer,   0 Comments )
Question  
Subject: Javascript, Safari, capturing keypresses without focus
Category: Computers > Programming
Asked by: alexander-ga
List Price: $51.00
Posted: 20 Jul 2003 08:33 PDT
Expires: 19 Aug 2003 08:33 PDT
Question ID: 233023
Is there a way, in Javascript, to capture individual keypresses in
Apple's Safari browser when a text field does not have focus? (Must
work in 1.0, betas are a plus but not required.) In particular, I'd
like to be able to capture the arrow keys.

In IE and Mozilla, this works:
<body onKeyDown="foo(event.keyCode);">

If there's no "clean" way to do it, I may be willing to kludge. One
idea I had was to make a text field, and force it to always have
focus. This lets me capture regular characters (via <input
onKeyDown=...>), but the arrow keys always return a keycode of "0".
(The IE/Mozilla code above returns distinguishable keycodes for the
arrow keys.)
Answer  
There is no answer at this time.

Comments  
There are no comments at this time.

Important Disclaimer: Answers and comments provided on Google Answers are general information, and are not intended to substitute for informed professional medical, psychiatric, psychological, tax, legal, investment, accounting, or other professional advice. Google does not endorse, and expressly disclaims liability for any product, manufacturer, distributor, service or service provider mentioned or any opinion expressed in answers or comments. Please read carefully the Google Answers Terms of Service.

If you feel that you have found inappropriate content, please let us know by emailing us at answers-support@google.com with the question ID listed above. Thank you.
Search Google Answers for
Google Answers  


Google Home - Answers FAQ - Terms of Service - Privacy Policy