Open 2236863943-name opened 1 week ago
可以在 CustomAction 中使用 controller.touch 系列函数实现,第一个参数 contact 就是手指编号
请问有相关使用文档吗?
可以在 CustomAction 中使用 controller.touch 系列函数实现,第一个参数 contact 就是手指编号
{
"PinchGesture": {
"action": "Custom",
"custom_action": "performPinchGesture",
"custom_action_param": {
"finger1_start": [100, 100],
"finger1_end": [500, 500],
"finger2_start": [900, 100],
"finger2_end": [500, 500]
}
}
}
def performPinchGesture(param):
from controller import touch
# 模拟第一个手指的按下、移动和抬起
touch.down(param['finger1_start'][0], param['finger1_start'][1], 0)
touch.move(param['finger1_end'][0], param['finger1_end'][1], 0)
touch.up(0)
# 模拟第二个手指的按下、移动和抬起
touch.down(param['finger2_start'][0], param['finger2_start'][1], 1)
touch.move(param['finger2_end'][0], param['finger2_end'][1], 1)
touch.up(1)
请问是这样吗?我该把python代码放在哪个文件里?
{ "PinchGesture": { "action": "Custom", "custom_action": "performPinchGesture", "custom_action_param": { "finger1_start": [100, 100], "finger1_end": [500, 500], "finger2_start": [900, 100], "finger2_end": [500, 500] } } }
def performPinchGesture(param): from controller import touch # 模拟第一个手指的按下、移动和抬起 touch.down(param['finger1_start'][0], param['finger1_start'][1], 0) touch.move(param['finger1_end'][0], param['finger1_end'][1], 0) touch.up(0) # 模拟第二个手指的按下、移动和抬起 touch.down(param['finger2_start'][0], param['finger2_start'][1], 1) touch.move(param['finger2_end'][0], param['finger2_end'][1], 1) touch.up(1)
请问是这样吗?我该把python代码放在哪个文件里?
思路是对的,但python代码部分就...
Pipeline协议中动作类型有以下几种, DoNothing、Click、Swipe、Key、InputText、StartApp、StopApp、StopTask、Custom。 请问是否支持多指操作?比如双指捏合等。