Responsible for the event handling of elements.
Static variables
privatestaticevents:Map<Element, Array<Event>> = new Map<Element,Array<Event>>()
All currently active events.
staticread onlymouseDX:Int = 0
The delta x position of the mouse (the difference of the x position to the last frame)
staticread onlymouseDY:Int = 0
The delta y position of the mouse (the difference of the y position to the last frame)
Static methods
staticinlineaddEvent(event:Event):Void
Adds an event to the event array. Events are sent in an update loop and not directly at the moment they happen to prevent stack overflows through circular calls and to make the overall process more stable.
privatestaticgetListeningParent(element:Null<Element>, eventClass:Class<Event>):Null<Element>
Return the lowest element in the parent/layout hierarchy (beginning with and including the passed element) that listens to the given event type.
privatestaticonKeyboardDown(key:KeyCode):Void
Called on the first frame a key is pressed down.
Parameters:
key | The keycode of the key |
---|
privatestaticonKeyboardPress(char:String):Void
Called when a key is pressed down. Note that this is called once on the first frame the key is pressed and after that on a certain time interval to simulate a OS-like input behaviour. Also, this method is only called by keys that represent a character.
Parameters:
char | The character that is pressed down |
---|
privatestaticonKeyboardUp(key:KeyCode):Void
Called on the first frame a key is no longer pressed down.
Parameters:
key | The keycode of the key |
---|
staticinlineregisterCutCopyPaste(onCut:() ‑> String, onCopy:() ‑> String, onPaste:String ‑> Void):Void
privatestaticunblock(forceNow:Bool = false):Void
Unblocks the currently blocking element. The unblocking takes place in
the next frame to not react to ongoing events. The forceNow
parameter
is a way around that behaviour.
Parameters:
forceNow | If |
---|
staticupdate():Void
Updates all the events and calls registered listeners. Used internally most of the time.