Re: native equivalent of aria-live with NVDA


James Scholes
 

I found some old code that uses the live text display model, if it helps. Something like this inside your app module:

def chooseNVDAObjectOverlayClasses(self, obj, clsList):
if some condition to determine if obj is the area you want to make live:
clsList.insert(0, DisplayModelLiveText)

You can also subclass DisplayModelLiveText to implement custom line processing and then insert your subclass instead. E.g. override initOverlayClass, _reportNewText, etc.

Regards,

James Scholes

On 01/05/2021 at 2:57 pm, James Scholes wrote:
As I often find myself saying on this list, it will help greatly if you described what you're trying to do. The context really matters here. For example:

1. If you're trying to develop or modify a Windows app to fire screen reader announcements, UIA does support a very similar concept to an ARIA live region. The technologies used to implement that app will determine how easily you can gain access to the functionality, e.g. in a .NET WinForms app it's as easy as adding a control to a form and setting its text. In a wxPython app, not so much.
2. If you just want your add-on to say something, import ui and use ui.message.
3. If you're developing an add-on for an application with an updating stream of text, like a console-style interaction, and you want NVDA to automatically speak text as it comes in, there are ways to do that which I've never quite managed to get my head around. Try NVDAObjects.window.DisplayModelLiveText as a starting point.

Regards,

James Scholes

On 01/05/2021 at 2:20 pm, Florian Beijers wrote:
Hi,

I am a web developer first and foremost, and don't have a huge amount
of experience interacting with UIA and friends directly, so this is
really me looking for an analog to the concept I know.
Is there a pattern for the web concept of aria-live, where a
particular element on screen immediately echoes new text, but only the
new text, to NVDA as it comes in?
Think new messages in a chat window, new output for a terminal
program, that kind of thing.
If so, is there an example in some NVDA addon, guide, post or email
thread where I can see how this is done?

Thanks,
Florian




Join nvda-addons@nvda-addons.groups.io to automatically receive all group messages.