You can't turn off the KeyboardEvents that the Flash Player dispatches. But you can stop components from listening to them.

 

In the Button source code, I see

 

    override protected function keyDownHandler(event:KeyboardEvent):void

    {

        if (!enabled)

            return;

 

        if (event.keyCode == Keyboard.SPACE)

            buttonPressed();

    }

 

    override protected function keyUpHandler(event:KeyboardEvent):void

    {

        if (!enabled)

            return;

 

        if (event.keyCode == Keyboard.SPACE)

        {

            buttonReleased();

 

            if (phase == ButtonPhase.DOWN)

                dispatchEvent(new MouseEvent(MouseEvent.CLICK));

            phase = ButtonPhase.UP;

        }

    }

 

So you could write a BetterButton subclass and override these two handlers to not respond to the SPACE key. Then you'd use <BetterButton> everywhere instead of <Button>

 

- Gordon

 


From: [email protected] [mailto:[EMAIL PROTECTED] On Behalf Of jpc14_99
Sent: Saturday, November 04, 2006 3:19 PM
To: [email protected]
Subject: [flexcoders] How can I DISABLE THE STUPID SPACE BAR GLOBALLY?

 

Trouble!

So I found out today that the spacebar fires a click event on the last
focused button.

This includes hidden buttons, buttons in other states, and even
mouseEnabled = false buttons!! (The last one has to be a bug, why
would anyone want to allow keyboard 'clicks' on a button when they
aren't allowing mouse clicks on it.)

So basically I'm running around re-writing my event handlers for every
single button to ignore these spacebar triggers.

Is there someway I can just turn off this stupid spacebar from firing
the events?

Thanks!

Jamie

__._,_.___

--
Flexcoders Mailing List
FAQ: http://groups.yahoo.com/group/flexcoders/files/flexcodersFAQ.txt
Search Archives: http://www.mail-archive.com/flexcoders%40yahoogroups.com





SPONSORED LINKS
Software development tool Software development Software development services
Home design software Software development company

Your email settings: Individual Email|Traditional
Change settings via the Web (Yahoo! ID required)
Change settings via email: Switch delivery to Daily Digest | Switch to Fully Featured
Visit Your Group | Yahoo! Groups Terms of Use | Unsubscribe

__,_._,___

Reply via email to