improve clipboard

This commit is contained in:
chrys 2016-10-04 23:30:47 +02:00
parent c49a1b318a
commit 98fb60df60
5 changed files with 14 additions and 4 deletions

View File

@ -35,7 +35,7 @@ PlaceEndMark='PlaceEndMark.wav'
# Copied to clipboard
CopyToClipboard='CopyToClipboard.wav'
# Pasted on the screen
PasedClipboardOnScreen='PasedClipboardOnScreen.wav'
PasteClipboardOnScreen='PasteClipboardOnScreen.wav'
# An error accoured while speech or braille output or reading the screen
ErrorSpeech='ErrorSpeech.wav'
ErrorBraille='ErrorBraille.wav'

Binary file not shown.

View File

@ -35,7 +35,7 @@ PlaceEndMark='PlaceEndMark.opus'
# Copied to clipboard
CopyToClipboard='CopyToClipboard.opus'
# Pasted on the screen
PasedClipboardOnScreen='PasedClipboardOnScreen.opus'
PasteClipboardOnScreen='PasteClipboardOnScreen.opus'
# An error accoured while speech or braille output or reading the screen
ErrorSpeech='ErrorSpeech.opus'
ErrorBraille='ErrorBraille.opus'

Binary file not shown.

View File

@ -19,12 +19,22 @@ class command():
def getDescription(self):
return 'pastes the text from the currently selected clipboard'
def run(self):
def run(self):
currClipboard = self.env['commandBuffer']['currClipboard']
if currClipboard < 0:
self.env['runtime']['outputManager'].presentText('clipboard empty', interrupt=True)
return
self.env['runtime']['outputManager'].presentText('paste clipboard', soundIcon='PasedClipboardOnScreen', interrupt=True)
if not self.env['commandBuffer']['clipboard']:
self.env['runtime']['outputManager'].presentText('clipboard empty', interrupt=True)
return
if self.env['commandBuffer']['clipboard'][currClipboard]:
self.env['runtime']['outputManager'].presentText('clipboard empty', interrupt=True)
return
if self.env['commandBuffer']['clipboard'][currClipboard] == '':
self.env['runtime']['outputManager'].presentText('clipboard empty', interrupt=True)
return
self.env['runtime']['outputManager'].presentText('paste clipboard', soundIcon='PasteClipboardOnScreen', interrupt=True)
time.sleep(0.02)
with open("/dev/tty" + self.env['screenData']['newTTY'], 'w') as fd:
for c in self.env['commandBuffer']['clipboard'][currClipboard]:
fcntl.ioctl(fd, termios.TIOCSTI, c)