cohtml.InputSystem.InputBase
Base input class responsible for subscribing to Unity3D input events and relaying them to the CohtmlInputHandler. Works with Unity3D’s Input Manager or Input System.
Inherits from IDisposable
Inherited by cohtml.InputSystem.InputManager
Public Functions
Name | |
---|---|
virtual abstract MouseEvent | ProcessMouseEvent() =0 Invoked when mouse events must be processed. |
virtual abstract KeyEvent | ProcessKeyEvent() =0 Invoked when keyboard events must be processed. |
void | UpdateTouches(CohtmlView view, TouchEventData [] touchEventData, uint touchesCount) Updates the GestureManager’s with the states of the touch events that happened this frame. |
virtual KeyEventData.EventLocation | GetKeyLocation(int keyCode) Returns the key location of the provided key code. |
virtual EventModifiersState | UpdateKeyboardModifiers(bool isCtrlDown, bool isAltDown, bool isShiftDown, bool isNumLockDown, bool isCapsLockDown, bool isMetaDown, bool isAltGrDown) Updates the state of the keyboard key modifiers. |
virtual void | Dispose() |
InputBase | Initialize() Creates a InputSystem or InputManager instance based on which Unity3D input package is used. |
Protected Functions
Name | |
---|---|
InputBase() | |
Vector2 | SetScrollData(Vector2 scroll) |
virtual void | MapUnityCodesWithSystemCodes() |
virtual abstract bool | IsNumPadKey(int keyCode) =0 |
virtual abstract EventMouseModifiersState | GetMouseModifiers() =0 |
virtual abstract EventModifiersState | GetKeyboardModifiers() =0 |
Public Properties
Name | |
---|---|
Action< MouseEvent, InputEventWrapper > | OnMouseEvent Invoked when a mouse event occurs. |
Action< KeyEvent, InputEventWrapper > | OnKeyEvent Invoked when a keyboard event occurs. |
Action< KeyEvent, char > | OnCharEvent Invoked when a character event occurs. |
Action< TouchEventCollection > | OnTouchEvent Invoked when a touch event occurs. |
GamepadBase | Gamepad An instance of the current gamepad manager. |
Protected Attributes
Name | |
---|---|
Dictionary< int, int > | s_KeyCodeMapping |
int [] | s_RightKeysMap |
int [] | s_LeftKeysMap |
TouchEventCollection | s_TouchDataCached |
InputEventWrapper | m_UnityEvent |
Public Functions Documentation
function ProcessMouseEvent
virtual abstract MouseEvent ProcessMouseEvent() =0
Invoked when mouse events must be processed.
Reimplemented by: cohtml.InputSystem.InputManager.ProcessMouseEvent
function ProcessKeyEvent
virtual abstract KeyEvent ProcessKeyEvent() =0
Invoked when keyboard events must be processed.
Reimplemented by: cohtml.InputSystem.InputManager.ProcessKeyEvent
function UpdateTouches
void UpdateTouches(
CohtmlView view,
TouchEventData [] touchEventData,
uint touchesCount
)
Updates the GestureManager’s with the states of the touch events that happened this frame.
function GetKeyLocation
virtual KeyEventData.EventLocation GetKeyLocation(
int keyCode
)
Returns the key location of the provided key code.
function UpdateKeyboardModifiers
virtual EventModifiersState UpdateKeyboardModifiers(
bool isCtrlDown,
bool isAltDown,
bool isShiftDown,
bool isNumLockDown,
bool isCapsLockDown,
bool isMetaDown,
bool isAltGrDown
)
Updates the state of the keyboard key modifiers.
function Dispose
virtual void Dispose()
function Initialize
static InputBase Initialize()
Creates a InputSystem or InputManager instance based on which Unity3D input package is used.
Return: An instance of the created object.
Protected Functions Documentation
function InputBase
InputBase()
function SetScrollData
Vector2 SetScrollData(
Vector2 scroll
)
function MapUnityCodesWithSystemCodes
virtual void MapUnityCodesWithSystemCodes()
Reimplemented by: cohtml.InputSystem.InputManager.MapUnityCodesWithSystemCodes
function IsNumPadKey
virtual abstract bool IsNumPadKey(
int keyCode
) =0
Reimplemented by: cohtml.InputSystem.InputManager.IsNumPadKey
function GetMouseModifiers
virtual abstract EventMouseModifiersState GetMouseModifiers() =0
Reimplemented by: cohtml.InputSystem.InputManager.GetMouseModifiers
function GetKeyboardModifiers
virtual abstract EventModifiersState GetKeyboardModifiers() =0
Reimplemented by: cohtml.InputSystem.InputManager.GetKeyboardModifiers
Public Property Documentation
property OnMouseEvent
Action< MouseEvent, InputEventWrapper > OnMouseEvent;
Invoked when a mouse event occurs.
property OnKeyEvent
Action< KeyEvent, InputEventWrapper > OnKeyEvent;
Invoked when a keyboard event occurs.
property OnCharEvent
Action< KeyEvent, char > OnCharEvent;
Invoked when a character event occurs.
property OnTouchEvent
Action< TouchEventCollection > OnTouchEvent;
Invoked when a touch event occurs.
property Gamepad
GamepadBase Gamepad;
An instance of the current gamepad manager.
Protected Attributes Documentation
variable s_KeyCodeMapping
static Dictionary< int, int > s_KeyCodeMapping;
variable s_RightKeysMap
static int [] s_RightKeysMap;
variable s_LeftKeysMap
static int [] s_LeftKeysMap;
variable s_TouchDataCached
static TouchEventCollection s_TouchDataCached;
variable m_UnityEvent
InputEventWrapper m_UnityEvent;