-->
Home » » Orca is a free, open source scriptable screen reader.

Orca is a free, open source scriptable screen reader.

Orca is a free, open source scriptable screen reader. Using various combinations of speech, braille, and magnification, Orca helps provide access to applications and toolkits that support the AT-SPI (e.g., the GNOME desktop). The development of Orca has been led by the Accessibility Program Office of Sun Microsystems, Inc. with contributions from many community members.

Please join and participate on the Orca mailing list: it's a helpful, kind, and productive environment composed of users and developers. The mailing list archives also contain a great history of discussions. We try to capture the information on this WIKI, but we encourage you to search the archives for more information.

Operating system distributors -- please read the Smoke Test for information on verifying Orca works well with your distribution. Download/Installation

As of GNOME 2.16, Orca is a part of the GNOME platform. As a result, Orca is already provided by default on a number of operating system distributions, including Open Solaris, Fedora, and Ubuntu.

Please also refer to the Download/Installation page for detailed information on various distributions as well as installing Orca directly from source.

Configuration/Use

The command to run orca is orca. You can enter this command by pressing Alt+F2 when logged in, waiting for a second or so, then typing orca and pressing return. Orca is designed to present information as you navigate the desktop using the built-in navigation mechanisms of GNOME. These navigation mechanisms are consistent across most desktop applications.

You may sometimes wish to control Orca itself, such as bringing up the Orca Configuration GUI (accessed by pressing Insert+Space when Orca is running) and for using flat review mode to examine a window. Refer to Orca Keyboard Commands (Laptop Layout) for more information on Orca-specific keyboard commands. The Orca Configuration GUI also includes a "Key Bindings" tab that allows you to get a complete list of Orca key bindings.

The command to run orca is orca. You can enter this command by pressing Alt+F2 when logged in, waiting for a second or so, then typing orca and pressing return. Orca is designed to present information as you navigate the desktop using the built-in navigation mechanisms of GNOME. These navigation mechanisms are consistent across most desktop applications.

You may sometimes wish to control Orca itself, such as bringing up the Orca Configuration GUI (accessed by pressing Insert+Space when Orca is running) and for using flat review mode to examine a window. Refer to Orca Keyboard Commands (Laptop Layout) for more information on Orca-specific keyboard commands. The Orca Configuration GUI also includes a "Key Bindings" tab that allows you to get a complete list of Orca key bindings.

Running Orca

The command to run orca is orca. You typically run orca with no command line arguments, but you can get a description of the command line arguments by passing --help as a command line argument:

orca --help
GTK Accessibility Module initialized
Usage: orca [OPTION...]

-?, --help Show this help message
-v, --version 2.23.2
-s, --setup, --gui-setup Set up user preferences
-t, --text-setup Set up user preferences (text version)
-n, --no-setup Skip set up of user preferences
-u, --user-prefs-dir=dirname Use alternate directory for user preferences
-e, --enable=[speech|braille|braille-monitor|magnifier|main-window] Force use of option
-d, --disable=[speech|braille|braille-monitor|magnifier|main-window] Prevent use of option
-q, --quit Quits Orca (if shell script used)

If Orca has not been previously set up by the user, Orca
will automatically launch the preferences set up unless
the -n or --no-setup option is used.

WARNING: suspending Orca, e.g. by pressing Control-Z, from
an AT-SPI enabled shell (such as gnome-terminal), can also
suspend the desktop until Orca is killed.

Report bugs to orca-list@gnome.org.

Running Orca from the GNOME Desktop

Once your GNOME desktop session is running (e.g., you logged in), you can launch Orca by pressing Alt+F2 then type orca and enter.

Once you can read your GNOME desktop, you can set Orca to be launched automatically by going into the System Menu, the Preferences item, Universal Access, Assistive Technology Preferences. In the dialog box, activate Enable assistive technologies, which will enable the Preferred Applications button, click on it. In the second dialog box, select the Accessibility tab, in which you can check that the Orca or Orca with Magnifier visual is selected, and eventually activate Run at start. You can Close the two dialog boxes. The next time you run a gnome session, Orca should automatically get started.

Another way is to go into the System Menu, the Preferences item, Sessions, and in the Startup Programs tab, activate the Autostart the preferred AT item, or Add a new item, choose any name and use orca as command and OK. You can Close the dialog box. The next time you run a gnome session, Orca should automatically get started.

When Orca is running, you can configure preferences for speech, braille, magnification, and other features using the Orca Configuration GUI (accessed by pressing Insert+Space when using the desktop keyboard layout and Caps_Lock+Space when using the laptop keyboard layout).

Orca is designed to present information as you navigate the desktop using the built-in navigation mechanisms of GNOME. These navigation mechanisms are consistent across most desktop applications. Sometimes, however, you may need to escape to 'flat review' mode to explore the two-dimensional layout of text in a window. You may also wish to learn more about text attributes and access other Orca-specific features. These are all done using the keyboard. Refer to Orca Desktop Keyboard Commands (Laptop Layout) for more information on Orca-specific keyboard commands. The Orca Configuration GUI also includes a "Key Bindings" tab that allows you to get a complete list of Orca key bindings.

When Orca is running, you can also press Insert+h to enter "learn mode." In learn mode, you can press any key on the keyboard or button on the braille display. Orca will intercept the keystroke or button press and tell you what action would have been taken. To exit learn mode, press the Escape key. Quitting Orca

