screen: add tap function

This commit is contained in:
2025-10-21 19:29:30 +02:00
parent 40af079fd2
commit 53cf344cc0

View File

@@ -28,6 +28,12 @@ func (d *Device) ToggleScreen() error {
return err
}
// Tap on a location on the screen
func (d *Device) TapScreen(x int, y int) error {
_, err := d.RunCommand(fmt.Sprintf("shell input tap %d %d", x, y))
return err
}
// Get the resolution of the screen
func (d *Device) GetScreenResolution() (int, int, error) {
@@ -120,4 +126,4 @@ func (d *Device) GetScreenText(xStart int, xEnd int, yStart int, yEnd int, white
return "", fmt.Errorf("tesseract error: %w", err)
}
return text, nil
}
}