+ if line != "":
+ sendKeystringLocal(line, LYX_PID)
+
+specialkeyreg = re.compile(r'(.+)(\\[AC]([a-zA-Z]|\\\[[A-Z][a-z]+\]).*)$')
+# Split line at start of each meta or controll char
+
+def sendKeystringAC(line, LYX_PID):
+ m = specialkeyreg.match(line)
+ if m:
+ first = m.group(1)
+ second = m.group(2)
+ sendKeystringAC(first, LYX_PID)
+ sendKeystringAC(second, LYX_PID)
+ else:
+ sendKeystringAx(line, LYX_PID)
+
+controlkeyreg = re.compile(r'^(.*\\\[[A-Z][a-z]+\])(.*\\\[[A-Z][a-z]+\])(.*)$')
+# Make sure, only one of \[Return], \[Tab], \[Down], \[Home] etc are in one sent line
+# e.g. split the input line on each keysym
+def sendKeystringRT(line, LYX_PID):
+ m = controlkeyreg.match(line)
+ if m:
+ first = m.group(1)
+ second = m.group(2)
+ third = m.group(3)
+ sendKeystringRT(first, LYX_PID)
+ time.sleep(controlkey_delay)
+ sendKeystringRT(second, LYX_PID)
+ time.sleep(controlkey_delay)
+ if third != "":
+ sendKeystringRT(third, LYX_PID)
+ else:
+ sendKeystringAC(line, LYX_PID)