C# Class ScriptRuntime.Input

输入类,包括键盘,鼠标,触控的输入
Inheritance: ScriptRuntime.Base
显示文件 Open project: Genesis-3D/Genesis-3D

Public Methods

Method Description
GetCurrentKeyEvents ( ) : ScriptRuntime.KeyEvent[]

得到当前按键的事件

GetCurrentMouseEvents ( ) : ScriptRuntime.MouseEvent[]

得到当前鼠标事件

GetCurrentTouchEvents ( ) : ScriptRuntime.TouchEvent[]

得到当前触点事件

GetScreenPosition ( System.Vector2 &outFloat2 ) : void

得到鼠标光标在屏幕上的位置

GetScreenTouchCount ( ) : int

得到屏幕上的触点个数,windows平台没实现

GetScreenTouchID ( int index ) : int

得到屏幕上触点ID

GetScreenTouchMovement ( int id ) : System.Vector2

得到手指在屏幕上的移动距离

GetScreenTouchPixelPosition ( int id ) : System.Vector2

得到在触点在屏幕上的像素位置

GetScreenTouchScreenPosition ( int id ) : System.Vector2

得到触点在屏幕的位置,为相对位置,范围:0-1

IsFingerDown ( int id ) : bool

手指是否按下

IsFingerPressing ( int id ) : bool

手指是否是按下状态

IsFingerUp ( int id ) : bool

手指是否弹起

KeyDown ( Code _keyCode ) : bool

按键是否被按下

KeyPressed ( Code _keyCode ) : bool

按键是否是持续按下状态

KeyUp ( Code _keyCode ) : bool

按键是否弹起

MouseButtonDown ( MouseCode _mouseCode ) : bool

鼠标按钮是否被按下

MouseButtonPressed ( MouseCode _mouseCode ) : bool

鼠标按钮是否是被按下状态

MouseButtonUp ( MouseCode _mouseCode ) : bool

鼠标按钮是否弹起

MouseGetMovement ( System.Vector2 &outFloat2 ) : void

得到鼠标光标在屏幕上的移动距离

MouseWheelBack ( ) : bool

鼠标滚轮是否向后滚动

MouseWheelForward ( ) : bool

鼠标滚轮是否向前滚动

Private Methods

Method Description
ICall_Input_GetCurrentKeyEvent ( int index, Code &code, InputEventType &_event ) : void
ICall_Input_GetCurrentKeyEventCount ( ) : int
ICall_Input_GetCurrentMouseButtonEvent ( int index, MouseCode &code, InputEventType &_event ) : void
ICall_Input_GetCurrentMouseButtonEventCount ( ) : int
ICall_Input_GetCurrentTouchEvent ( int index, int &id, InputEventType &_event ) : void
ICall_Input_GetCurrentTouchEventCount ( ) : int
ICall_Input_GetScreenPosition ( System.Vector2 &outFloat2 ) : void
ICall_Input_GetScreenTouchCount ( ) : int
ICall_Input_GetScreenTouchID ( int index ) : int
ICall_Input_GetScreenTouchMovement ( int index, System.Vector2 &moveMent ) : void
ICall_Input_GetScreenTouchPixelPos ( int index, System.Vector2 &pixelPos ) : void
ICall_Input_GetScreenTouchScreenPos ( int index, System.Vector2 &screenPos ) : void
ICall_Input_IsFingerDown ( int index ) : bool
ICall_Input_IsFingerPressing ( int index ) : bool
ICall_Input_IsFingerUp ( int index ) : bool
ICall_Input_KeyDown ( int _keyCode ) : bool
ICall_Input_KeyPressed ( int _keyCode ) : bool
ICall_Input_KeyUp ( int _keyCode ) : bool
ICall_Input_MouseButtonDown ( int _mouseCode ) : bool
ICall_Input_MouseButtonPressed ( int _mouseCode ) : bool
ICall_Input_MouseButtonUp ( int _mouseCode ) : bool
ICall_Input_MouseGetMovement ( System.Vector2 &outFloat2 ) : void
ICall_Input_MouseWheelBack ( ) : bool
ICall_Input_MouseWheelForward ( ) : bool

