September 28, 2008

Hold Your Breath with Windows Speech Recognition Inline Dictation Commands

Eric Brown of the Microsoft Speech Development Team recently wrote a simple but highly enlightening article about an oft-misunderstood feature of WSR dictation: Inline Dictation Commands. In the article, he explains how nine special commands “can be uttered in the middle of a dictation stream,” unlike most other commands which require the speaker to pause before and after saying them. (Yeah… I realize that the title of my post utilizes an awful play on words, but at least now you hopefully get the point! :-))

The nine special commands presented in his article are as follows: tab, new line, new paragraph, caps, no caps, all caps, no space, literal, and numeral. Regardless of whether or not you are a newbie or power user of Windows Speech Recognition, knowing how to use these commands in your dictation repertoire will surely help you out, so you would be well advised to read Eric's article.

April 3, 2008

Using the XPS Document Writer as an Alternative to Printing Hard Copies

The other day, a colleague submitted a programming request to me to try to improve the way some of the pages on our company web site print out. Knowing that I had trouble handling traditional paper documents because of my disability, she was polite enough to ask if we could just set up a quick meeting so she could show me the printed examples and flip through the pages for me. Although I appreciated the friendly gesture of help, I like it when I can suggest simpler, more accessible solutions that really end up saving time for everyone involved. So I asked if she could simply just print an XPS document instead of messing with a hard copy at all. And as somewhat expected, I promptly received a confused "What's an XPS document?" in return.

So then, what is an XPS document? Well, if you are really technically savvy and want to know the details, then I'd suggest looking elsewhere, perhaps starting by reading all about the XML Paper Specification at Microsoft. But if you really just want to know how you might actually end up using it without all the extra fuss, then keep reading.

In my mind, the main value XPS currently provides end users is its built-in virtual printer driver. Essentially, this virtual driver allows you to print any document to an XPS file (a file with a .xps extension) instead of spooling directly to a printer. This means that your printout doesn't have to go to paper immediately, if ever. It is simply saved as a file that you can open in an XPS viewer. In the viewer, you can do what you want with it. You can view the virtual printout, or, if you really need to, you can print a hard copy version from this viewer at that point. So it gives you more flexibility. That's what I like!

How do you actually use this virtual XPS printer driver then, you say? To do that, you'll first need to make sure you have XPS installed. Generally, this means you must have XP SP2 or later, and I believe the .NET Framework 3.0 is also a requirement. Obviously, most people have probably downloaded this already via Windows Update, or, if you have Vista, it was already a standard feature. If you're pretty sure you have that covered, then all you need to do to try it is to go to something you'd like to print and try it out.

For example, most of the stuff I print comes from the web, so that means I'm printing from a web browser. In Internet Explorer 7, just click the little down arrow next to the printer icon and then click on "Print..." so you can see the printer options. You don't want to go directly to the default printer because that's probably your standard hardware paper-and-ink printer that you already know and love. Instead, you'll want to select the printer labeled "Microsoft XPS Document Writer" and then click the "Print" button. At that point, you should be presented with a standard "Save As" dialog box where you can name your new XPS file (whatever-you-want.xps) and put it in whatever folder you wish. After clicking "Save" from there, in a few moments you should have a brand new XPS document saved wherever you chose to put it. And then, if you want to open it and see what it looks like, just double-click it, and it should automatically open up in the default XPS viewer. It's all pretty simple, really.

So now you have a way to save a document in a paginated, fixed format that looks just like traditional paper printouts. Think of it as electronic paper, which is obviously much simpler to exchange with others via email, file sharing, etc. than the hard copy alternative. It's certainly a lot handier for a guy like me with a physical disability, but it can be a money-saver, too, since you don't have to necessarily waste that gold-laced ink that costs an arm and a leg. In a way, you can actually use XPS as your own makeshift personal document imaging system. Give it a try if you haven't already!

December 27, 2007

Talking to the Web

A fellow web development aficionado recently asked me a question I commonly receive concerning web accessibility, so I thought I'd share my thoughts here in hope that others might benefit from my ideas (and hopefully expand upon them). Here's the question:

Is there anything in particular in terms of accessibility or even just coding in general that you find to be the most helpful when using the web?

This is obviously a very broad question and to limit its response to a single blog post probably does not do it justice. However, it is indeed a very simple, honest concern that deserves a simple, honest reply, so I'll try my best to offer my advice here. Of course, you should keep in mind that my suggestions are focused on my own experience in accessibility. My vision and hearing are actually quite good, so I'm not as familiar in accessibility concerning those areas. But I can tell you a lot about how speech recognition works as far as web pages are concerned.

I suppose the main suggestion I tend to stress to other web developers about accessibility is to always focus on carefully and completely designing links. Links are, after all, what the web is all about. Always use the a (anchor) element for links, as anchor elements tend to be better supported by things like speech recognition, screen readers, etc. It can be tempting to sometimes utilize other HTML elements with events like onclick to simulate what an anchor element might do, but this route is a surefire way of leading to accessibility problems.

With that thought in mind, it's also a good idea to make sure that all the links on any given web page can be accessed easily by a straightforward command, which is usually the text of each link. Good speech recognition software actually extracts the text from the visible screen so that when you say something, it will try to find the associated anchor element that matches what you say, and it will go there, which makes this an easier task for us web developers than some of us might think. However, there are caveats you need to keep in mind. If there are several links that sound alike, you are given options, generally a numerical list to choose from, instead of going directly to a certain link by voice, which can be a nuisance if there are a number of links that sound alike. This might give you some ideas on what makes a good name for a link, and what might not. So try to be unique when naming each link and, in general, avoid redundancy as much as you can.

Also, for what it's worth, when dealing with graphical links (and certain abbreviated textual links), it has been my experience with Windows Speech Recognition that implementing the title attribute of the anchor element is the most important component for the speech recognizer (at least for WSR). For images, the title attribute does not necessarily have to be identical to the alt attribute of the embedded img (image) element, but it usually makes sense for both to be the same so that the tooltips match whatever the spoken command would be. I'm not sure if this conforms exactly to a specific web accessibility initiative or not, but this process has generally been what I've used in practice. Also, it is best to try to use this title attribute as a simple, non-redundant command that makes sense in the context of what the link does, not necessarily describing exactly what the image is. Just be sure to remember that the link is always more important than the image. Substance before style.

September 29, 2007

Using the On-Screen Keyboard as an Alternative to Typing with a Physical Keyboard

As an individual with a physical disability who touts speech recognition so much, I occasionally get asked how I ever use the computer without having speech recognition available (since I cannot move my arms well enough to operate a standard physical keyboard)? This is a good question, since speech recognition is not one of the most portable tools around. For example, I've never come across a public computer at a library or hotel that was set up with a good microphone and sound card combo, which are necessities for using speech recognition. So, when the necessary hardware is unavailable, that means I have to look for software to simulate it--in this case, the On-Screen Keyboard.

The On-Screen Keyboard is nothing new to Windows; it's been one of the standard accessibility tools for several versions now, not just Vista. It's pretty simple, really, but is extremely useful for users like me who cannot utilize a traditional physical keyboard. Basically, the On-Screen Keyboard application displays a window that looks exactly like a standard keyboard, only it is on the screen. You can select the different keys simply by pointing and clicking with a mouse or other pointing device. So, in truth, there is still a need for hardware since something has to do the pointing, but, generally, using a mouse or other similar device is a lot less strenuous than using a physical keyboard. Believe me, I know. Currently, I can still move my fingers adequately on one hand, so I can still handle a mouse, but a traditional keyboard is just not an option for me.

Interestingly, the On-Screen Keyboard and other similar applications have become a little more mainstream now than they have ever been thanks to the rise of tablet computing. Touchscreen devices like these typically allow writing with your finger or a stylus, but occasionally it may be necessary to find a way to input keys like we would on a normal keyboard. So this means a software keyboard can actually be a necessity for everyone, not just those with disabilities.

How do you actually start the On-Screen Keyboard in Windows? Since it's generally not a tool most will need, Microsoft tends to bury it down several levels in the start menu. (They've done this in every version of Windows I can remember.) In Vista, you can launch the program by mouse as follows:

Click Start > All Programs > Accessories > Ease of Access > On-Screen Keyboard

There you go! You found it! Using the program is pretty straightforward and really doesn't need any explanation. It's simple and does its job, which is all one should expect from a tool like this.

July 6, 2007

Using IE Procedural Surfaces to Generate Icons

Graphics are important to programmers. As much as we'd like to stick to foo and bar as much as possible, there always comes a time when we need to put a little thought into how an interface should look. That often involves graphics.

In most of the applications I've created, the main type of images I've used have been icons. They're small, easy to work with, and help to enhance the visual interface of almost any application. Unfortunately, my computer graphics skills are quite limited, so, when the time comes to needing an icon, I'm usually stuck trying to find a nice affordable (read: free) one on the web.

Lucky for me, not long ago, I happened to discover an excellent site called IconBuffet which provides a number of high-quality icons at no charge to its members. IB is more than just your average icon download site, though. The images are professionally done, and there is an interesting community of users to communicate with when swapping icon sets. Note that you can't get all their icons at once, though. You have to play by IB's rules so-to-speak, where you have a limited number of tokens to buy certain icons, and you can build up points by sharing your set with others. I know; it's definitely a scheme designed to keep users around and active on the site. But in this case, I think it works well, and it's relatively easy to get a hold of the images you want fairly quickly after learning how the site works. It's fun, trust me. And if you sign up with me as the referral, I'll get some nice bonus points. Thanks. Ah, another pyramid scheme...but at least it's free!

Back to the point. Sorry about the spiel, but it does bring me to the topic at hand. What happens if you still cannot find the simple icon you're looking for and you're not a computer graphics whiz? Well, you can make your own using some pretty simple tools that almost everyone owns: Notepad, Internet Explorer, and Paint.

Basically, you can make a really nice text-based icon by utilizing some cool DirectX visual extensions in IE with just a little bit of code:

<!-- saved from url=(0014)about:internet -->
<style type="text/css">
width : 48px;
height : 48px;
font-size : 24px;
text-align : center;
line-height : 48px;
background-color : #00f;
color : #fff;
font-family : sans-serif;
font-weight : bold;
filter : progid:DXImageTransform.Microsoft.Gradient(
<div id="myicon">US</div>


You'll see that the code is pretty straightforward. Just a div element with some styles applied. Pretty standard HTML/CSS. The one thing that might seem strange to you is the IE visual filter style attribute. This is what applies the funky gradient background.

And now that you've got your image displayed in the IE browser, all you have to do is hit <print-screen> on the keyboard to copy the image to the clipboard and then paste the image into Paint. From there, you probably need to crop off the rest of the window surrounding the icon that also got copied to the clipboard, but that's pretty simple if you've ever used Paint before. Once you finally have your icon cropped to the 48 pixel size you specified, all you have to do is save the image in the file format you would like, and you're done. Voila, you're an artist!