Re: [orca-list] script to say current time



Oops - Rich was quick to point out I forgot to mention that Insert+t (or
Caps_Lock+t for laptop bindings) is the keystroke that is set up by this
code. 

Thanks Rich!

Will

On Wed, 2007-06-13 at 20:32 -0400, Willie Walker wrote:
Placing the following lines in ~/.orca/orca-customizations.py (creating
it if necessary) should work:

import orca.input_event
import orca.keybindings
import orca.orca
import orca.speech
import orca.braille
import re

myKeyBindings = orca.keybindings.KeyBindings()

def sayTime(script, inputEvent=None):
    import time
    message = time.strftime("%a, %d %b %Y %H:%M:%S", time.localtime())
    orca.speech.speak(message)
    orca.braille.displayMessage(message)
    return True

sayTimeHandler = orca.input_event.InputEventHandler(
    sayTime,
    "Presents the time.")

myKeyBindings.add(orca.keybindings.KeyBinding(
    "t",
    1 << orca.settings.MODIFIER_ORCA,
    1 << orca.settings.MODIFIER_ORCA,
    sayTimeHandler))

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

# Hope this helps,
# Will





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