To quit orca, press Insert+q. A confirmation dialog will appear. Select "yes" to quit. If the system seems unresponsive, you can do a couple things:

  • Run orca --quit from a terminal window, such as a virtual console (press Ctrl+Alt+F1 on most Linux platforms to get to a virtual console and then Alt+F7 to get back to the desktop). This will kill orca and clean up after it. You can then rerun orca using the orca command.

  • Press Ctrl+Alt+Backspace to kill your login session and get back to the graphical login prompt. System Administration

See GNOME System Administration Using Orca.

Orca Frequently Asked Questions

Orca Logo

Contents

  1. Orca Frequently Asked Questions
  2. Overall Information
    1. How do I contribute to this WIKI?
    2. What is Orca?
    3. Any idea of the system prerequisites?
    4. Why the name Orca?
    5. What's the schedule?
    6. How do I request a new feature?
    7. Where's the discussion list?
    8. Is braille supported?
    9. Is contracted braille supported?
    10. /etc/brltty.conf is overwritten, what to do?
    11. What voices are available?
    12. What languages are supported?
    13. How well does magnification work?
    14. How's web access coming along?
    15. Where can I find more information about Python?
    16. I would like to help with Orca code, what do I need to know before starting?
    17. Any good OCR packages available?
  3. Installation and Configuration
    1. Where can I find binary packages?
    2. Where do I get the Orca sources?
    3. How do I build Orca from source?
    4. Do I have to be root and/or install into /usr?
    5. How do I set up Orca?
    6. How do I get Orca to launch automatically when I log in?
    7. How do I set up accessible login?
    8. How do I get Orca working with Java applications?
    9. Does Orca work on GNOME 2.12 (Solaris 10, Ubuntu 5.10, Fedora Core 4, etc.)?
  4. Using Orca
    1. How do I run Orca?
    2. What keyboard commands do I use to access the desktop and applications?
    3. What keyboard commands do I use to control Orca?
    4. How do I get Orca to speak alongside other ALSA applications?
    5. What applications does Orca work with?
    6. Does Orca work with Skype?
    7. Does Orca work with KDE?
    8. How do I do system administration tasks?
  5. Customizing Orca
    1. How do I define my own punctuation or character pronunciations?
    2. How do I define my own keybindings?
    3. Customizing Orca To Speak/Braille Battery Status, Date, Time and Weather Information (scripting)
      1. Notes
      2. Creating Scripts
      3. Time and Date
      4. Python Time Codes:
      5. Adding Date to the Mix
      6. Extra Functionality
      7. Adding Weather Information
      8. Tidying Up
    4. How do I set up my own custom script area?
  6. Gaming With Orca
    1. MUD Clients
      1. Gnome-Mud
      2. Tintin++
      3. Kildclient
    2. BSDGames
      1. Adventure
      2. Arithmetic
      3. Battlestar
      4. Go Fish
      5. Monopoly
      6. phantasia
      7. Trek
      8. Wumpus
  7. Troubleshooting
    1. Orca is not speaking. What's going wrong?
    2. My desktop has stopped responding. What do I do?
    3. I did something that required me to enter a password and my system hung. What's up with that?
    4. I am using the ubuntu 7.04 live cd, I get the desktop and Orca starts, but it only says "switching to focus tracking mode" Whats wrong with it?

Overall Information

How do I contribute to this WIKI?

We love you! Thanks for contributing. Create a new account by visiting http://live.gnome.org/action/login/Orca?action=login. Login and you will find an "Edit" link near the top of the page. Follow this link and edit the content. Further instructions for WIKI syntax and editing can be found at the bottom of the page once you start editing it.

What is Orca?

Orca is a flexible, extensible, and powerful assistive technology for people with visual impairments. Using various combinations of speech synthesis, braille, and magnification, Orca helps provide access to applications and toolkits that support the AT-SPI (e.g., the GNOME desktop). Orca is also free open source software.

Any idea of the system prerequisites?

A modern system will typically suffice. If you try to use a machine from the 1990's with very little RAM, well, expect it to work like a machine from the 1990's with very little RAM.

Why the name Orca?

One of the first DOS screen readers was Flipper by Omnichron corporation in Berkeley, CA. It was named Flipper in part because the blind wife of the programmer envisioned computers as being programmed by flipping switches (an accurate image of a bygone era). Then came another DOS screen reader from Henter-Joyce in Florida - "Jobs access With Speech" (or JAWS). Meanwhile in the UK we had the company Dolphin systems making their own DOS screen reader.

While there isn't otherwise an obvious connection between blindness and creatures from the sea, there is certainly a long tradition around it.

Hence the lore is that it is just keeping with the sea animal naming theme of screen readers. Plus, Orca is a lot tougher sounding than Nemo, Ariel, Willy, or Mr. Limpet.

What's the schedule?

Orca is part of the GNOME platform and Orca's releases are coupled with the releases of the GNOME platform. The GNOME platform releases on a 6 month cycle, with stable releases typically around the March and October timeframes. During the 6 month cycle, there are a number of "odd" releases, such as GOME 2.21.1, GNOME 2.21.2, etc. The stable releases that follow are "even" releases, such as GNOME 2.22.0, GNOME 2.22.1, etc.

How do I request a new feature?

