Wednesday, April 2, 2008

Using Jaws with Linux through terminal emulation

I'm posting this mainly because I see this question come up a lot on the linux lists. I feel particularly sorry for the blind student who is trying to take
some sort of Unix course, and not only has to figure out this new OS but needs to figure out how to access it while simultaneously using the college's
Windows computers. Usually the access technology specialists don't have a clue, or the information on the net is outdated and/or inaccurate.  
First, grab yourself a copy of the latest UTF-8 TeraTerm Pro 4.57.  
other urls contain dated versions.  
Install the program and say No to all the extra little tray applets.  They don't do any harm but who wants resource hogs that aren't needed. If you get
one by mistake, standard techniques, like using msconfig can make it go bye-bye.  
Next, if you have JAWS, a version later than 5, create this script:  
<br>Include "HJConst.jsh" 
<br>Void Function SayNonHighlightedText (handle hwnd, string buffer) 
<br>string TheClass 
<br>let TheClass=GetWindowClass(hWnd) 
<br>If GetScreenEcho () > ECHO_NONE && TheClass == "VTWin32" Then 
You will find several, far more elaborate scripts out there. You don't need them. Many were for older versions of Tera Term, and older versions of JAWS.
One old script disables my semicolon key, and another of these outdated scripts makes my Braille display constantly jump around. A very similar script
was originally on  the blog of Saqib Shaikh, which seems to be no longer on the net. I'd like to give him credit for the idea, and I only plagarize because
I can't find his blog to tell you about it. 
Anyway, this code is simply what gets executed in a Win32 console window (what used to be called a DOS box)  when the user chooses to have highlighted text
spoken but actually wants to have new text read as it comes onscreen. It's part of the JAWS default script. 
The situation for a terminal user is similar to a DOS box user; they don't actually want highlighted text, they want all new text, but not to hear old text
read more than once. In other words, when the text scrolls, causing new text to be written and old text to be rewritten as part of the scroll operation,
the JAWS user wants to only hear anything new, and not a repeat of the old text. 
For DOS screen access, this was easy. These programs simply read video memory when users were not working with scrolling applications. When they were, the
DOS screen reader filtered calls to the PC BIOS. The BIOS handled the scrolling so the user never heard old text repeated. In DOS, the screen reader watched
the text that was sent to the BIOS screen services, so it knew about everything sent to the screen through the BIOS. Video memory only had to be consulted
if a program wrote directly to the screen.  
But I digress. With a real tutorial you can't go off on tangents; that's why blogging is so fun! 
Anyway, with Windows, lots of behind-the-scenes magic goes in to building the off-screen model: the screen reader's best guess about what's onscreen now.
I only half understand all that magic. 
I do understand that often it's hard to tell the difference between old text, that's simply scrolling and new text that's just arriving. 
But this script does a great job in console windows and works fine in TeraTerm most of the time. You do have to adjust some TeraTerm settings. You must
disable the scroll buffer, verify that there are only 24 lines of text onscreen, and set the cursor shape to horizontal line.  
The blind access journal has a good tutorial on adjusting your settings at:     
It also suggests you download some scripts that didn't work for me. They were the ones that disabled my semicolon key! I'm pretty sure they used to work
and that something's changed with JAWS that makes them unnecessary.  
Anyway, the above script works fine.  
There will be times you won't want everything read aloud. For example, this happens when using most editors. You can just use Insert-S to set JAWS for no
automatic speech, and go back to saying highlighted text when you want scrolling text to be automatically read again.  
There's one additional issue with TeraTerm. Occasionally something in Ncurses causes TeraTerm to display euro and other garbled symbols, instead of line
drawing characters. It's a problem for sighted users just as much as screen access users. I've reported it on the TeraTerm support forum, and you can read
that forum at: 
Several sighted people have confirmed that indeed, this  is a problem. It happens only when ncurses applications are running on the host, for example, a
program that uses a cursor and highlighting and sometimes reverse video and multiple pseudo-windows to simulate the look of a graphical application. The
Ubuntu/Debian aptitude is a good example. I encounter it most when using dpkg-configure.  
When I do have to work with a ncurses app that's behaving badly with Teraterm, I've used putty (another free terminal emulator and ssh client) that I'll
discuss in another blog entry. 
A nice thing about Teraterm is that all it's settings are storred in a text-based .ini file, which it's easy to go in and change. For example in some situations
where line-drawing characters weren't displaying properly, I partially solved the problem by setting Teraterm to emulate a VT220 by editing the .ini file.
And then I set Linux to believe that a Vt220 was logging in.  
As an ssh client, teraterm can be completely automatic. It does take some know-how and setup. I have a desktop shortcut that automatically logs me in to
my server, and that works everywhere me and my laptop happen to be. To do this, you'll need to create a separate settings file for your host, and have
your host use public-key logins. Once it's all set up though, you needn't type a user name or password; just click on the shortcut and you're all logged
The command line for my shortcut is:     
"C:\Program Files\teraterm\ttermpro.exe" /f=ssh2server.ini  
A couple more tips: if TeraTerm's screen updates are being missed by JAWS, maximize the window, switch focus away from it and then back, and do Insert- 
Escape to refresh the jaws off-screen model.  
Remember that TeraTerm can also use a serial port, so you can cable your PC directly to a system running any Unix. I'll have more to say about that in future
posts, but if you want to learn more Unix, getting an old computer -- doesn't have to be a PC -- and installing some freely-available Unix-like OS through
the serial port can be a whole lot of fun. And though serial ports are disappearing from modern PCS, old computers you can pick up surplus, almost always
have serial ports. I've used Alphas, Vaxen and ancient PC laptops. People use Sun Sparc workstations and many old computers I know next to nothing about.  
Well time to get back to work, and clean up this post later.  

No comments: