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 +}