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)
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()
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()
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")
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()
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)
def shervstest(): print "Running Shervs Test!" logRecognition("shervs test")
def reload_code(): logRecognition("force natlink to reload all grammars") unload_code() load_code()
def _process_recognition(self, node, extras): logRecognition("enable proxy server") aenea.config.enable_proxy()
def on_failure(self): logRecognition("<???>") print "SPOKEN: <???>" print
def on_recognition(self, words): wordsString = ' '.join(words) logRecognition(wordsString) print "SPOKEN:", wordsString print
def on_begin(self): logRecognition("...")