Esempio n. 1
0
def showShelfList():
    print "Showing the Linux shelf list."
    logRecognition("shelf list")

    # Run our aenea plugin script that shows the Linux clipboard shelf list.
    # Value -1 means show the graphical list.
    aenea.communications.server.shelfCommand(-1)
Esempio n. 2
0
def enableKeyboard():
    print "Enabling keyboard."
    logRecognition("enable keyboard")
    load_code()

    print "Switching Dragon to Command mode."
    action = dragonfly.Mimic("switch", "to", "command", "mode")
    #action = dragonfly.Playback([(["switch", "to", "command", "mode"], 0.0)])
    action.execute()
Esempio n. 3
0
def disableKeyboard():
    print "Disabling just the keyboard grammar."
    logRecognition("disable keyboard")
    # Unload the modules except for all the "core" and "aenea" modules
    unload_code("aenea")

    print "Switching Dragon to Normal mode."
    action = dragonfly.Mimic("switch", "to", "normal", "mode")
    #action = dragonfly.Playback([(["switch", "to", "normal", "mode"], 0.0)])
    action.execute()
Esempio n. 4
0
def pauseDragon():
    print "Pausing Dragon"
    logRecognition("pause")
    # Pause Dragon, similar to saying "Stop Listening"
    action = dragonfly.Key("npdiv")  # Numpad "/" key
    action.execute()

    # Also pause my music player
    #action = aenea.Key("ctrl:down, shift:down, f12") + aenea.Key("ctrl:up, shift:up")
    #action.execute()
    pid = aenea.communications.server.controlMusic("pause")
Esempio n. 5
0
def showWindowList():
    print "Showing the Linux window list."
    logRecognition("window list")

    #"show window list":      Key("win:down/999, tab") + Key("win:up"),
    #"show window list":      Key("w-l") + Key("tab") + Key("down"),
    #action = aenea.Key("ctrl:down, alt:down") + aenea.Key("ctrl:up, alt:up")
    #action = aenea.Key("ctrl:down") + aenea.Key("o")
    #action.execute()
    #time.sleep(0.3)
    #action = aenea.Key("tab")
    #action.execute()
    #time.sleep(0.1)
    #action = aenea.Key("down")
    #action.execute()

    # Run our aenea plugin script that shows the Linux window list.
    aenea.communications.server.showWindowList()
Esempio n. 6
0
def shelfNumber(val):
    print "Running shelf number", val
    logRecognition("shelf " + val)

    # Run our aenea plugin script that pastes the shelf item
    aenea.communications.server.shelfCommand(val)
Esempio n. 7
0
def shervstest():
    print "Running Shervs Test!"
    logRecognition("shervs test")
Esempio n. 8
0
def reload_code():
    logRecognition("force natlink to reload all grammars")
    unload_code()
    load_code()
Esempio n. 9
0
 def _process_recognition(self, node, extras):
     logRecognition("enable proxy server")
     aenea.config.enable_proxy()
Esempio n. 10
0
 def on_failure(self):
     logRecognition("<???>")
     print "SPOKEN: <???>"
     print
Esempio n. 11
0
 def on_recognition(self, words):
     wordsString = ' '.join(words)
     logRecognition(wordsString)
     print "SPOKEN:", wordsString
     print
Esempio n. 12
0
 def on_begin(self):
     logRecognition("...")