2022-01-24 02:54:33

Hi all. Was wondering if there's a simple solution for stopping a screen reader from automatically speaking things like wxPython's static text widgets? Ideally, I'd like to have a little more control over these messages by triggering them from something like Tolk, as well as simplify things by having only one consistent source for speech.

Los Angeles Based musician, blogger, and programmer.
https://artistibarra.com/

2022-01-24 03:18:25

Make sure they aren't focused, and that should do it.

My Blog
Twitter: @ajhicks1992

2022-02-01 15:45:00

Thanks for the suggestion. That had occurred to me, but I had no luck on my initial tests with that approach, which brought me here for help. After playing around with it a little more since my original post, I've figured out that the StaticText class doesn't accept focus by default. And aside from the AcceptsFocus method for windows, including the StaticText class, there doesn't seem to be any other way of modifying whether or not the widget can get focus. The only possible lead I got was explicitly setting focus to a different object, but everything is still read out loud until the focus is set. For example, if I have multiple StaticText objects and I set focus to a particular one, all the texts will be read, and then the one that was focused is read a second time.

I'd greatly appreciate any guidance from this point, as this has got me seriously stumped.

Los Angeles Based musician, blogger, and programmer.
https://artistibarra.com/

2022-02-01 16:17:55

I think that the issue is that whatever you've done is being picked up as labels or something, but without specifically playing with your UI I don't know.  If you make a control directly from the base class (I think WxControl but not sure) you can focus that.  I have an example of doing it but it's in a 7kloc codebase and I don't have a link directly to the file at the moment.  I'll see if I can quickly find that later.

My Blog
Twitter: @ajhicks1992

2022-02-07 02:19:34

Yes please, if you happen to have the time, I would greatly appreciate it! After doing some more digging, I'm wondering if it might be worth approaching this from the screen reader side? Ideally, I would rather this come from the app itself to make it as screen reader neutral as possible, but I don't think taking the add-on route would be too complex either. What I'm unsure of though is what event specifically is causing the StaticText widgets from being read, and I'm unsure how to even troubleshoot that as my familiarity with both JAWS and NVDA scripting is minimal.

Los Angeles Based musician, blogger, and programmer.
https://artistibarra.com/

2022-02-07 03:26:50

You probably can't fix it in Jaws if it's happening there.  Jaws doesn't allow you to deeply hook in like NVDA does and is half undocumented.  I don't use static texts and indeed I haven't heard of this behavior being a problem.  If you can use normal textboxes instead that may be a workaround.  I'm pretty sure that the event you want to hook is very generic and that hooking it will cause problems, but I haven't done screen reader scripting stuff in a very long time and don't even remember what it's called.

I can't find my code for this.  I think it was an experiment to see if I could that never got committed.  As I recall you create a WxWindow control and can focus that, but I'm not sure why your static text updates are even being read.  What does the player's focus actually sit on?  If it's an edit field then the issue is likely that the screen readers think your static texts are labels for that field, because they attempt to work that out.

There is a way to check whether a screen reader is running, I think.  But I can't find it right now.

My Blog
Twitter: @ajhicks1992