From 5da67ce58332f77db9c3d0e02a83fa1cd0e76104 Mon Sep 17 00:00:00 2001 From: chrys Date: Wed, 25 Oct 2017 23:36:11 +0200 Subject: [PATCH] add copy last echo to clipboard --- .../commands/copy_last_echo_to_clipboard.py | 28 +++++++++++++++++++ 1 file changed, 28 insertions(+) create mode 100644 src/fenrir/commands/commands/copy_last_echo_to_clipboard.py diff --git a/src/fenrir/commands/commands/copy_last_echo_to_clipboard.py b/src/fenrir/commands/commands/copy_last_echo_to_clipboard.py new file mode 100644 index 00000000..6a88654c --- /dev/null +++ b/src/fenrir/commands/commands/copy_last_echo_to_clipboard.py @@ -0,0 +1,28 @@ +#!/bin/python +# -*- coding: utf-8 -*- + +# Fenrir TTY screen reader +# By Chrys, Storm Dragon, and contributers. + +from core import debug +from utils import mark_utils + +class command(): + def __init__(self): + pass + def initialize(self, environment): + self.env = environment + def shutdown(self): + pass + def getDescription(self): + return _('copies last presented text to the currently selected clipboard') + + def run(self): + lastEcho = self.env['runtime']['outputManager'].getLastEcho() + self.env['commandBuffer']['clipboard'] = [lastEcho] + self.env['commandBuffer']['clipboard'][:self.env['runtime']['settingsManager'].getSettingAsInt('general', 'numberOfClipboards') -1] + self.env['commandBuffer']['currClipboard'] = 0 + + self.env['runtime']['outputManager'].presentText(lastEcho, soundIcon='CopyToClipboard', interrupt=True) + + def setCallback(self, callback): + pass