2014-09-25 14:18:31

I'm currently developing an editor for code development that's designed to offer many of the features common in other development environments. The difference being where those features are mostly inaccessible in the IDE's that I have worked with, this one has been designed from the ground up for accessibility.

I decided to write this in Python for a number of reasons, including its cross platform capabilities and that much of what I needed was readily available and is straight forward to implement.

However, I've run into a couple of difficulties on the accessibility front, and I was hoping someone here might be able to shed some light on them.

My editor implements a styled Text Control for the actual editor itself, as this allows me to have things like line numbering, and later on, sintax detection and highlighting. However, when I read it with JAWS, none of the tab characters are spoken like they are if I type them in a program like windows Notepad, or eclipse. I've noticed this same issue in editors such as Notepad++, but I am so far unable to determine what the difference is that makes JAWS read the tab characters in one but not the other.

Second, and most ironically I think, NVDA seems unable to read the text control widget at all. I say this is ironic since of course NVDA is written in Python. Furthermore, I'm at something of a loss to understand why JAWS reads the contents just fine, well, other than the tab characters, but NVDA doesn't report anything what so ever.

If anyone has some information to help me figure these things out, I would greatly appreciate it!

Thanks.

Shadow

2014-09-27 19:41:06

I do.
Firstly, the code styling controls never, ever work.  You can make them work, but doing so is the kind of thing where, if you're asking the question, you aren't ready for the answer in the sense that you're not going to like it.  Doing it involves things that are decidedly not Python: to be specific, implementing IA2 in C++ as part of the GUI library you're using.  If you can override the callback in Python, you can possibly do it there with comtypes-I don't see why not, but haven't tried it.  The general procedure is to respond to WM_GETOBJECT and return a COM object that knows how to query your control; this is ridiculously harder than it sounds.  Do it for a text control and the only thing that's going to be a challenge to you in your new job as chief accessibility programmer somewhere is doing it for web views.
If you're sighted, there may be more to say about interface: adding line numbers to the control won't help most of us, doing so will break indentation (i.e. can't use both at once), and your best bet is the simplest possible text control you can find, i.e. the one built into windows.
At the moment, WXWidgets is your option for accessible GUI development in Python; I'd also watch Toga, as a few of us blind programmers are involved in making it accessible, it's purely in Python with no C++ component, etc.
Now, the thing is.  Eclipse is already pretty good, and the Next branch of NVDA fixes one of the major bugs there.  I think that you'd have more luck tracking down and fixing Eclipse bugs: it'd help more people, provides a ton of functionality for a ton of programming languages out of the box, and already works halfway decently. I'm not sure on your motivation, but if the goal is "have an editor for myself" I'd either do that or just give up and use Edsharp and the command line, because going far beyond Edsharp is going to involve IA2 or UIA and COM.  And you'll need command line skills anyway, at some point.
The difference between Jaws and NVDA is that Jaws has the mirror display driver.  Anything that can call windows APIs can be used to write a screen reader: being written in the same language as the target application provides no advantages.  What makes jaws sometimes able to do stuff NVDA can't is that it's literally intercepting the video card: while this sounds amazing at first glance, it's also part of why Jaws is so buggy and crashy and is a technology that Microsoft is slowly killing because it's basically a giant security hole.  They almost did in Windows 8, but the AT people--by which I mean Freedom Scientific--apparently begged.  The first part is not rumor, but the second part is (run the early Win 8 builds and see how everything but NVDA fails hard).
If you want me to go into how you make a text control accessible, I can provide links.  I have yet to do this myself, as I've found that IDEs are generally not worth it.  But I know how to do it if I had to.  This is something I've thought about doing, but--as I said--Eclipse is already almost there and you're never, ever going to rival it in terms of being able to do stuff or support even a fraction of the languages you can get in it.
Also, forget cross-platform accessibility for this, not unless you're on a programming team, being paid, or have 40-hour work weeks for this through some other means.  Every platform implements accessibility completely differently and, for any GUI library, there's going to be controls that work fine on Windows and fail on Mac or vice versa.  I've watched a friend struggle with this, and he ended up writing his own GUI library on top of WX that literally picks different lisstboxes depending on if you're on Mac or not, among other things.

My Blog
Twitter: @ajhicks1992