From 45df97499d1bef4f21226e622e296ce5fd61c450 Mon Sep 17 00:00:00 2001 From: chrys87 Date: Thu, 15 Dec 2016 10:31:03 +0100 Subject: [PATCH] Update linux.py --- src/fenrir/screenDriver/linux.py | 10 +++++++++- 1 file changed, 9 insertions(+), 1 deletion(-) diff --git a/src/fenrir/screenDriver/linux.py b/src/fenrir/screenDriver/linux.py index 7c5d396f..ab74e22b 100644 --- a/src/fenrir/screenDriver/linux.py +++ b/src/fenrir/screenDriver/linux.py @@ -7,6 +7,9 @@ import difflib import re import subprocess +import fcntl +import termios +import time from core import debug from utils import screen_utils @@ -25,7 +28,12 @@ class driver(): currScreenFile.close() except Exception as e: self.env['runtime']['debug'].writeDebugOut(str(e),debug.debugLevel.ERROR) - + def injectTextToScreen(self, text): + with open("/dev/tty" + self.env['screenData']['newTTY'], 'w') as fd: + for c in text: + fcntl.ioctl(fd, termios.TIOCSTI, c) + time.sleep(0.005) + def getCurrApplication(self): apps = [] try: