Re: Names of mouse events?

derek riemer

Can you give us more details on how the selection model and a11y tree appear in the app you're modding? A few things that'll be useful: The mouse handling code, which tracks the mouse. The event tracking and pumping logic.
This is a bit gnarly, so basically, each event, besides the NVDAObject level, receives a next function, conventionally called nextHandler, that dispatches the event to the next part of the system. This way, anything in NVDA can ask to be notified about an event by declaring a method called event_<eventname> taking a self, obj, and nextHandler argument. It can drop the event chain on the floor stopping execution, by ignoring the nextHandler argument, or it can continue the chain of event propagation by calling nextHandler with no arguments. This is why there are no lists of possible events, the function to call is derived on the fly from the event name. When trying to fix mouse handling, you'll want to know about something called hit-testing, which is just fancy language that means given an x,y coordinate on screen, what element is at that coordinate. UIA and IAccessible both can do this, and the LocationHelper classes and TextInfo/obj.location properties will probably help you. I don't know how to help you further at this time, because it depends on how you have things set up.

On Wed, Oct 16, 2019 at 10:56 PM Karl-Otto Rosenqvist <Karl-otto@...> wrote:
There’s a grid I’m trying to make accessible and if you click on it so it gains focus it speaks its selection. Because I’ve implemented gestures for the arrow keys I make it speak its selection when the user moves around in the grid with the keyboard. I’d like to make it speak if you use the mouse to change the selection so if I could trap the mouse down event I could call my method ReadGridSelection.

An alternative I could assign the SelectionInvalidated  UIA event instead. That way I could skip the keyboard gestures and let the UIA event trigger the speech. The problem is that I know how to do this in C# but not how it’s done in an app module in Python and there’s no documentation that I’ve found.

Kind regards

0701-75 98 56

Även om det är ett äpple på baksidan så får du inte tugga på min mobil!

> 16 okt. 2019 kl. 23:12 skrev James Scholes <james@...>:
> What exactly are you trying to do?  It doesn't seem like it should be NVDA's responsibility to handle mouse input within a separate application, create click targets, etc.  The fact that the gain focus event works, and that you can technically create handlers for space and enter to click on stuff from a keyboard perspective, are just side effects of NVDA's inner workings.
> Regards,
> James Scholes
>> On 16/10/2019 at 9:18 pm, Karl-Otto Rosenqvist wrote:
>> Hi!
>> I'd like to act upon mouse down/click on a control that I have an overlay class for in order to get NVDA to read its contents. I've implemented the event_gainFocus and that works the when the control gets focused regardless of if it's due to a mouse click or tabbing into it. I'd like to make it speak when it already has focus and the user clicks in a different spot on the control.
>> I haven't found any add-ons or examples on the web that I could learn from, unfortunately, and as far as I know there's no list of events somewhere?
>> Kind regards
>> Karl-Otto

Derek Riemer
Improving the world one byte at a time!        ⠠⠊⠍⠏⠗⠕⠧⠬ ⠮ ⠸⠺ ⠐⠕ ⠃⠽⠞⠑ ⠁⠞ ⠁ ⠐⠞⠖
•    Accessibility enthusiast.
•    Proud user of the NVDA screen reader.
•    Open source enthusiast.
•    Skier.

•    Personal website:

Join to automatically receive all group messages.