Class: KeyEventManager

olympe.ui.events. KeyEventManager

Manages keyboard events.


new KeyEventManager(uiProxy)

Creates an instance of KeyEventManager.

Parameters:
Name Type Description
uiProxy olympe.uiapi.UIElement
Implements:

Extends

Methods


getEventKeyDown()

Gets the 'Key Down' events. i.e. the key has been pressed down.

Implements:
Returns:

Key event

Type
olympe.df.Proxy.<olympe.ui.events.KeyEvent> | olympe.ui.events.KeyEvent

getEventKeyPressed()

Gets the 'Key Pressed' events. i.e. a key has been pressed then released.

Implements:
Returns:

Key event

Type
olympe.df.Proxy.<olympe.ui.events.KeyEvent> | olympe.ui.events.KeyEvent

getEventKeyUp()

Gets the 'Key Up' events.

Implements:
Returns:

Key event

Type
olympe.df.Proxy.<olympe.ui.events.KeyEvent> | olympe.ui.events.KeyEvent

<protected> offEvent(id, callbackList)

Removes a specific callback from a callback list.

Parameters:
Name Type Description
id string | olympe.df.Proxy.<string>

ID of the callback to remove

callbackList olympe.ui.events.EventCallbackList

callback list

Inherited From:
Overrides:

offKeyDown(id)

Unregisters a callback from 'Key Down' events.

Parameters:
Name Type Description
id string

id the Id of the callback (returned by onKeyDown)

Implements:

offKeyPressed(id)

Unregisters a callback from 'Key Pressed' events.

Parameters:
Name Type Description
id string

id the Id of the callback (returned by onKeyPressed)

Implements:

offKeyUp(id)

Unregisters a callback from 'Key Up' events.

Parameters:
Name Type Description
id string

id the Id of the callback (returned by onKeyUp)

Implements:

<protected> onEvent(callback, id, priority, callbackList, offFunction)

Creates an EventCallback and add to a list of callbacks, inserting it according to its priority.

Parameters:
Name Type Description
callback function

the function to associate to the callback

id string | undefined

ID for this new callback

priority number | undefined

Priority for the new callback.

callbackList olympe.ui.events.EventCallbackList

the list to add this callback to

offFunction function

Function to execute when the context is destroyed

Inherited From:
Overrides:
Returns:

Id ID of the created callback

Type
string

onKeyDown(callback [, id] [, priority])

Registers a callback for 'Key Down' events.

Parameters:
Name Type Argument Default Description
callback olympe.ui.events.OnKeyEventCallback

the callback to register

id string <optional>

Id of event auto-generated if omitted

priority number <optional>
0

Priority of event (higher number = higher priority)

Implements:
Returns:

Id of the callback

Type
string

onKeyPressed(callback [, id] [, priority])

Registers a callback for 'Key Pressed' events.

Parameters:
Name Type Argument Default Description
callback olympe.ui.events.OnKeyEventCallback

the callback to register

id string <optional>

Id of event auto-generated if omitted

priority number <optional>
0

Priority of event (higher number = higher priority)

Implements:
Returns:

Id of the callback

Type
string

onKeyUp(callback [, id] [, priority])

Registers a callback for 'Key Up' events.

Parameters:
Name Type Argument Default Description
callback olympe.ui.events.OnKeyEventCallback

the callback to register

id string <optional>

Id of event auto-generated if omitted

priority number <optional>
0

Priority of event (higher number = higher priority)

Implements:
Returns:

Id of the callback

Type
string

<protected> registerOnEvent(event, eventsList)

Registers a list of callbacks to an Event.

Parameters:
Name Type Description
event olympe.df.Proxy.<olympe.ui.events.Event> | olympe.ui.events.Event
eventsList olympe.ui.events.EventCallbackList
Inherited From:
Overrides: