KeyboardEventEx Extensions

package scaleform.gfx
{
    import flash.events.KeyboardEvent;

    public final class KeyboardEventEx extends KeyboardEvent
    {
        public var controllerIdx : uint = 0;

        public function KeyboardEventEx(type:String) { super(type); }
    }
}

This event is an extension of the standard flash.events.KeyboardEvent. It adds a ‘controllerIdx’ member that indicates a zero-based index of the controller that caused the event. When Extensions.enabled property is set to true Scaleform always generates KeyboardEventEx events instead of standard KeyboardEvent. A user can check if the received event is an instance of the KeyboardEventEx and if so cast the event object to the extension type. Example:

import scaleform.gfx.*;
import flash.events.KeyboardEvent;

Extensions.enabled = true;

function ev(e: KeyboardEvent)
{
    if (e is KeyboardEventEx)
    {
        var ee: KeyboardEventEx = e as KeyboardEventEx;
        trace("controllerIdx = "+ee.controllerIdx);
    } 
}
stage.addEventListener(KeyboardEvent.KEY_DOWN, ev);
stage.addEventListener(KeyboardEvent.KEY_UP, ev);

controllerIdx property

controllerIdx : uint [read]

Scaleform version: 4.0.12

Indicates which keyboard/controller is used for the event (zero-based index).