IInput 输入 input


静态变量 Static Variable

静态变量 Static Variable说明 Description 备注 Note
IInput.down(bool) 鼠标 / 触摸 按下状态 Mouse / Touch press or touch 只读 Read-only
IInput.Tlong(bool) 鼠标 / 触摸 长按状态(大概1秒) Mouse / Touch press over 1 second 只读 Read-only
IInput.move(bool) 鼠标 / 触摸 按下并移动中 Mouse / Touch press or touch with move 只读 Read-only
IInput.up(bool) 鼠标 / 触摸 抬起 Mouse / Touch rise 只读 Read-only
IInput.x(Number) 鼠标 / 触摸 x坐标(游戏坐标系) Mouse / Touch x-coordinate(coordinate System of game) 只读 Read-only
IInput.y(Number) 鼠标 / 触摸 y坐标(游戏坐标系) Mouse / Touch y-coordinate(coordinate System of game) 只读 Read-only
IInput.dx(Number) 鼠标 / 触摸 按下位置的x坐标(游戏坐标系) Mouse / Touch x-coordinate when clicking(coordinate System of game) 只读 Read-only
IInput.dy(Number) 鼠标 / 触摸 按下位置的y坐标(游戏坐标系) Mouse / Touch y-coordinate when clicking(coordinate System of game) 只读 Read-only
IInput.mouseButton(Number)

鼠标的按键 Mouse buttons

0 为左键 left button

1 为右键 right button

2 为中键 middle button

只读,除PC端外,其他端值均为 0

IInput.touches(array)

多点触控的 触摸值集合 Touch value set of multi touch

touch 对象由 id、clientX、clientY组成 Touch object consists of id, clientX and clientY

只读 Read-only
IInput.BackButton(bool) android端 返回键是否被按下 Whether the return button of Android is pressed or not

只读,仅android端有效 Read-only,Only android is valid

IInput.HomeButton(bool) android端 Home键是否被按下 Whether the home button of Android is pressed or not 只读,仅android端有效 Read-only,Only android is valid
IInput.MenuButton(bool) android端菜单键是否被按下 Whether the menu button of Android is pressed or not 只读,仅android端有效 Read-only,Only android is valid

静态函数 Static Function

静态函数 Static Function说明 Description 备注 Note
IInput.isKeyDown(code)

键盘code键是否被按下 Whether the key "code" is pressed or not

code(Number) 按键code key code

返回值 bool是否按下 Return bool(the key is pressed or not)

code编码为js编码 encoding with JS
IInput.isKeyPress(code)

键盘code键是否被按住 Whether the key "code" is keep pressed or not

code(Number) 按键code key code

返回值 bool是否按住 Return bool(the key is keep pressed or not)

code编码为js编码 encoding with JS