Bugs and feature/enhancement requests (RFEs) should be reported to the GNOME Bug Tracking System. Patches are always welcome, and instructions for creating patches can be found in the GNOME introduction to Subversion (svn). You can also read more about Orca bugs and enhancements on the Orca Bugs page.

Where's the discussion list?

You can get in touch with developers and other users by sending an e-mail to the Orca mailing list (Archives).

NOTE: there is a #orca IRC channel on irc.gnome.org. If you drop in the #orca room and nobody answers your questions, you're probably just talking to the software robots in the room, such as A11yLogger. Don't be dismayed. We are not ignoring you. The best way to reach the Orca community is via the Orca mailing list.

Is braille supported?

Yes! Braille is supported via BrlTTY and it is integrated well with Orca. BrlTTY offers support for nearly every refreshable braille display known to man. Please refer to the Braille page for more information.

Is contracted braille supported?

As of GNOME 2.22.0, Orca supports uncontracted braille.

/etc/brltty.conf is overwritten, what to do?

Please see solution, posted on the Braille page.

What voices are available?

Orca provides inerfaces to both gnome-speech and emacspeak speech services. There is also experimental support for Speech Dispatcher. As such, the available voices for Orca are only restricted by the speech engines supported by the available speech services. For free speech engines, you typically have a choice of the eSpeak, Festival, and FreeTTS speech engines. For commercial engines, you have a choice of additional engines such as Fonix DECtalk, Loquendo, Eloquence, Cepstral, IBMTTS, and others may be on the way soon. Keep an eye on the gnome-speech package for more progress in this area.

See also the Speech page for more information.

What languages are supported?

The GNOME Translation teams are composed of many passionate volunteers from around the world. These teams do a great job and keep an up-to-date status report. Please see the Orca translation status page for the large number of languages into which Orca has been translated. NOTE that the support for a language also depends upon a speech synthesis engine that supports the language whether BrlTTY has braille tables for the language or not.

How well does magnification work?

Orca currently uses the gnome-mag magnification service. As of this writing (GNOME 2.18), gnome-mag has incorporated some support for smoother full screen magnification, which relies upon newer extensions in the X Window System server. These extensions do not always function well on all platforms, so smooth full screen magnification may not always work.

How's web access coming along?

It's going well! See the Orca Firefox page for more information.

Where can I find more information about Python?

More information on Python can be found here:

I would like to help with Orca code, what do I need to know before starting?

Please see Orca/CodingGuidance

Any good OCR packages available?

Here's what a few of our users have to say:

two OCR packages are gocr and ocrad, and both of these work reasonably
well for me. The most important thing is to make sure the images are in
the correct resolution (my scanners default is 600 but it needs to be
300, until I realised this I was lucky if it got one character correct
on a page, where as now it is good enough to know what is meant to be
there if there is any errors). You can pipe the output from the sane
tools to these (eg. scanimage --resolution=300 | ocrad - ). There is
also tesseract ocr, but I haven't got that working although it came from
a commercial OCR package from the 1990s as I understand.

Also if you want a GUI, then I think xsane provides a full system to
scan and get OCR, although not as quick as typing in the piped command
above (particularly if you create a script to shorten it).

tesseract-ocr is available under debian and is the greatest free ocr
solution under linux.

Installation and Configuration

Where can I find binary packages?

Orca is now included with most modern Solaris and Linux operating system releases. The Download and Install page contains more information on obtaining and installing several operating systems, and also includes information on building Orca from source code.

Where do I get the Orca sources?

The latest stable sources can always be found at the GNOME ftp site.

The brave can always obtain the latest sources from the orca trunk in the GNOME Subversion (svn) source code repository. The Download and Install page contains more information on building Orca from source code.

How do I build Orca from source?

The Download and Install page contains more information on building Orca from source code.

Do I have to be root and/or install into /usr?

No. You can install to and run orca from nearly anywhere you want, including directories owned by you. When you run ./configure, you can pass it a prefix that points to some other location (e.g., --prefix=$HOME/orca). If you do this, you need to define PYTHONPATH to point to the new lib/python2.4/site-packages directory (e.g., PYTHONPATH=$HOME/orca/lib/python2.4/site-packages). You can then run orca from this new location (e.g., $HOME/orca/bin/orca). NOTE: if you are using Python 2.5, you may need to adjust the PYTHONPATH accordingly.

How do I set up Orca?

The short answer is that when you run orca for the first time, orca will automatically enter setup mode. If you want to run setup at some later point, you can pass the --setup option to orca the next time you run it. Furthermore, while orca is running, you can press Insert+Space to bring up the orca setup window. Finally, orca provides a text setup utility that you can start by passing the --text-setup option to orca. All of these options will create a ~/.orca/user-settings.py file that holds your preferences and will also enable the accessibility infrastructure. You need to log out and log back in for the accessibility infrastructure settings to take effect.

See also the Configuration and Use page for more information.

How do I get Orca to launch automatically when I log in?

See the Configuration and Use page for more information.

How do I set up accessible login?

See the Accessible Login page for more information.

How do I get Orca working with Java applications?

In order to access Java applications, you need to install and set up the Java access bridge. The Java access bridge for GNOME page provides information on installing and setting up the Java access bridge.

Does Orca work on GNOME 2.12 (Solaris 10, Ubuntu 5.10, Fedora Core 4, etc.)?