Method Details

GetCurrentKeyEvents() public static method

得到当前按键的事件
public static GetCurrentKeyEvents ( ) : ScriptRuntime.KeyEvent[]
return ScriptRuntime.KeyEvent[]

GetCurrentMouseEvents() public static method

得到当前鼠标事件
public static GetCurrentMouseEvents ( ) : ScriptRuntime.MouseEvent[]
return ScriptRuntime.MouseEvent[]

GetCurrentTouchEvents() public static method

得到当前触点事件
public static GetCurrentTouchEvents ( ) : ScriptRuntime.TouchEvent[]
return ScriptRuntime.TouchEvent[]

GetScreenPosition() public static method

得到鼠标光标在屏幕上的位置
public static GetScreenPosition ( System.Vector2 &outFloat2 ) : void
outFloat2 System.Vector2 鼠标光标在屏幕上的位置
return void

GetScreenTouchCount() public static method

得到屏幕上的触点个数,windows平台没实现
public static GetScreenTouchCount ( ) : int
return int

GetScreenTouchID() public static method

得到屏幕上触点ID
public static GetScreenTouchID ( int index ) : int
index int 触点索引
return int

GetScreenTouchMovement() public static method

得到手指在屏幕上的移动距离
public static GetScreenTouchMovement ( int id ) : System.Vector2
id int 触点索引
return System.Vector2

GetScreenTouchPixelPosition() public static method

得到在触点在屏幕上的像素位置
public static GetScreenTouchPixelPosition ( int id ) : System.Vector2
id int 触点索引
return System.Vector2

GetScreenTouchScreenPosition() public static method

得到触点在屏幕的位置,为相对位置,范围:0-1
public static GetScreenTouchScreenPosition ( int id ) : System.Vector2
id int 触点索引
return System.Vector2

IsFingerDown() public static method

手指是否按下
public static IsFingerDown ( int id ) : bool
id int 触点索引
return bool

IsFingerPressing() public static method

手指是否是按下状态
public static IsFingerPressing ( int id ) : bool
id int 触点索引
return bool

IsFingerUp() public static method

手指是否弹起
public static IsFingerUp ( int id ) : bool
id int 触点索引
return bool

KeyDown() public static method

按键是否被按下
public static KeyDown ( Code _keyCode ) : bool
_keyCode Code 键的枚举值
return bool

KeyPressed() public static method

按键是否是持续按下状态
public static KeyPressed ( Code _keyCode ) : bool
_keyCode Code 键的枚举值
return bool

KeyUp() public static method

按键是否弹起
public static KeyUp ( Code _keyCode ) : bool
_keyCode Code 键的枚举值
return bool

MouseButtonDown() public static method

鼠标按钮是否被按下
public static MouseButtonDown ( MouseCode _mouseCode ) : bool
_mouseCode MouseCode 鼠标按钮枚举值
return bool

MouseButtonPressed() public static method

鼠标按钮是否是被按下状态
public static MouseButtonPressed ( MouseCode _mouseCode ) : bool
_mouseCode MouseCode 鼠标按钮枚举值
return bool

MouseButtonUp() public static method

鼠标按钮是否弹起
public static MouseButtonUp ( MouseCode _mouseCode ) : bool
_mouseCode MouseCode 鼠标按钮枚举值
return bool

MouseGetMovement() public static method

得到鼠标光标在屏幕上的移动距离
public static MouseGetMovement ( System.Vector2 &outFloat2 ) : void
outFloat2 System.Vector2 鼠标光标在屏幕上的移动距离
return void

MouseWheelBack() public static method

鼠标滚轮是否向后滚动
public static MouseWheelBack ( ) : bool
return bool

MouseWheelForward() public static method

鼠标滚轮是否向前滚动
public static MouseWheelForward ( ) : bool
return bool