feat: save screenshot after action

This commit is contained in:
lilong.129
2025-05-12 18:04:56 +08:00
parent 0722e92e87
commit 9c735bd46a
9 changed files with 72 additions and 50 deletions
+4 -4
View File
@@ -262,7 +262,7 @@ func (ud *UIA2Driver) DoubleTap(x, y float64, opts ...option.ActionOption) error
if err != nil {
return err
}
defer postHandler(ud, actionOptions)
defer postHandler(ud, ACTION_DoubleTapXY, actionOptions)
data := map[string]interface{}{
"actions": []interface{}{
@@ -304,7 +304,7 @@ func (ud *UIA2Driver) TapAbsXY(x, y float64, opts ...option.ActionOption) error
if err != nil {
return err
}
defer postHandler(ud, actionOptions)
defer postHandler(ud, ACTION_TapAbsXY, actionOptions)
duration := 100.0
if actionOptions.PressDuration > 0 {
@@ -367,7 +367,7 @@ func (ud *UIA2Driver) Drag(fromX, fromY, toX, toY float64, opts ...option.Action
if err != nil {
return err
}
defer postHandler(ud, actionOptions)
defer postHandler(ud, ACTION_Drag, actionOptions)
data := map[string]interface{}{
"startX": fromX,
@@ -398,7 +398,7 @@ func (ud *UIA2Driver) Swipe(fromX, fromY, toX, toY float64, opts ...option.Actio
if err != nil {
return err
}
defer postHandler(ud, actionOptions)
defer postHandler(ud, ACTION_Swipe, actionOptions)
duration := 200.0
if actionOptions.PressDuration > 0 {