Re: How to use eventHandler.requestEvents


 

Hi,

Where did you see “focusChanged” event defined in NVDA? I can’t see that event defined in my copy of NVDA screen reader source code at the moment.

To answer the original question at hand: without going into details (something reserved for NVDA Add-ons list), eventHandler.requestEvents function is designed to let app modules respond to app events in the background. This is useful if you need to let NvDA monitor changes to an app control from everywhere. For example, an app might raise name change event in an app, and you may wish to let NVDA announce changes to this control from everywhere. A practical example in use is StationPlaylist add-on where NVDA is told to monitor for changes in status bar texts from everywhere.

Cheers,

Joseph

From: nvda@nvda.groups.io <nvda@nvda.groups.io> On Behalf Of falkogiepmans@...
Sent: Wednesday, April 14, 2021 5:17 AM
To: nvda@nvda.groups.io
Subject: [nvda] How to use eventHandler.requestEvents

 

Hi all,

Currently I am working on a appModule for SAP, this has its own API and internal events. I would like NVDA to be able to listen to some of those events. One of these events is "FocusChanged", since NVDA does not notice this in SAP. My idea was to use requestEvents as follows:

Example Code
class AppModule(appModuleHandler.AppModule):
    def __init__(self, *args, **kwargs):
        super().__init__(*args, **kwargs)
        eventHandler.requestEvents("FocusChanged", processId=self.processID,windowClassName='someWindow')
End Example Code

And use this event in some overlayclass:

Example Code
class SAPClass(IAccessible):
    def event_FocusChanged(self):
        ...do something...
End Example Code

This does not seem to work. Is this what eventHandler.requestEvents is meant for or am I understanding it wrong? I am quite new to events in general but I want to get my head around it.
Side question: Is this the place to post these kind of questions?

Thanks in advance,
Falko

 

 

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