Orca works best with GNOME 2.22 or later. See the Download and Install page for information on obtaining and installing more modern operating systems that support Orca out of the box.

Using Orca

How do I run Orca?

Merely run orca. You can do so from a virtual console window if you do not yet have access to the GUI -- orca will automatically enter text setup mode if you run it from a virtual console window or your GUI environment is not yet set up for accessibility.

See also the Configuration and Use page for more information.

What keyboard commands do I use to access the desktop and applications?

Orca is designed to allow you to navigate the desktop and its applications using the standard keyboard navigation mechanisms built into the GNOME platform (see http://developer.gnome.org/projects/gup/hig/2.0/input-keyboard.html).

See also the Configuration and Use page for more information.

What keyboard commands do I use to control Orca?

Orca is designed to allow you to navigate the desktop and its applications using the keyboard navigation mechanisms built into the GNOME platform (see http://developer.gnome.org/projects/gup/hig/2.0/input-keyboard.html). As such, we try to limit the Orca-specific keyboard commands as much as possible. There are occasions, however, where you may want to interact with Orca itself, such as invoking the configuration GUI or escaping to flat review mode to get a better idea of what is on the screen.

Refer to the Configuration and Use page and the Orca Keyboard Commands page for more information on the keyboard commands for Orca.

How do I get Orca to speak alongside other ALSA applications?

NOTE to Ubuntu Hardy users: Ubuntu Hardy is investigating the use of PulseAudio to take care of a lot of device contention. As a result, audio mixing should "just work" on Ubuntu Hardy and you shouldn't have to monkey around with this stuff.

Hotly debated issue, It is not Orca's fault that it is set up like this, so the fix should be done elsewhere, but if you don't care about the politics and simply want it to work then:

sudo apt-get install alsa-oss

now change directory:

cd /usr/lib/bonobo/servers/

now edit using your favorite editor: If you are using Espeak then modify:

GNOME_Speech_SynthesisDriver_Espeak.server

and if you are using Festival:

GNOME_Speech_SynthesisDriver_Festival.server

replace "festival" for "espeak" if you wish to modify the festival synthesizer. On the third line of the file you will see (remember to use dashes instead of underscores):

                type="exe" location="/usr/bin/espeak-synthesis-driver"

replace this with:

                type="exe" location="/usr/bin/aoss /usr/bin/espeak-synthesis-driver"

Note that if the alsa-oss package is not installed then you will have a broken system and wont have any speech output, so make sure it is installed.

save the file, and restart Orca, now you can use mplayer and suchlike to output sound alongside Orca.

What applications does Orca work with?

See the Accessible Applications page.

Does Orca work with Skype?

No. You'll need to ask the Skype team to make their user interface work with the AT-SPI. See also a hack for Pidgin that's still not very accessible.

Does Orca work with KDE?

No. KDE currently does not support the AT-SPI. There's some work being done to make the AT-SPI more amenable to the KDE folks.

How do I do system administration tasks?

See the GNOME System Administration Using Orca page for more information.

Customizing Orca

How do I define my own punctuation or character pronunciations?

Here's an example you can add to your ~/.orca/orca-customizations.py file. Be careful about the syntax -- if you screw it up, you might screw up Orca.

import orca.chnames
orca.chnames.chnames["'"] = "tick"
orca.chnames.chnames['"'] = "quote"
orca.chnames.chnames["!"] = "bang"

The basic idea is that orca.chnames.chnames is a dictionary where the keys are the characters you want to create a pronunciation for and the values are the pronunciation. Note that the above example provides two alternative mechanisms for the keys -- one uses double quote characters to allow you to embed single quotes inside the string, and the other uses single quote characters to allow you to embed double quotes in the string.


How do I define my own keybindings?

You can currently redefine your key bindings for Orca in two main ways. The first way is to be able to choose between the destkop and laptop layouts, which can be selected on the "General" page of the Orca Configuration GUI (press Insert+space to bring up the Orca preferences GUI). For finer-grained control, you can also redefine indivual key bindings on the "Key Bindings" page of the Orca Configuration GUI.

NOTE: the remainder of this answer might be out of date.

Here's an example you can add to your ~/.orca/user-settings.py file. It sets up a global keybinding for Insert+t (Insert is the Orca modifier) to speak and braille "Hello World."

et up custom keybindings.
#
import orca.braille
import orca.input_event
import orca.keybindings
import orca.orca
import orca.speech
from orca.orca_i18n import _
def sayHello(script, inputEvent=None):
message = _("Hello World")
# Say/braille something.
#
orca.speech.speak(message)
orca.braille.displayMessage(message)
# Consume the event so it will not go to an application.
#
return True
sayHelloHandler = orca.input_event.InputEventHandler(
sayHello,
_("Says hello to this fine world."))
myKeyBindings = orca.keybindings.KeyBindings()
myKeyBindings.add(orca.keybindings.KeyBinding(
"t",
1 <<>

Customizing Orca To Speak/Braille Battery Status, Date, Time and Weather Information (scripting)

Notes

If you don't want to learn about scripting, if you only want to add a little extra functionality to Orca and want to skip the headache, then you want the orca-customizations.py file. It is the script used in this tutorial with the added capability of battery status reporting.

  • The keybindings are Orca-a battery status, Orca-d date, Orca-t time, and Orca-w weather.

Just change the line that says xipCode = 0 to match your zip/postal code and save the file as ~/.orca/orca-customizations.py Close and restart Orca and it should work as expected. I originally meant to try and teach the basics of Python in this tutorial. However, trying to do everything here would make this document incredibly long. So instead, I will give a link to an excellent Python tutorial. This is where I got my start. The link is: http://www.sthurlow.com/python/

Creating Scripts

There are two ways to go about this. For scripts to add global functionality such as time and date, battery status, weather, etc creating a file, ~/.orca/orca-customizations.py, will do the trick. Open a terminal, and type the following:

cd .orca
gedit orca-customizations.py

This will create the file if it doesn't exist already. The second way is to create your own custom script area. This is actually quite a bit easier than it sounds. To set up your custom script area, open a terminal if you haven't done so already and type the following commands.

cd .orca
mkdir orca-scripts
cd orca-scripts
touch __init__.py
There, you've done it! Your very own custom script area. Go ahead and celibrate, we'll wait... Now, for an explination of what was just done. cd .orca changes you to the .orca directory. It begins with a . because it is a hidden folder, so if you are in your home directory you won't know it is there unless you have view hidden directories on. Any file or folder that starts with a . is hidden. Just for reference, this is different from starting something with ./ which runs or executes a program. mkdir orca-scripts creates a new directory called orca-scripts. Just remember, mkdir equals make directory. cd orca-scripts Can you guess what this does? That's right, takes you into the orca-scripts directory. (2 points!) touch init.py is a neat command. It creates a file with nothing in it called, you guessed it, init.py.

It's much easier than firing up your favorite text editor and navigating through a bunch of folders just to save a blank file. So, now that you have your very own custom script area, you may be wondering why you need such a thing. When a new program is loaded or gains focus, let's say Firefox for example, Orca searches several places to find out how it is supposed to handle the new program. In general, Orca is going to look for a script module whose name matches the name of the application in use. If that's not found, it's going to look for a module whose name matches the name of the toolkit in use. If that's not found, then it falls back to default.py.

This can be changed by adding to settings._scriptMappings by calling settings.setScriptMapping. You can change the Firefox behavior by creating your own custom firefox.py script in the orca-scripts folder. This presents a special case though. IN the case of Firefox, you will most likely want to keep all of the abilities it has already like skip to next/previous heading etc. So, in your custom script, you will need to import orca.scripts.toolkits.Gecko in your script. Ok, if I haven't lost you so far, it gets easier, trust me. IN the next section I will give your brain as well as mine a chance to quit smoking. Let's write a script to add time functionality to Orca.

Time and Date

Most screen readers have a key combination that when pressed speaks the time and date. Orca, however, does not have this feature built in to it. No big deal though, we'll just roll our own. to get started, lets go to the .orca directory. To get to your .orca directory type:

cd ~/.orca
gedit orca-customizations.py

This will open up a new file in Gedit. You can use your text editor of choice instead of course. Enter the following lines in as they are shown. Remember that indentation is of upmost importants in Python. So, if two spaces appear at the beginning of the line here, they must also be at the beginning of the line in your script.

""This script adds time functionality to Orca
Adapted by Storm Dragon from the script posted at:
http://live.gnome.org/Orca/FrequentlyAskedQuestions#head-6a8c1c2511ba01d7397f68f754eec0d923d166f1
feel free to modify and/or redistribute this script as you see fit."""
import orca.input_event # watches for input that Orca recognizes
import orca.keybindings # Handles binding keystrokes for Orca to use.
import orca.orca # Imports the main screen reader
import orca.speech # Handles Orca's speaking abilities
import orca.braille # Displays information in Braille format

myKeyBindings = orca.keybindings.KeyBindings()

#Define the sayTime function
def sayTime(script, inputEvent=None):
import time # imports the Python time library
message = time.strftime("%I:%M%p", time.localtime())
orca.speech.speak(message)
orca.braille.displayMessage(message)
return True
#end sayTime function

sayTimeHandler = orca.input_event.InputEventHandler(
sayTime,
"Speaks and/or Brailles the time.") # Shows the function of the key press in learn mode

myKeyBindings.add(orca.keybindings.KeyBinding(
"t",
1 <<>

From the code above you can see that to work with speech you must import the speech library and to work with Braille, you must import the Braille library. The sayTime function is pretty straight forward. You first set the information you want to display in the message variable. Then, call the speech and Braille functions with the message you want spoken and/or Brailled. Be sure to remember to import the time library in this case or it won't work as expected. Some info about the time library. The line in the script that gives us our time message is:

message = time.strftime("%I:%M%p", time.localtime())
For our purposes, only the part inside the quote marks matters. The %I gives the hour in twelve hour format. The : appears as a normal :, nothing special about it. The %M displays the minutes, and because it is in twelve hour format, %p will let us know if it's evening or morning with an uppercase PM or AM. For reference, here are the choices available when setting up a time and/or date string.

Python Time Codes:

%a abbreviated weekday name.
%A full weekday name.
%b abbreviated month name.
%B full month name.
%d Date of the month (01 to 31)
%H Hour in 24-hour format (00 to 23)
%I Hour in 12-hour format (01,12)
%m Month number (01 to 12)
%M Minute (00 to 59)
%p AM or PM.
%S Second (00 to 59)
%y 2 digit year (00 to 99)
%Y 4 digit year.
%Z Time zone name.

For more information about Python's time library: http://www.python.org/doc/2.5.2/lib/module-time.html The lines after the function add the key press to the learn mode. This is always a good thing to do for completeness and for those trying to learn their way around. Next comes the line that actually maps the key press. In our case the key is Orca-t. That is to say, insert-t for desktop layout or capslock-t for laptop layout. Simply put, the last line of code:

orca.settings.keyBindingsMap["default"] = myKeyBindings

seals the bargain. Next, we will add more functionallity to our orca-customizations.py file and in so doing show that the more things change, the more they stay the same.

Adding Date to the Mix

Why have date and time as two seperate commands? Well, I guess it's personal preference. When I want the time I don't particularly care what the date is, and usually when I want the date I don't want the time tossed in to it.

Pluss, they each feel more important if they get their own special attention from you. Actually, I think short messages are best and I am willing to put up with remembering more key presses to keep them short. IF you want the time and date in the same command, simply change the date string in the code in the previous section.

The thing that stands out about this next script, is it is exactly the same as the first script. It has two functions instead of one, the second fuction is the same as the first the only thing changed is the time string. This time, it shows the date instead. There are 2 more lines added to add the key binding to learn mode and set the actual keys to press, in our case Orca-d. Here is the script:


"""This script adds time and date functionality to Orca
New in this script, time or date can be pasted from the clipboard
Adapted by Storm Dragon from the script posted at:
http://live.gnome.org/Orca/FrequentlyAskedQuestions#head-6a8c1c2511ba01d7397f68f754eec0d923d166f1
feel free to modify and/or redistribute this script as you see fit."""
import orca.input_event # watches for input that Orca recognizes
import orca.keybindings # Handles binding keystrokes for Orca to use.
import orca.orca # Imports the main screen reader
import orca.speech # Handles Orca's speaking abilities
import orca.braille # Displays information in Braille format

myKeyBindings = orca.keybindings.KeyBindings()

#Define the sayTime function
def sayTime(script, inputEvent=None):
import time # imports the Python time library
message = time.strftime("%I:%M%p", time.localtime())
orca.speech.speak(message)
orca.braille.displayMessage(message)
return True
#end sayTime function

#Define the sayDate function
def sayDate(script, inputEvent=None):
import time # imports the Python time library
message = time.strftime("%A, %B %d, %Y", time.localtime())
orca.speech.speak(message)
orca.braille.displayMessage(message)
return True
#end sayDate function

#Set up sayTime keys
sayTimeHandler = orca.input_event.InputEventHandler(
sayTime,
"Presents the time.") # Shows the function of the key press in learn mode

myKeyBindings.add(orca.keybindings.KeyBinding(
"t",
1 << saydatehandler =" orca.input_event.InputEventHandler(">

As promised, this code is almost exactly the same as the one in the last section. If you go back and compare the two files you will notice that they both have exactly the same code with the only additions being the sayDate function and the extra key binding commands.


Extra Functionality

Now that you have the code to add speach and/or Braille as well as that necessary to add key bindings, all that is left is adding the scripts you want. Basically, more functions and imports. As a good example of what is possible let's build on our existing customizations.py. So far we can speak and Braille the current date and time. Perhaps, however, there are times when you would like to be able to add this information to a document. You can, of course, just type it in. What's the fun in that though? Also, the rules of laziness dictate that a quick key press should be used in this matter.

So, let's take our time and date script and add the information spoken or Brailled to the clipboard. This way, once we have pressed orca-t for the time or orca-d for the date, we can press control-v to paste the provided information from the clipboard. Here's the code.

"""This script adds time and date functionality to Orca
New in this script, time or date can be pasted from the clipboard
Adapted by Storm Dragon from the script posted at:
http://live.gnome.org/Orca/FrequentlyAskedQuestions#head-6a8c1c2511ba01d7397f68f754eec0d923d166f1
feel free to modify and/or redistribute this script as you see fit."""
#import gets code that has already been written.
#think of it as using wheels instead of trying to reinvent them.
import orca.input_event # watches for input that Orca recognizes
import orca.keybindings # Handles binding keystrokes for Orca to use.
import orca.orca # Imports the main screen reader
import orca.speech # Handles Orca's speaking abilities
import orca.braille # Displays information in Braille format

#places text in the clipboard
def setClipboardText(text):
import gtk # import the gtk library
cb = gtk.Clipboard()
cb.set_text(text)
cb.store()

myKeyBindings = orca.keybindings.KeyBindings()

#Define the sayTime function
def sayTime(script, inputEvent=None):
import time # imports the Python time library
message = time.strftime("%I:%M%p", time.localtime())
orca.speech.speak(message)
orca.braille.displayMessage(message)
setClipboardText(message)
return True
#end sayTime function

#Define the sayDate function
def sayDate(script, inputEvent=None):
import time # imports the Python time library
message = time.strftime("%A, %B %d, %Y", time.localtime())
orca.speech.speak(message)
orca.braille.displayMessage(message)
setClipboardText(message)
return True
#end sayDate function

#Set up sayTime keys
sayTimeHandler = orca.input_event.InputEventHandler(
sayTime,
"Presents the time.") # Shows the function of the key press in learn mode

myKeyBindings.add(orca.keybindings.KeyBinding(
"t",
1 << saydatehandler =" orca.input_event.InputEventHandler(">

Although new functionality was added, the ability to paste from the clipboard, the basic script is the exact same. We had to import the gtk library, but this was only for the setClipboardText function. Originally I had the import gtk statement at the end of all of the Orca imports. I got to thinking that the library was only necessary for the clipboard though so I put it in the setClipboardText function. This serves two purposes. First, it shows us that it's not necessary for the whole Orca script, only for the clipboard function. Second, functions are locally scoped. This means that things inside a function are only there while the function is in use. So, and I may be wrong about this, because we only import gtk when it is necessary, it should speed up the script by a few mili seconds. It doesn't sound like much, but every bit helps.

Adding Weather Information

IN this section I will show you how to get weather. The key binding is orca-w. This will present the current temperature | current conditions. For example 64 | mostly cloudy I really wanted to get this information from the top panel (where the clock is) but I couldn't find any information on accessing it. So, I did the next best thing. The weather info comes from Yahoo. This was a tricky piece of code, but after studying the developer documentation and writing and rewriting, I got it working. Here is the new script with documentation:

"""This script adds time and date functionality to Orca
New in this script, time or date can be pasted from the clipboard
Adapted by Storm Dragon from the script posted at:
http://live.gnome.org/Orca/FrequentlyAskedQuestions#head-6a8c1c2511ba01d7397f68f754eec0d923d166f1
feel free to modify and/or redistribute this script as you see fit."""
import orca.input_event # watches for input that Orca recognizes
import orca.keybindings # Handles binding keystrokes for Orca to use.
import orca.orca # Imports the main screen reader
import orca.speech # Handles Orca's speaking abilities
import orca.braille # Displays information in Braille format

#change the next line to your zip code:
zipCode = 28624

#places text in the clipboard
def setClipboardText(text):
import gtk # import the gtk library
cb = gtk.Clipboard()
cb.set_text(text)
cb.store()

#getWeather function gets weather from Yahoo
def getWeather(zip_code):
if zip_code != 0:
import urllib
from xml.dom import minidom
WEATHER_URL = 'http://xml.weather.yahoo.com/forecastrss?p=%s'
WEATHER_NS = 'http://xml.weather.yahoo.com/ns/rss/1.0'
url = WEATHER_URL % zip_code
dom = minidom.parse(urllib.urlopen(url))
ycondition = dom.getElementsByTagNameNS(WEATHER_NS, 'condition')[0]
weatherReport = ycondition.getAttribute('temp') + ' | ' + ycondition.getAttribute('text')
else:
weatherReport = "No zip code set: Please edit .orca/orca-customizations.py"
return weatherReport

myKeyBindings = orca.keybindings.KeyBindings()

#Define the sayTime function
def sayTime(script, inputEvent=None):
import time # imports the Python time library
message = time.strftime("%I:%M%p", time.localtime())
orca.speech.speak(message)
orca.braille.displayMessage(message)
setClipboardText(message)
return True
#end sayTime function


#Define the sayDate function
def sayDate(script, inputEvent=None):
import time # imports the Python time library
message = time.strftime("%A, %B %d, %Y", time.localtime())
orca.speech.speak(message)
orca.braille.displayMessage(message)
setClipboardText(message)
return True
#end sayDate function

#Define the sayWeather function
def sayWeather(script, inputEvent=None):
message = getWeather(zipCode)
orca.speech.speak(message)
orca.braille.displayMessage(message)
return True
#end sayWeather function

#Set up sayTime keys
sayTimeHandler = orca.input_event.InputEventHandler(
sayTime,
"Presents the time.") # Shows the function of the key press in learn mode

myKeyBindings.add(orca.keybindings.KeyBinding(
"t",
1 << saydatehandler =" orca.input_event.InputEventHandler(" sayweatherhandler =" orca.input_event.InputEventHandler(">

Once again, the code is basically the same. The only new additions are the sayWeather function which should seem awfully familiar, and the getWeather function which was quite interesting to write. This script is getting kind of long wouldn't you say? So, in the next section, let's tidy things up a bit.

Tidying Up

As you have probably noticed, this orca-customizations.py file can get rather long in a hurry. Never fear though, import to the rescue. It is possible to write your scripts in seperate files and use import to import them into your orca-customizations.py script. So, for example, if you took all of the code for the weather and placed it into a file called weather.py in your .orca directory, you would then use: import weather This, in theory, will import the weather code from weather.py and because it is now in your orca-customizations.py file, it will work as expected. You can do pretty much anything you want with your orca-customizations.py file. The only thing you really are required to have is the keybinding. As long as you follow the pattern above, everything should be ok. Good luck, and happy scriptin!

How do I set up my own custom script area?

The short answer is that if you create an empty ~/.orca/orca-scripts/__init__.py and place your custom scripts in ~/.orca/orca-scripts, Orca will pick up any scripts from there before looking in the installed area.

Gaming With Orca

MUD Clients

There are hundreds, if not thousands, of MUDs or Multiuser dungeons out there. For more information on MUDs, what they are, finding the perfect MUD for you, visit the MUD connector at: http://www.mudconnect.com/ In order to play them, you need a MUD client. At the moment, there are two clients that work great with Orca. There is one MUD in particular that has built in support for people using screen readers. You can find more information about it at: http://www.dentinmud.org/

Gnome-Mud

Gnome-Mud is a client that supports triggers, aliases, variables, and more. It's trigger support is not as powerful as some other mud clients, but it does have a gui. In Ubuntu, you can install it by opening terminal and typing:

sudo apt-get install gnome-mud

Once installed it is located under Applications, Games, Gnome-Mud. Scripting has been done to make it more accessible with Orca.

Tintin++

Tintin++ is a very powerful MUD client. It supports scripting including triggers, aliases, macros, variables, functions, classes, and more. It is a terminal based client but it is very easy to use. To install it, visit: http://tintin.sourceforge.net/ Click on the "Download" link, then click the Linux 1.98.6 pre-compiled binary (tt++) (.tar.gz file) link. Once the file is downloaded unzip it in your home directory. To launch it, open a terminal and type

./tt++

If you have created a file with triggers etc, you can specify the file name to have it automatically loaded. E.g:

./tt++ character.tin

Kildclient

Kildclient is another very powerful MUD client. It supports all the things listed for the previous MUD clients with the addition of perl scripts. Currently it does not automatically speak incoming text and it is necessary to use flat review to read what is happening. Work is currently being done on a script for Orca to make it more accessible.

BSDGames

BSDGames is a package of text based games. Most of them are accessible with Orca. In Ubuntu, to get it, open a terminal and type

sudo apt-get install bsdgames
  • BSDGames can be downloaded from:

http://packages.debian.org/etch/bsdgames Here is a list of the games that work well with Orca.

Adventure

A text-based exploration game. to start the game, type adventure in a terminal.

Arithmetic

Answer simple math questions as quickly as you can. To start the game, type arithmetic in a terminal.

Battlestar

Text based adventure game. If you excape the ship alive and manage to pilot your viper through space to an island, you get to explore the island. The ship battles aren't very accessible, so avoid them if possible. To launch it, type battlestar in a terminal.

Go Fish

Play the card game go fish. Works very well with Orca. To launch it type go-fish in a terminal.

Monopoly

The classic board game of monopoly. To launch the game, type monop in a terminal.

phantasia

Appears to be a multiuser adventure game. I haven't spent much time on it, but from a quick impression it seems to be accessible. To launch it, type phantasia in a terminal.

Trek

A Star Trek game. It's a little tricky to figure out, so if you aren't sure what to do type a question mark at the prompt. To launch it, type trek in a terminal.

Wumpus

Hunt and slay the dreaded wumpus. Just don't get killed yourself, lots of ways for that to happen including falling in pits or being eaten by the wumpus. To launch it, type wump inh a terminal.

Troubleshooting

Orca is not speaking. What's going wrong?

See Troubleshooting Speech.

My desktop has stopped responding. What do I do?

If you can get to a terminal, try restarting Orca by issuing another orca command in a terminal window. This will force any existing Orca process to exit and will then restart Orca. This sometimes has the effect of unhanging the desktop (which is usually due to an ill-behaved application).

Also, if you've just started a program which you believe to be the cause of the problem, press control+alt+d to show the desktop (I do this because if you use system sounds there is a little audio feedback, and if you have useful vision, you can see the difference in brightness). Next, press alt+f2 to get the run box up, and type:

killall appname

where appname is the name of the program (for example pidgin).

If orca hasn't started talking again, use the method outlined above, but enter orca into the run box instead.

Note that when you show the desktop with control+alt+d, and when you press alt+f2 from there to show the run box, if you are using system sounds (configured in your sound preferences), there is some audible feedback which will assist you. Another good audio queue is to take advantage of the new beep at the begining of a line which gnome has started doing. When you think you are in the run box, press backspace, and you should here a beep from your system speaker (if it is enabled), this is another useful trick, and will work at the begining and end of almost any input.

If none of the above methods are successful, try pressing ctrl+alt+backspace to kill the X Window System server. This should have the effect of returning you to the login screen.

I did something that required me to enter a password and my system hung. What's up with that?

The gnome-keyring implementation can be run in synchronous mode or asynchronous mode, and it's unfortunately up to the application developer to decide which mode to use. The synchronous mode is what causes the hang, and you need to log a bug with the application (not Orca and not gnome-keyring) to get them to fix it. :-( See also bug #540146 and comment #9 of bug #447435.

I am using the ubuntu 7.04 live cd, I get the desktop and Orca starts, but it only says "switching to focus tracking mode" Whats wrong with it?

For some reason the version on the cd seem to be broken. If you simply wish to try Orca out, then the ubuntu 6.10 does contain a working Orca. Alternatively, you could use a later version of the live CD (up to 8.04 at the time of this writing). Keep in mind that Orca has a good and fast development, so you will not be able to benefit from the latest accessibility changes and Orca features.

If you are installing to hard drive, then worry not, you will be able to update to the latest version as soon as the install is finished, and (preferably) you have brought your system up-to-date). If you have done so, and would want instructions on how to proceed, visit Orca/DownloadInstall
Adserver                     610x250

If you liked this article, subscribe to the feed by clicking the image below to keep informed about new contents of the blog:

0 commenti:

Post a Comment

Random Posts

Recent Posts

Recent Posts Widget

Popular Posts

Labels

Archive

page counter follow us in feedly
 
Copyright © 2014 Linuxlandit & The Conqueror Penguin
-->