If you're using firebug or web inspector, pop out the console window.  If the 
the embedded console has focus your document doesn't, this always screws me up 
when adding keyboard events

However, I may be misreading your problem.

Sent from my iPhone

On Jul 22, 2010, at 10:47 PM, Matt Thomson <[email protected]> wrote:

> I think that will work well for the false positives when someone is in
> a textarea, but the bigger problem is that there is no alert when a
> user is not in a input field.
> 
> On Jul 23, 4:43 pm, Aaron Newton <[email protected]> wrote:
>> check the event.target. if it's an input, don't alert.
>> 
>> On Thu, Jul 22, 2010 at 9:34 PM, Matt Thomson <[email protected]> wrote:
>>> Thanks for the code, I can get this to work:
>> 
>>> //keydown in text input makes alert
>>> $('id_of_a_text_input').addEvent('keydown', function(event)
>>> {alert(1)});
>> 
>>> But the code below seems to only make all the input fields have the
>>> above behaviour:
>>> //all input areas inherit above behavior:
>>> $(document.body).addEvent('keydown', function(event){alert(1)});
>> 
>>> Is there someway to get the key buttons to work when the cursor is not
>>> in an input field, as the user of the slideshow will just go onto the
>>> page, and then hit the arrow buttons.
>> 
>>> On Jul 23, 7:19 am, Aaron Newton <[email protected]> wrote:
>>>>> 'keydown' not 'keyDown'
>> 
>>>> my bad.

Reply via email to