Re: Orca Flag Day.



Here's the contents of an example ~/.orca/orca-customizations.py. Note
that it explicitly modifies the keybindings map of the settings.py
module.

Hope this helps,

Will

PS - As you can tell, we are refining the end user customization stuff
as we go.  I expect it to remain in flux for a while until we actually
get the Customization GUI in place.

# Set up custom keybindings.
#
import orca.braille
import orca.input_event
import orca.keybindings
import orca.orca
import orca.settings
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 << orca.orca.MODIFIER_ORCA,
    1 << orca.orca.MODIFIER_ORCA,
    sayHelloHandler))

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

On Fri, 2006-04-07 at 08:33 -0700, Rich Burridge wrote:
If you are checking out the latest Orca from CVS HEAD, then I've just
checked in some changes that will affect you, and you will need to
re-run orca-setup before you re-run orca.

These changes are listed below. The main reasons for doing them are:

* Prepare for better key echo which will be (hopefully) coming in the
  next week or so. Note that currently the "echo by word" and "echo by
  character" functionality is not fully implemented.

* Make it easier to automatically create the infrastructure to allow
  users to just put their own Orca application scripts under their
  .orca directory (under ~/.orca/orca-scripts/ to be exact), should they so
  desire.

* Allow users to have their own custom Orca Python code, that won't get
  destroyed if you re-run orca-setup (such as Javier's recent sayTime()
  routine). You should now put this code in a file called
  "orca-customizations.py" under your ~/.orca directory.

* Setup the display of the visual braille monitor (useful to sighted people
   to see what would be happening on the braille display - if present).

Please let me know if you find any problems with these changes.

Thanks.

--

        * src/orca/orca-setup.in
          Several changes to the orca-setup script:
          - Removed the "Use key echo?" question and associated
            orca.settings.USE_KEY_ECHO setting.
          - Replaced it with:
            "Echo by word, character, both or none?  Enter w, c, b or n: "
            which  will set two settings to True or False:
              orca.settings.USE_ECHO_BY_WORD
              orca.settings.USE_ECHO_BY_CHAR
            depending upon the users answer.
          - Added in another question: "Use Braille Monitor?  Enter y or 
n: ".
            The Braille Monitor is a visual representation of what is being
            brailled by Orca.
          - Automatically create a "orca-scripts" directory under the
            users .orca directory, if it doesn't already exist.
          - Automatically create an empty __init__.py file in the
            orca-scripts directory, if it doesn't already exist.
            This will enable the user to put their own specific
            applications scripts in the orca-scripts directory,
            and Orca will pick them up.
          - Added a section of code that will generate the following lines
            at the end of the user's user-settings.py file:

              try:
                  __import__("orca-customizations")
              except ImportError:
                  pass

            What this means is that Orca will now look for a file
            called "orca-customizations.py" in the user's .orca directory.
            This file should contain any custom Orca Python code that the
            user wants. Having it in a separate file from user-settings.py
            means it won't get blown away when you rerun orca-setup

_______________________________________________
Orca-list mailing list
Orca-list gnome org
http://mail.gnome.org/mailman/listinfo/orca-list




[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]