From a54e053f91baeb236ac62a383900d0525dbb829e Mon Sep 17 00:00:00 2001 From: Chrys Date: Thu, 22 Aug 2019 00:42:16 +0200 Subject: [PATCH] Revert "add better heuristic for typing" This reverts commit 3d5841ded9c5f718befaf315f56153ee59655835. --- .../screenDriver/vcsaDriver.py | 22 +++++-------------- 1 file changed, 5 insertions(+), 17 deletions(-) diff --git a/src/fenrirscreenreader/screenDriver/vcsaDriver.py b/src/fenrirscreenreader/screenDriver/vcsaDriver.py index 1cca2e6d..117f2d89 100644 --- a/src/fenrirscreenreader/screenDriver/vcsaDriver.py +++ b/src/fenrirscreenreader/screenDriver/vcsaDriver.py @@ -153,29 +153,17 @@ class driver(screenDriver): else: self.env['runtime']['debug'].writeDebugOut('ScreenUpdate',debug.debugLevel.INFO) vcsa[currScreen].seek(0) - screenContent = vcsa[currScreen].read() + dirtyContent = vcsa[currScreen].read() + screenContent = b'' vcsuContent = None - DoScan = True timeout = time.time() - while DoScan: + while screenContent != dirtyContent: + screenContent = dirtyContent if time.time() - timeout >= 0.4: - DoScan = False - print('timeout') + break time.sleep(0.02) vcsa[currScreen].seek(0) dirtyContent = vcsa[currScreen].read() - # X movement? - if abs( int(screenContent[2]) - int(dirtyContent[2])) in [1]: - DoScan = False - print('X') - # Y movement? - elif abs( int(screenContent[3]) - int(dirtyContent[3])) in [1]: - DoScan = False - print('Y') - elif screenContent == dirtyContent: - DoScan = False - print('gleich') - screenContent = dirtyContent if useVCSU: vcsu[currScreen].seek(0) vcsuContent = vcsu[currScreen].read()