Skip to content

Detecting gestures when TalkBack is enabled #1

@JJdeGroot

Description

@JJdeGroot

In the current version of the app (v1.0.2) the app cannot yet detect gestures when TalkBack is enabled.

One of the techniques is intercepting motion events, which works for basic gesture detection. But for advanced gestures, such as angular gestures, e.g. open the context menu, the motion events are not passed to the app.

An idea I had to overcome this, was to implement an AccessibilityService. This way, you can override the onGesture method and broadcast the gesture to the app. The implementation can be found in the ScreenReaderService file.

There are some problems with this implementation:

First: it requires users to enable the service through the accessibility settings of their device. This is a complex series of steps. I have tested this with users, and for most it was too difficult and/or scary to do.

Secondly: there are potential bugs which cause the device to "brick". This can happen because the ScreenReaderService receives all the gestures, but doesn't perform any actions upon receiving them. The service should de-activate itself when the gesture training is inactive, but this doesn't work with 100% confidence on all Android devices.

For the second issue, I looked into the new setGestureDetectionPassthrough method which was added in Android API 30. It looked promising, but I did not manage to get it to work. I did not notice different behavior compared to not setting a passthrough region.

I hope others have more idea's to recognize gestures when TalkBack is active.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions