Skip to content
Merged
Changes from 1 commit
Commits
Show all changes
22 commits
Select commit Hold shift + click to select a range
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Prev Previous commit
Next Next commit
long press fix
  • Loading branch information
AAswordman committed Dec 11, 2025
commit 501e41d95e4c6d3ce00fb9570dac0a21a0cc06ca
Original file line number Diff line number Diff line change
Expand Up @@ -801,19 +801,16 @@ open class StandardUITools(protected val context: Context) {
parseRelativePoint(element, screenWidth, screenHeight)
?: return fail(message = "Invalid element coordinates for Long Press: $element")
// 通过起点终点相同且较长duration的滑动来模拟长按
val swipeTool =
val longPressTool =
AITool(
name = "swipe",
name = "long_press",
parameters =
listOf(
ToolParameter("start_x", x.toString()),
ToolParameter("start_y", y.toString()),
ToolParameter("end_x", x.toString()),
ToolParameter("end_y", y.toString()),
ToolParameter("duration", "600")
ToolParameter("x", x.toString()),
ToolParameter("y", y.toString())
)
)
val result = swipe(swipeTool)
val result = longPress(longPressTool)
if (result.success) ok() else fail(message = result.error ?: "Long press failed at ($x,$y)")
}
"Wait" -> {
Expand Down