diff --git a/config/settings/settings.conf b/config/settings/settings.conf index 2d48e901..65bec737 100644 --- a/config/settings/settings.conf +++ b/config/settings/settings.conf @@ -142,7 +142,7 @@ charDeleteEcho=True # echo word after pressing space wordEcho=False # interrupt speech on any keypress -interruptOnKeyPress=False +interruptOnKeyPress=True # you can filter the keys on that the speech should interrupt (empty = all keys, otherwhise the given keys) interruptOnKeyPressFilter= # timeout for double tap in sec diff --git a/src/fenrirscreenreader/inputDriver/evdevDriver.py b/src/fenrirscreenreader/inputDriver/evdevDriver.py index 40c1c13a..76810724 100644 --- a/src/fenrirscreenreader/inputDriver/evdevDriver.py +++ b/src/fenrirscreenreader/inputDriver/evdevDriver.py @@ -1,6 +1,3 @@ -#!/bin/python -# -*- coding: utf-8 -*- - # Fenrir TTY screen reader # By Chrys, Storm Dragon, and contributers. @@ -49,20 +46,19 @@ class driver(inputDriver): self.env['runtime']['inputManager'].setShortcutType('KEY') global _evdevAvailable global _udevAvailable - self._initialized = _evdevAvailable and _udevAvailable - if not self._initialized: - global _evdevAvailableError - global _udevAvailableError - currError = ' ' - if not _evdevAvailable: - currError += _evdevAvailableError - if not _udevAvailable: - currError += ' ' + _udevAvailableError - self.env['runtime']['debug'].writeDebugOut('InputDriver:' + currError, debug.debugLevel.ERROR) - return + global _evdevAvailableError + global _udevAvailableError + if not _udevAvailable: + self.env['runtime']['debug'].writeDebugOut('InputDriver:' + _udevAvailableError, debug.debugLevel.ERROR) + if not _evdevAvailable: + self.env['runtime']['debug'].writeDebugOut('InputDriver:' + _evdevAvailableError, debug.debugLevel.ERROR) + return - self.env['runtime']['processManager'].addCustomEventThread(self.plugInputDeviceWatchdogUdev) + if _udevAvailable: + self.env['runtime']['processManager'].addCustomEventThread(self.plugInputDeviceWatchdogUdev) self.env['runtime']['processManager'].addCustomEventThread(self.inputWatchdog) + self._initialized = True + def plugInputDeviceWatchdogUdev(self,active , eventQueue): context = pyudev.Context() monitor = pyudev.Monitor.from_netlink(context)