def move_cursor_by_kbd(self, direction, num_steps, echo_evt=1): if echo_evt: self.echo_kbd_event('move_cursor_by_kbd', direction, num_steps) string_to_send = '' move_with_key = "{%s" % direction string_to_send = '%s %d}' % (move_with_key, num_steps) sr_interface.send_keys(string_to_send, 1)
def set_selection_by_kbd(self, direction, length, echo_evt=1): if echo_evt: self.echo_kbd_event('set_selection_by_kbd', direction, length) string_to_send = '' move_with_key = '{Shift+Ext%s' % direction string_to_send = '%s %d}' % (move_with_key, length) sr_interface.send_keys(string_to_send, 1)
def set_selection_by_kbd(self, direction, length, echo_evt=1): """For Emacs, sending {Shift+Right} and {Shift+Left} from NatSpeak do not change the selection. This is true whether it's done by VoiceCode or a NatSpeak macro. Rather than trying to figure out why that is, we use native Emacs key sequences for changing the selection. """ if echo_evt: self.echo_kbd_event('set_selection_by_kbd', direction, length) sr_interface.send_keys('{Ctrl+Space}', 1) self.move_cursor_by_kbd(direction, length, echo_evt=0) time.sleep(5)
def raise_main_frame(self): """bring the main frame of the application (and any modal dialog boxes on top of it to the foreground **INPUTS** *none* **OUTPUTS** *none* """ sr_interface.send_keys("{Ctrl+Shift+F8}", system = 1)
def type_text(self, text, echo_evt=1): if echo_evt: self.echo_kbd_event('stype_text', text) sr_interface.send_keys(text)