Bharath Pabba
Bharath Pabba

Reputation: 1855

Gestures in Android Talkback

There are many gestures assigned in Talk-back. For instance all the L- gestures such as

I learnt that we can assign these gestures to different actions in Talk-back settings. But can we assign them to different actions programatically? Is it possible to create new gestures similar to them?

Upvotes: 0

Views: 1802

Answers (1)

MobA11y
MobA11y

Reputation: 18860

Accessibility services have a method that allows you to detect these gestures. Override it, no need to create new gestures at all!

class YourService extends AccessibilityService {
    @Override
    public boolean onGesture(int gestureId) {
        switch (gestureId) {
            case GESTURE_SWIPE_LEFT_AND_RIGHT:
                doStuff();
                return true;

            default:
                return false;
        }
    }
}

Upvotes: 1

Related Questions