MobileInputComponent Class
This component is responsible for configuring the correct input mode on mobile devices. It checks the user's input method (touch or mouse). If mouse is detected nothing is done and the component is removed. Otherwise, touch screen support is enabled.
Constructor
MobileInputComponent
-
core
Parameters:
-
core
CoreThe main engine.
Item Index
Methods
Methods
_bindListeners
()
Binds the listeners for input events
_onInputChanged
-
event
Called when an input event is detected. It disables the input method that is not necessary (touch or mouse).
Triggered on window events touchstart
, mousemove
, pointerdown
, or MSPointerDown
Parameters:
-
event
EventThe event object.
_unbindListeners.
()
Unbinds the listeners for input events
destroy
()
Destroys the component and removes all listeners.
disable
()
enable
()
getTargeted
-
vector
Parameters:
-
vector
VectorA position, usually the cursor's one.
Returns:
The targeted element, or null if nothing is found.
initialize
()
onContextChanged
-
context
Parameters:
-
context
StringThe new context
removeInputSupport
-
type
Removes support of an input method (touch or mouse).
Parameters:
-
type
StringThe type of input method to remove (touch or mouse).