-
-
Notifications
You must be signed in to change notification settings - Fork 3k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Write an abstraction for kivy.core.accessibility
, so accessibility tools have a proper API to work with
#8599
Comments
kivy.core.accessibility
abstraction for accessibility providers
#8596
Some questions:
|
Yes.
Since we're rewriting the
We did not added it yet to |
I will mostly talk in the context of AccessKit (which derived its data schema from Chromium): We have a role called
So, paragraphs don't matter here: if a line is too long so that it is split into two, then two nodes will be needed. Since text decoration and other text formatting attributes apply to an entire node, multiple inline text boxes will be needed if a line contains regular and bold text for instance. Also worth noting: we will need to receive events when the text selection changes. To have an idea of the kind of tree updates we have to produce, you can have a look at this test suite. |
The new
kivy.core.accessibility
provider will expose some classes, to better accommodate accessibility tools.kivy.core.accessibility.AccessibilityRoleType:
An
Enum
, that defines the role of the linked widget (static text, text box, container ...), so the accessibility tools can know how to act with a specific widget.As an example:
AccessibilityRoleType.STATIC_TEXT
AccessibilityRoleType.CONTAINER
kivy.core.accessibility.AccessibilityEventType:
An
Enum
, which defines the event type that has to be handled by the accessibility provider.As an example:
AccessibilityEventType.NEW
AccessibilityEventType.TEXT_CHANGED
kivy.core.accessibility.AccessibilityInterfaceBase:
A base class, that every widget (or set of widgets) can subclass to better accommodate its needs.
This serves as an interface between the widget and the accessibility provider (and vice-versa).
The
AccessibilityInterfaceBase
can bind to widget properties and send "repacked" events to the accessibility provider, by calling the.update(event)
method of theAccessibilityBase
object.The
AccessibilityBase
can reverse-walk the widget tree, to get the position of the widget linked to theAccessibilityInterfaceBase
that emitted the event. (when anAccessibilityEventType.NEW
is received).AccessibilityInterfaceBase
will also have widget-specialized methods to send "faked" events to the underlying widget. (pressed, released, text edited, ...)kivy.core.accessibility.AccessibilityEvent:
This class will serve as a container for the event information.
kivy.core.accessibility.AccessibilityBase:
The base implementation for every accessibility core provider implementation (as it happens for other core providers in the Kivy project).
As accessibility is pretty tied to the whole life-cycle of the app, the accessibility provider will be chosen during the
App
initialization, and before the Window creation (so the Window can signal to the accessibility provider that is ready).kivy.core.accessibility.AccessibilityBase
methods:The text was updated successfully, but these errors were encountered: