Liberty BASIC Community Forum
« Programming in LB for blind users. »

Welcome Guest. Please Login or Register.
Jun 25th, 2017, 05:27am


Rules|Home|Help|Search|Recent Posts|Notification


« Previous Topic | Next Topic »
Pages: 1  Notify Send Topic Print
 thread  Author  Topic: Programming in LB for blind users.  (Read 187 times)
raymcal
Junior Member
ImageImage


member is offline

Avatar




PM

Gender: Male
Posts: 53
xx Programming in LB for blind users.
« Thread started on: Feb 10th, 2016, 8:51pm »

BASIC for Blind Users
By Ray McAllister

More and more blind or visually impaired people are using computers and entering the work force. Programs that are not accessible to the blind will not benefit this part of the population. In many situations in the United States, the law requires that work places accommodate the special needs of the disabled. This includes computer software. It is, therefore, necessary for software to be written in a way that the blind can use it. As a blind person, myself, and one experienced with using BASIC, I am offering this article to show programmers some simple and doable ways to make their software accessible to the blind.

I can say with confidence that these techniques do work. I've tested programs employing them on WindowEyes, my screen reader, and I've had other blind people test them with other screen readers, including JAWS, one of the most commonly-used screen readers. In all cases, the BASIC programs are very accessible.

In this article, Just BASIC is referred to as JB, Liberty BASIC, LB< and Run BASIC, RB. In addition, since screen readers already do well reading web browsers, the web-based platform, Run BASIC, receives less attention here. What is discussed concerning JB and LB can easily be applied to RB.

Finally, before getting going, it must be noted that the term "blind" refers to many different types of conditions. I am totally blind, which means I have no light perception. Actually, I have no eyes. They are both prosthetic. My computer needs, then, are different from someone who has limited vision. Nonetheless, writing software that is accessible for the totally blind will cover all types of blindness.


How Screen Readers Work

A blind person may use text-to-speech technology to have the computer read the screen. One may also use a refreshable Braille display, which turns the text on the screen into raised dots of magnetic pins or the sort. However the information is handled, the principles are the same. Screen readers read text, not graphics or designs.

Another aspect of screen readers has to do with the mouse. Since the mouse moves around here and there with little orientation outside of the screen, screen readers replace mouse controls with keyboard commands. One uses complex sets of hot keys to move the mouse pointer around. Often, the mouse pointer, then, can be used to locate things on the screen to read.

This information can lead one to some very logical conclusions. First, complex graphics and animations are not recognizable to those totally blind. Obviously, video games, then, would be impossible to make accessible at this time in earth’s history unless a blind character was designed who would have special sonar powers. Nonetheless, my focus here is on making programs accessible that a blind person might actually use, like one for data entry at a job.

Next, consider how keying around the screen with the mouse pointer to look for useful text can take time. As a result, blind people really like keyboard shortcuts and hot keys. A program can still have mouse-driven functions for sighted users. There should also be keyboard short-cuts one can learn to quickly get things done.


Programming with the Blind in Mind

It is now time to consider how to write programs that the blind can use easily. The main principle to keep in mind is simplicity. If you can write a program that mainly just uses the main window, that’s perfect. That window is easily searchable by using just the arrow keys or ctrl-f for string searches. Data can be entered with the “input” or “input$” commands, and screen readers handle that excellently. It is also easy to use the input$(1) system so one simply presses certain keys for things to happen. If a program is only going to be used by the blind, this may be enough for good programming. Otherwise text windows and text editor windows are about as accessible, if not, more, depending on what you are doing.

It can also be helpful to have sound effects now and then to tell a blind person what is happening. I wrote a program designed to help the blind search the Greek and Hebrew Biblical texts easily, using JB. I recorded a Wave file of my turning pages in a book which would be heard when the program is searching the Bible files for hits. When all the hits are found and displayed, a trumpet fanfare plays. The sound effects made it so I wouldn’t have to sit in front of the computer browsing the screen while waiting until a search was done. I could just sit back and relax, following the sounds. With LB's ability to handle DLL calls, MIDI beeps and sounds could be included in a program and be more space efficient than Wave files in certain situations. A program could be written so that sound effects could be turned on or off if desired.

In addition, there is a speech dll for LB that will convert any string to speech. You can find it at http://basic.wikispaces.com/SpeechLibrary and it works well. You can add a speech option to programs you write.

The controls for windows like comboboxes, listboxes, textboxes, radiobuttons, etc., are easily recognizable by screen readers. As the arrow keys move the cursor through a list, the screen reader reads the items. Even text entered into a graphics window via the “\” command is recognized well, but the blind person must key the mouse pointer to the message. Text that is converted to bitmap files or sprites is not recognizable by screen readers and should only be used for programs not intended for use by the blind.

Where accessibility becomes a problem is when the focus must be set on a graphics window for mouse and/or Inkey$ work. The Inkey$ option is nice for the blind because it does allow one to control the computer through key strokes. If, however, there is a combobox on the screen that a blind person needs to access, the focus often returns right back to the graphics area before the key-driven mouse pointer can do very much. It begins to feel as if the computer has Attention deficit Disorder. This is where a little creative coding must be done, but it is not difficult. I even retrofitted LB’s Piano 6 to get around this problem, and I’m not even the one who originally wrote the program.

The program must be written so the focus can be changed to either the combobox or the graphics window. In the place in the program where all the Inkey$ work happens, a hot key must be provided to transfer focus out of the graphics window. An easy way to do this is with a variable you might call, fc, for focus. When fc = 0, the focus is on the graphics window. When fc = 1, the focus is on the combobox. First, then, it must be established at the very beginning of the program, before any windows open, that fc =0. Then, a command for Inkey$ might read:

If Inkey$ = “ “ then fc = 1

This sets the space bar as the hot key to remove the focus from the graphicbox. Any place where the focus is to be set on the graphics window, then, is coded this way, adjusting only for whatever might be happening in the graphics window:

If fc = 0 then
#window.graphicbox “setfocus”
#window.graphicbox "when leftButtonDown [branchLabelA]"
#window.graphicbox "when leftButtonUp [branchLabelB]"
#window.graphicbox "when leftButtonMove [branchLabelC]"
#window.graphicbox "when characterInput [branchLabelD]"
Else
#window.combobox “setfocus”
End if

Of course, if no mouse activity is needed, the button moving commands wouldn't be there. When fc = 0, then the focus is on the graphicbox. When fc = 1, the focus is on the combobox. Since the only options for fc are 0 and 1, this coding structure is fine.

Finally, there must be a way to return the focus to the graphicbox. To do this, one can place a button near the combobox with a message on it like “select” or “choose.” A blind person can use tab or shift-tab to move over to that button. Clicking that button would take the program to a branch label that, among anything else that must be done, sets fc to equal 0.

You can actually test this keyboard access, yourself, with your own keyboard. I tried my modified Piano6 without my screen reader running, and, while I didn’t have a clue which instrument I was choosing, I was able to freely move about the list and choose whatever item.

I must also mention a most obvious way to make things accessible. The "run" command lets one run other programs in the computer. One could have some information saved as a text document and then have BASIC open that file in NotePad, which is highly accessible. It's a good last resort option.

Conclusion

The information here is not intended to solve every possible accessibility problem. The solutions offered may not work in every case. You may think of other ideas that work better. What I want most is for the principles behind these ideas to be in your mind as you write programs. The blind can greatly benefit from well-written software. JB, LB, and RB can be used to write such well-written software. It is my challenge, then, that if a program you write might possibly be used by a blind person, the program should be written to be accessible for such a person.

If you wish more direct assistance in making your software accessible to the blind, you may contact me to work out an arrangement. I'll make it affordable and practical. (raymcal@att.net

Code follows in next post, for length's sake.
User IP Logged

Alyce Watson
Administrator
ImageImageImageImageImage


member is offline

Avatar




Homepage PM

Gender: Female
Posts: 14913
xx Re: Programming in LB for blind users.
« Reply #1 on: Feb 11th, 2016, 07:58am »

Ray, this is a great article. I've placed a draft on our programmer's encyclopedia. If you give me permission, I'll add it to the list of articles. If you do not grant permission, I'll delete it.

BASIC for Blind Users
User IP Logged

Alyce
Liberty BASIC Workshop - a complete IDE for Liberty BASIC


Alyce's Restaurant
for Liberty BASIC code, tools and references
raymcal
Junior Member
ImageImage


member is offline

Avatar




PM

Gender: Male
Posts: 53
xx Re: Programming in LB for blind users.
« Reply #2 on: Feb 11th, 2016, 12:01pm »

I grant permission. However, that's only one aspect. I also have "Basic for blind Programmers" which shows blind people how to code with LB. It's tricky posting these because they are rather long and have to be broken up. Might I be able to send that one directly to you? I might try to post it here. But, you may post any of my things. That's fine.
User IP Logged

Alyce Watson
Administrator
ImageImageImageImageImage


member is offline

Avatar




Homepage PM

Gender: Female
Posts: 14913
xx Re: Programming in LB for blind users.
« Reply #3 on: Feb 11th, 2016, 1:01pm »

Received with many thanks! I will get this onto LBPE in the next few days. This is a new area for us and it is fascinating. Thank you.
User IP Logged

Alyce
Liberty BASIC Workshop - a complete IDE for Liberty BASIC


Alyce's Restaurant
for Liberty BASIC code, tools and references
Alyce Watson
Administrator
ImageImageImageImageImage


member is offline

Avatar




Homepage PM

Gender: Female
Posts: 14913
xx Re: Programming in LB for blind users.
« Reply #4 on: Feb 12th, 2016, 1:32pm »

Ray has written two articles. One discusses programming for the blind. The other discusses how the blind can use Liberty BASIC to write programs. There is much sample code included.

Whether you are visually impaired or not, you'll get some good information from these. Thank you very much, Ray for these ground-breaking articles.

Articles for the Blind
User IP Logged

Alyce
Liberty BASIC Workshop - a complete IDE for Liberty BASIC


Alyce's Restaurant
for Liberty BASIC code, tools and references
Pages: 1  Notify Send Topic Print
« Previous Topic | Next Topic »

Rules|Home|Help|Search|Recent Posts|Notification

Donate $6.99 for 50,000 Ad-Free Pageviews!

| |

This forum powered for FREE by Conforums ©
Sign up for your own Free Message Board today!
Terms of Service | Privacy Policy | Conforums Support | Parental Controls