Class enchant.InputManager
Class for managing input.
- Defined in: enchant.js
- Extends enchant.EventTarget
Constructor Attributes | Constructor Name and Description |
---|---|
enchant.InputManager(valueStore, source)
|
Field Attributes | Field Name and Description |
---|---|
Array that store event target.
|
|
source that will be added to event object.
|
|
Object that store input state.
|
Method Summary
Method Attributes | Method Name and Description |
---|---|
addBroadcastTarget(eventTarget)
Add event target.
|
|
bind(inputSource, name)
Name specified input.
|
|
Dispatch event to enchant.InputManager#broadcastTarget.
|
|
changeState(name, data)
Change state of input.
|
|
removeBroadcastTarget(eventTarget)
Remove event target.
|
|
unbind(inputSource)
Remove binded name.
|
- Methods borrowed from class enchant.EventTarget:
- addEventListener
- clearEventListener
- dispatchEvent
- on
- removeEventListener
Class Detail
enchant.InputManager(valueStore, source)
- Parameters:
- {*} valueStore
- object that store input state.
- {*} source Optional, Default: this
- source that will be added to event object.
Field Detail
{enchant.EventTarget[]}
broadcastTarget
Array that store event target.
{Object}
source
source that will be added to event object.
{Object}
valueStore
Object that store input state.
Method Detail
-
addBroadcastTarget(eventTarget)Add event target.
- Parameters:
- {enchant.EventTarget} eventTarget
- broadcast target.
-
bind(inputSource, name)Name specified input. Input can be watched by flag or event.
- Parameters:
- {enchant.InputSource} inputSource
- input source.
- {String} name
- input name.
-
broadcastEvent(e)Dispatch event to enchant.InputManager#broadcastTarget.
- Parameters:
- {enchant.Event} e
- event.
-
changeState(name, data)Change state of input.
- Parameters:
- {String} name
- input name.
- {*} data
- input state.
-
removeBroadcastTarget(eventTarget)Remove event target.
- Parameters:
- {enchant.EventTarget} eventTarget
- broadcast target.
-
unbind(inputSource)Remove binded name.
- Parameters:
- {enchant.InputSource} inputSource
- input source.