From 53cf344cc05adb94665b1aa6ad4a3302b7470807 Mon Sep 17 00:00:00 2001 From: Wesley van Tilburg Date: Tue, 21 Oct 2025 19:29:30 +0200 Subject: [PATCH] screen: add tap function --- screen.go | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) diff --git a/screen.go b/screen.go index 46e42b6..7657b1c 100644 --- a/screen.go +++ b/screen.go @@ -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 -} \ No newline at end of file +}