From b9a24b2702135d69cece8706185c8d2b55a8611d Mon Sep 17 00:00:00 2001 From: chrys Date: Sun, 25 Mar 2018 23:07:57 +0200 Subject: [PATCH] add initial PTY input driver --- TODO v2.0 | 2 +- src/fenrirscreenreader/core/settingsManager.py | 2 +- src/fenrirscreenreader/inputDriver/ptyDriver.py | 13 +++++++++++++ 3 files changed, 15 insertions(+), 2 deletions(-) create mode 100644 src/fenrirscreenreader/inputDriver/ptyDriver.py diff --git a/TODO v2.0 b/TODO v2.0 index 8cac3e41..5b380b1a 100644 --- a/TODO v2.0 +++ b/TODO v2.0 @@ -76,7 +76,7 @@ Driver (screen, input): [W] attributes [X] detect colum/ lines [X] resize on colum / line change - [W] make shell command configurable (or detect it) + [X] make shell command configurable (or detect it) [X] stop emulation properly [] make pasteing text work again https://docs.python.org/3.2/library/pty.html diff --git a/src/fenrirscreenreader/core/settingsManager.py b/src/fenrirscreenreader/core/settingsManager.py index 33663094..e3fdc645 100644 --- a/src/fenrirscreenreader/core/settingsManager.py +++ b/src/fenrirscreenreader/core/settingsManager.py @@ -295,7 +295,7 @@ class settingsManager(): self.setOptionArgDict('general', 'debugMode', 'PRINT') if cliArgs.emulation: self.setOptionArgDict('screen', 'driver', 'ptyDriver') - self.setOptionArgDict('keyboard', 'driver', 'dummyDriver') + self.setOptionArgDict('keyboard', 'driver', 'ptyDriver') self.setOptionArgDict('general', 'debugFile', '/tmp/fenrir-pty.log') self.setFenrirKeys(self.getSetting('general','fenrirKeys')) self.setScriptKeys(self.getSetting('general','scriptKeys')) diff --git a/src/fenrirscreenreader/inputDriver/ptyDriver.py b/src/fenrirscreenreader/inputDriver/ptyDriver.py new file mode 100644 index 00000000..22175126 --- /dev/null +++ b/src/fenrirscreenreader/inputDriver/ptyDriver.py @@ -0,0 +1,13 @@ +#!/bin/python +# -*- coding: utf-8 -*- + +# Fenrir TTY screen reader +# By Chrys, Storm Dragon, and contributers. + +import time +from fenrirscreenreader.core import debug +from fenrirscreenreader.core.inputDriver import inputDriver + +class driver(inputDriver): + def __init__(self): + inputDriver.__init__(self)