def handle(self, text_window: PaneControl, text_pos: TextPosition) -> TextPosition: if text_pos[0:2] in (' "', '("', '>"'): text_window.SendKeys('{Right}{Shift}({Right})„', waitTime=0) text_pos.text = text_pos.text.replace(text_pos[1], '„', 1) text_pos += 2 elif text_pos[-2:0] in (' "', '("', '>"'): text_window.SendKeys('{Shift}({Left})„', waitTime=0) text_pos.text = text_pos.text.replace(text_pos[-2], '„', 1) return text_pos
def handle(self, text_window: PaneControl, text_pos: TextPosition) -> TextPosition: if text_pos[0:2] in ('" ', '".', '",'): text_window.SendKeys('{Shift}({Right})”', waitTime=0) text_pos.text = text_pos.text.replace(text_pos[0], '”', 1) text_pos += 1 return text_pos
def handle(self, text_window: PaneControl, text_pos: TextPosition) -> TextPosition: if text_pos[0:3] in (' - ', '>- ', '>-\t'): new_dash = text_pos[0] + '— ' text_window.SendKeys('{Shift}({Right 3})' + new_dash, waitTime=0) text_pos.text = text_pos.text.replace(text_pos[0:3], new_dash, 1) text_pos += 3 return text_pos
def handle(self, text_window: PaneControl, text_pos: TextPosition) -> TextPosition: keys = [self.precode + key for key in self.dict.keys()] if text_pos[0:2] in keys: n = self.__count_chars(text_pos) text_window.SendKeys('{Shift}({Right ' + str(1 + n) + '})', waitTime=0) chars_new = '' for char in text_pos[1:1 + n]: chars_new += self.dict[char] text_window.SendKeys(chars_new + '{Left}', waitTime=0) text_pos.text = text_pos.text.replace(text_pos[0:1 + n], chars_new, 1) text_pos += n - 1 return text_pos
def handle(self, text_window: PaneControl, text_pos: TextPosition) -> TextPosition: if text_pos[0:3] in SKR.keys(): text_window.SendKeys('{Shift}({Right 3})', waitTime=0) char_abb = text_pos[0:3] is_italic = self.it_access.State == 16 text_window.SendKeys(SKR[char_abb], waitTime=0) while self.it_access.State == 16: time.sleep(0.001) if is_italic: text_window.SendKeys('{Shift}({Left})', waitTime=0) self.it_invoke.Invoke() text_window.SendKeys('{Right}', waitTime=0) while self.it_access.State == 0: time.sleep(0.001) text_pos.text = text_pos.text.replace(char_abb, SKR[char_abb], 1) text_pos += 1 return text_pos