'keydown' not 'keyDown'

And yes, Keyboard is an incredibly awesome class, but most of the time a simple 
keydown or keyup event is enough in my experience.

On Jul 22, 2010, at 9:55 AM, Aaron Newton wrote:

> Keyboard does make this easy. It's only complicated if you are using more 
> than one Keyboard at a time (imagine if you had two slideshows on the screen; 
> Keyboard lets you switch focus from one widget to the other so that hitting 
> the right arrow key doesn't make them both rotate).
> 
> You don't need Keyboard to do this though. Just do this:
> 
> $(document.body).addEvent('keyDown', function(event) {
>   if (event.right) this.slideShowSwap(true);
> });
> 
> On Thu, Jul 22, 2010 at 12:06 AM, Sanford Whiteman 
> <[email protected]> wrote:
> > What I would like to be able to do as well is:
> > $(right_arrow_on_keyboard).addEvent('press_down', function(e)
> > {
> >         this.slideShowSwap(true);
> 
> That  looks a little backward. You probably want to handle the keydown
> event   on   document   and  then  check  event.code  and  fireEvent()
> accordingly.
> 
> Keyboard in -More I think would allow you to express the logic the way
> you  have it (programming the keys, as it were, instead of the window,
> though  the  same  events  are  used  under the hood). It looks pretty
> awesome but intimidating too.
> 
> -- Sandy
> 
> 

Reply via email to