Ejemplo n.º 1
0
 def printTextHandler(self, text, pressEnter=False):
     Validator.notEmpty(text, "printTextHandler")
     self.handlers.append(setKeyDelay(text))
     self.handlers.append("SendRaw " + text)
     if pressEnter:
         self.handlers.append("Send {enter}")
     self.handlers.append("return\n")
 def printTextHandler(self, text, pressEnter=False):
     Validator.notEmpty(text, "printTextHandler")
     self.handlers.append(setKeyDelay(text))
     self.handlers.append("SendRaw "+ text)
     if pressEnter:
         self.handlers.append("Send {enter}")
     self.handlers.append("return\n")
    def pasteText(self, text, pressEnter=False): #Menu should use own overrided method
        Validator.notEmpty(text, "pasteText")
        self.write("ClipSaved = %ClipboardAll%")
        self.write('clipboard = ' + text)
#        self.write("ClipWait")
        self.write(sendPaste())
        self.write("clipboard = %ClipSaved%")
        self.write("return\n")
 def hotKeyPrintText(self, key, text, pressEnter=False, useKeyDelay=True):
     Validator.notEmpty(text, "hotKeyPrintText on %s button" % Parser.parseHotKey(key))
     self.key_bindings.append("\n%s::" % Parser.parseHotKey(key))
     if useKeyDelay:
         self.key_bindings.append(setKeyDelay(text))
     self.key_bindings.append("SendRaw "+ text)
     if pressEnter:
         self.key_bindings.append("Send {enter}")
     self.key_bindings.append("return")
Ejemplo n.º 5
0
 def pasteText(self,
               text,
               pressEnter=False):  #Menu should use own overrided method
     Validator.notEmpty(text, "pasteText")
     self.write("ClipSaved = %ClipboardAll%")
     self.write('clipboard = ' + text)
     #        self.write("ClipWait")
     self.write(sendPaste())
     self.write("clipboard = %ClipSaved%")
     self.write("return\n")
Ejemplo n.º 6
0
 def hotKeyPrintText(self, key, text, pressEnter=False, useKeyDelay=True):
     Validator.notEmpty(
         text, "hotKeyPrintText on %s button" % Parser.parseHotKey(key))
     self.key_bindings.append("\n%s::" % Parser.parseHotKey(key))
     if useKeyDelay:
         self.key_bindings.append(setKeyDelay(text))
     self.key_bindings.append("SendRaw " + text)
     if pressEnter:
         self.key_bindings.append("Send {enter}")
     self.key_bindings.append("return")
 def addPasteText(self, itemName, text, subMenuName=None, deleteOnClick=False, clipSave=True):
     Validator.notEmpty(text, "addPasteText for itemName %s " % itemName)
     itemName = Parser.filterMenuItemName(itemName)
     print("[PasteText] %s" % text)
     handler = self.createHandlerId()
     if not subMenuName:
         subMenuName=self.name
     self.builder.menu_tree.append("Menu, %s, Add, %s, %s" % (subMenuName, itemName, handler))
     self.builder.handlers.append(handler + ":")
     self.pasteTextHandler(text, sendPaste=False, clipSave=False)
Ejemplo n.º 8
0
 def addPasteText(self,
                  itemName,
                  text,
                  subMenuName=None,
                  deleteOnClick=False,
                  clipSave=True):
     Validator.notEmpty(text, "addPasteText for itemName %s " % itemName)
     itemName = Parser.filterMenuItemName(itemName)
     print("[PasteText] %s" % text)
     handler = self.createHandlerId()
     if not subMenuName:
         subMenuName = self.name
     self.builder.menu_tree.append("Menu, %s, Add, %s, %s" %
                                   (subMenuName, itemName, handler))
     self.builder.handlers.append(handler + ":")
     self.pasteTextHandler(text, sendPaste=False, clipSave=False)
    def hotKeyWrapSelectedText(self, key, textLeft, textRight, pressEnter=False):
        Validator.notEmpty(textLeft, "hotKeyWrapSelectedText <textLeft> on %s button" % Parser.parseHotKey(key))
        Validator.notEmpty(textRight, "hotKeyWrapSelectedText <textRight> on %s button" % Parser.parseHotKey(key))
        self.key_bindings.append("\n%s::" % Parser.parseHotKey(key))
        self.key_bindings.append("""
ClipSaved := ClipboardAll
Clipboard =
Send ^x
ClipWait 1
SendInput %s
Send ^v
SendInput %s
Clipboard := ClipSaved
ClipSaved =
Return
""" % (textLeft, textRight))
 def pasteTextHandler(self, text, sendPaste=False, clipSave=False, beforeReturn=False):
     Validator.notEmpty(text, "Menu.pasteTextHandler")
     if clipSave:
         self.builder.handlers.append("clipboard = %ClipSaved%")
 #    handlers.append("ClipWait")
     self.builder.handlers.append('clipboard = ' + text)
     #.replace('$', "`$").replace('%', "`%")
 #    handlers.append("ClipWait")
 #    handlers.append("Sleep, 1")
     if sendPaste:
         self.builder.handlers.append(pasteTextCode())
     # self.builder.handlers.append("sleep 100")
     if beforeReturn:
         self.builder.handlers.append(beforeReturn)
     if clipSave:
         self.builder.handlers.append("clipboard = %ClipSaved%")
 #    handlers.append("ClipWait")
 #    handlers.append("Sleep, 1")
     self.builder.handlers.append("return\n")
Ejemplo n.º 11
0
 def pasteTextHandler(self,
                      text,
                      sendPaste=False,
                      clipSave=False,
                      beforeReturn=False):
     Validator.notEmpty(text, "Menu.pasteTextHandler")
     if clipSave:
         self.builder.handlers.append("clipboard = %ClipSaved%")
 #    handlers.append("ClipWait")
     self.builder.handlers.append('clipboard = ' + text)
     #.replace('$', "`$").replace('%', "`%")
     #    handlers.append("ClipWait")
     #    handlers.append("Sleep, 1")
     if sendPaste:
         self.builder.handlers.append(pasteTextCode())
     # self.builder.handlers.append("sleep 100")
     if beforeReturn:
         self.builder.handlers.append(beforeReturn)
     if clipSave:
         self.builder.handlers.append("clipboard = %ClipSaved%")
 #    handlers.append("ClipWait")
 #    handlers.append("Sleep, 1")
     self.builder.handlers.append("return\n")
Ejemplo n.º 12
0
    def hotKeyWrapSelectedText(self,
                               key,
                               textLeft,
                               textRight,
                               pressEnter=False):
        Validator.notEmpty(
            textLeft, "hotKeyWrapSelectedText <textLeft> on %s button" %
            Parser.parseHotKey(key))
        Validator.notEmpty(
            textRight, "hotKeyWrapSelectedText <textRight> on %s button" %
            Parser.parseHotKey(key))
        self.key_bindings.append("\n%s::" % Parser.parseHotKey(key))
        self.key_bindings.append("""
ClipSaved := ClipboardAll
Clipboard =
Send ^x
ClipWait 1
SendInput %s
Send ^v
SendInput %s
Clipboard := ClipSaved
ClipSaved =
Return
""" % (textLeft, textRight))