[orca-list] Speech profiles



Hello,

don't know whether this should be better discussed in the orca-devl-list :-). I
just hacked a little script to change my language to english (and later also
back to German). I don't know whether the there are plans for profiles, if not
this could be an idea. I only want to switch the language during work, because
there are to often other languages. I attach the little script beneath this
post. If the developers are interested I would sit down and write something
more nice.

Btw, I always have to press the orca+w key twice to change the speech, whats
that?

Thanks
Greetings
Seba
===
# -*- coding: utf-8 -*-

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.settings

myKeyBindings = orca.keybindings.KeyBindings()

def switch_to_prof_1(script, inputEvent=None):
    orca.settings.voices = {
      'default' : orca.acss.ACSS({ 
        'family': {'locale': 'en', 'name': 'english'},
        'rate': 45.0}),
    }
    orca.speech.speak('Switched to profile 1')
    return True

handler_prof_1 = orca.input_event.InputEventHandler(
    switch_to_prof_1,
    "Switch to .o") # Shows the function of the key press in learn mode


myKeyBindings.add(orca.keybindings.KeyBinding(
    "w",
    1 << orca.settings.MODIFIER_ORCA,
    1 << orca.settings.MODIFIER_ORCA,
    handler_prof_1, 2)) # Sets the say weather key

orca.settings.keyBindingsMap["default"] = myKeyBindings # add key bindings to
# the global ones



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