add debug

This commit is contained in:
chrys 2018-09-09 13:57:28 +02:00
parent 427f63d0d5
commit c2743da6fd
4 changed files with 504 additions and 6 deletions

View File

@ -0,0 +1,247 @@
[sound]
# Turn sound on or off:
enabled=True
# Select the driver used to play sounds, choices are genericDriver and gstreamerDriver.
# Sox is the default.
#driver=gstreamerDriver
driver=genericDriver
# Sound themes. These are the pack of sounds used for sound alerts.
# Sound packs may be located at /usr/share/sounds
# For system wide availability, or ~/.local/share/fenrirscreenreader/sounds
# For the current user.
theme=default
# Sound volume controls how loud the sounds for your selected soundpack are.
# 0 is quietest, 1.0 is loudest.
volume=1.0
# shell commands for generic sound driver
# the folowing variable are substituted
# fenrirVolume = the current volume setting
# fenrirSoundFile = the soundfile for an soundicon
# fenrirFrequence = the frequency to play
# fenrirDuration = the duration of the frequency
# the following command is used to play a soundfile
genericPlayFileCommand=play -q -v fenrirVolume fenrirSoundFile
#the following command is used to generate a frequency beep
genericFrequencyCommand=play -q -v fenrirVolume -n -c1 synth fenrirDuration sine fenrirFrequence
[speech]
# Turn speech on or off:
enabled=True
# Select speech driver, options are speechdDriver (default), genericDriver or espeakDriver:
#driver=speechdDriver
#driver=espeakDriver
driver=genericDriver
# server path for emacspeak
serverPath=/home/chrys/Projekte/emacspeak/servers/espeak
# The rate selects how fast Fenrir will speak. Options range from 0, slowest, to 1.0, fastest.
rate=0.65
# Pitch controls the pitch of the voice, select from 0, lowest, to 1.0, highest.
pitch=0.5
# Pitch for capital letters
capitalPitch=0.9
# Volume controls the loudness of the voice, select from 0, quietest, to 1.0, loudest.
volume=1.0
# Module is used for Speech-dispatcher, to select the speech module you want to use.
# Consult Speech-dispatcher's configuration and help Fenrir find out which modules are available.
# The default is espeak.
#module=espeak
# Voice selects the varient you want to use, for example, f5 will use the female voice #5 in Espeak,
# or if using the Espeak module in Speech-dispatcher. To find out which voices are available, consult the documentation provided with your selected synthesizer.
# This also sets the voice used in the generic driver.
voice=en-us
# Select the language you want Fenrir to use.
#language=english-us
# Read new text as it happens?
autoReadIncoming=True
# genericSpeechCommand is the command that is executed for talking
# the following variables are replaced with values
# fenrirText = is the text that should be spoken
# fenrirModule = may be the speech module like used in speech-dispatcher, not every TTY need this
# fenrirLanguage = the language
# fenrirVoice = is the current voice that should be used. Set the voice variable above.
# the current volume, pitch and rate is calculated like this
# value = min + settingValue * (min - max )
# fenrirVolume = is replaced with the current volume
# fenrirPitch = is replaced with the current pitch
# fenrirRate = is replaced with the current speed (speech rate)
genericSpeechCommand=espeak -a fenrirVolume -s fenrirRate -p fenrirPitch -v fenrirVoice -- "fenrirText"
# those are the min and max values of the TTS system that is used in genericSpeechCommand
fenrirMinVolume=0
fenrirMaxVolume=200
fenrirMinPitch=0
fenrirMaxPitch=99
fenrirMinRate=80
fenrirMaxRate=450
[braille]
enabled=False
driver=dummyDriver
layout=en
# to what should the flush timeout relate to
# word = flush after (number of words to display) * seconds
# char = flush after (number of chars to display) * seconds
# fix = flush after X seconds
# none = no automatic flush (manual via shortcut)
flushMode=word
# seconds to flush or
# -1 = no automatic flush (manual via shortcut)
flushTimeout=3
# how should the cursor be focused?
# page = if cursor cross the border move to next page and start at beginn
# fixCell = ajust the cursor on an special cell where it is always placed. the display scroll here more smooth.
cursorFocusMode=page
# define the cell on the Braille device where fenrir should scroll and keep the cursor
# 0 = first cell on device
# -1 = last cell on device
# >0 = fix cell number
fixCursorOnCell=-1
#How should the braille follow the focus
# none = no automatic toggle command used
# review = priority to review
# last = follow last used cursor
cursorFollowMode=review
# number of cells in panning (horizontal)
# 0 = display size, >0 number of cells
panSizeHorizontal=0
[screen]
driver=vcsaDriver
encoding=auto
screenUpdateDelay=0.05
suspendingScreen=
autodetectSuspendingScreen=True
[keyboard]
driver=evdevDriver
# filter input devices NOMICE, ALL or a DEVICE NAME
device=ALL
# gives Fenrir exclusive access to the keyboard and lets it control keystrokes.
grabDevices=True
ignoreShortcuts=False
# the current shortcut layout located in /etc/fenrirscreenreader/keyboard
keyboardLayout=desktop
# echo chars while typing.
charEcho=False
# echo deleted chars
charDeleteEcho=True
# echo word after pressing space
wordEcho=False
# interrupt speech on any keypress
interruptOnKeyPress=False
# 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
doubleTapTimeout=0.2
[general]
debugLevel=0
# debugMode sets where the debug output should send to:
# debugMode=File writes to debugFile (Default: /var/log/fenrirscreenreader/fenrir.log)
# debugMode=Print just prints on the screen
debugMode=File
debugFile=/var/log/fenrirscreenreader/fenrir.log
punctuationProfile=default
punctuationLevel=some
respectPunctuationPause=True
newLinePause=True
numberOfClipboards=10
# used path for "export_clipboard_to_file"
# $user is replaced by username
#clipboardExportPath=/home/$user/fenrirClipboard
clipboardExportPath=/tmp/fenrirClipboard
emoticons=True
# define the current Fenrir key
fenrirKeys=KEY_KP0,KEY_META,KEY_INSERT
scriptKey=KEY_COMPOSE
timeFormat=%H:%M:%P
dateFormat=%A, %B %d, %Y
autoSpellCheck=True
spellCheckLanguage=en_US
# path for your scripts "scriptKey" functionality
scriptPath=/usr/share/fenrirscreenreader/scripts
# overload commands, and create new one without changing Fenrir default
commandPath=
#fenrirBGColor = the backgroundcolor
#fenrirFGColor = the foregroundcolor
#fenrirUnderline = speak the underline attribute
#fenrirBold = speak the bold attribute
#fenrirBlink = speak the blink attribute
#fenrirFont = the font
#fenrirFontSize = the fontsize
attributeFormatString=Background fenrirBGColor,Foreground fenrirFGColor,fenrirUnderline,fenrirBold,fenrirBlink, Font fenrirFont,Fontsize fenrirFontSize
autoPresentIndent=False
# play a sound when attributes are changeing
hasAttributes=True
# shell for PTY emulatiun (empty = default shell)
shell=
[focus]
#follow the text cursor
cursor=True
#follow highlighted text changes
highlight=False
[remote]
enable=True
# connection type
# unix = unix sockets
# tcp = tcp (localhost only)
method=unix
# tcp port
port=22447
# socket filepath
socketpath=/tmp/
# allow settings to overwrite
enableSettingsRemote=True
# allow commands to be executed
enableCommandRemote=True
[barrier]
enabled=True
leftBarriers=│└┌─
rightBarriers=│┘┐─
[review]
lineBreak=True
endOfScreen=True
# leave the review when pressing a key
leaveReviewOnCursorChange=True
# leave the review when changing the screen
leaveReviewOnScreenChange=True
[promote]
enabled=True
inactiveTimeoutSec=120
list=
[time]
# automatic time anouncement
enabled=False
# present time
presentTime=True
# present date (on change)
presentDate=True
# present time after a given period of seconds
delaySec=0
# present time after to given minutes example every 15 minutes: 00,15,30,45
# if delaySec is >0 onMinutes is ignored
onMinutes=00,30
# announce via soundicon (not interrupting)
announce=True
# interrupt current speech for time announcement
interrupt=False

View File

@ -0,0 +1,247 @@
[sound]
# Turn sound on or off:
enabled=True
# Select the driver used to play sounds, choices are genericDriver and gstreamerDriver.
# Sox is the default.
#driver=gstreamerDriver
driver=genericDriver
# Sound themes. These are the pack of sounds used for sound alerts.
# Sound packs may be located at /usr/share/sounds
# For system wide availability, or ~/.local/share/fenrirscreenreader/sounds
# For the current user.
theme=default
# Sound volume controls how loud the sounds for your selected soundpack are.
# 0 is quietest, 1.0 is loudest.
volume=1.0
# shell commands for generic sound driver
# the folowing variable are substituted
# fenrirVolume = the current volume setting
# fenrirSoundFile = the soundfile for an soundicon
# fenrirFrequence = the frequency to play
# fenrirDuration = the duration of the frequency
# the following command is used to play a soundfile
genericPlayFileCommand=play -q -v fenrirVolume fenrirSoundFile
#the following command is used to generate a frequency beep
genericFrequencyCommand=play -q -v fenrirVolume -n -c1 synth fenrirDuration sine fenrirFrequence
[speech]
# Turn speech on or off:
enabled=True
# Select speech driver, options are speechdDriver (default), genericDriver or espeakDriver:
#driver=speechdDriver
#driver=espeakDriver
driver=genericDriver
# server path for emacspeak
serverPath=/home/chrys/Projekte/emacspeak/servers/espeak
# The rate selects how fast Fenrir will speak. Options range from 0, slowest, to 1.0, fastest.
rate=0.65
# Pitch controls the pitch of the voice, select from 0, lowest, to 1.0, highest.
pitch=0.5
# Pitch for capital letters
capitalPitch=0.9
# Volume controls the loudness of the voice, select from 0, quietest, to 1.0, loudest.
volume=1.0
# Module is used for Speech-dispatcher, to select the speech module you want to use.
# Consult Speech-dispatcher's configuration and help Fenrir find out which modules are available.
# The default is espeak.
#module=espeak
# Voice selects the varient you want to use, for example, f5 will use the female voice #5 in Espeak,
# or if using the Espeak module in Speech-dispatcher. To find out which voices are available, consult the documentation provided with your selected synthesizer.
# This also sets the voice used in the generic driver.
voice=en-us
# Select the language you want Fenrir to use.
#language=english-us
# Read new text as it happens?
autoReadIncoming=True
# genericSpeechCommand is the command that is executed for talking
# the following variables are replaced with values
# fenrirText = is the text that should be spoken
# fenrirModule = may be the speech module like used in speech-dispatcher, not every TTY need this
# fenrirLanguage = the language
# fenrirVoice = is the current voice that should be used. Set the voice variable above.
# the current volume, pitch and rate is calculated like this
# value = min + settingValue * (min - max )
# fenrirVolume = is replaced with the current volume
# fenrirPitch = is replaced with the current pitch
# fenrirRate = is replaced with the current speed (speech rate)
genericSpeechCommand=espeak -a fenrirVolume -s fenrirRate -p fenrirPitch -v fenrirVoice -- "fenrirText"
# those are the min and max values of the TTS system that is used in genericSpeechCommand
fenrirMinVolume=0
fenrirMaxVolume=200
fenrirMinPitch=0
fenrirMaxPitch=99
fenrirMinRate=80
fenrirMaxRate=450
[braille]
enabled=False
driver=dummyDriver
layout=en
# to what should the flush timeout relate to
# word = flush after (number of words to display) * seconds
# char = flush after (number of chars to display) * seconds
# fix = flush after X seconds
# none = no automatic flush (manual via shortcut)
flushMode=word
# seconds to flush or
# -1 = no automatic flush (manual via shortcut)
flushTimeout=3
# how should the cursor be focused?
# page = if cursor cross the border move to next page and start at beginn
# fixCell = ajust the cursor on an special cell where it is always placed. the display scroll here more smooth.
cursorFocusMode=page
# define the cell on the Braille device where fenrir should scroll and keep the cursor
# 0 = first cell on device
# -1 = last cell on device
# >0 = fix cell number
fixCursorOnCell=-1
#How should the braille follow the focus
# none = no automatic toggle command used
# review = priority to review
# last = follow last used cursor
cursorFollowMode=review
# number of cells in panning (horizontal)
# 0 = display size, >0 number of cells
panSizeHorizontal=0
[screen]
driver=vcsaDriver
encoding=auto
screenUpdateDelay=0.05
suspendingScreen=
autodetectSuspendingScreen=True
[keyboard]
driver=evdevDriver
# filter input devices NOMICE, ALL or a DEVICE NAME
device=ALL
# gives Fenrir exclusive access to the keyboard and lets it control keystrokes.
grabDevices=True
ignoreShortcuts=False
# the current shortcut layout located in /etc/fenrirscreenreader/keyboard
keyboardLayout=desktop
# echo chars while typing.
charEcho=False
# echo deleted chars
charDeleteEcho=True
# echo word after pressing space
wordEcho=False
# interrupt speech on any keypress
interruptOnKeyPress=False
# 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
doubleTapTimeout=0.2
[general]
debugLevel=0
# debugMode sets where the debug output should send to:
# debugMode=File writes to debugFile (Default: /var/log/fenrirscreenreader/fenrir.log)
# debugMode=Print just prints on the screen
debugMode=File
debugFile=/var/log/fenrirscreenreader/fenrir.log
punctuationProfile=default
punctuationLevel=some
respectPunctuationPause=True
newLinePause=True
numberOfClipboards=10
# used path for "export_clipboard_to_file"
# $user is replaced by username
#clipboardExportPath=/home/$user/fenrirClipboard
clipboardExportPath=/tmp/fenrirClipboard
emoticons=True
# define the current Fenrir key
fenrirKeys=KEY_KP0,KEY_META,KEY_INSERT
scriptKey=KEY_COMPOSE
timeFormat=%H:%M:%P
dateFormat=%A, %B %d, %Y
autoSpellCheck=True
spellCheckLanguage=en_US
# path for your scripts "scriptKey" functionality
scriptPath=/usr/share/fenrirscreenreader/scripts
# overload commands, and create new one without changing Fenrir default
commandPath=
#fenrirBGColor = the backgroundcolor
#fenrirFGColor = the foregroundcolor
#fenrirUnderline = speak the underline attribute
#fenrirBold = speak the bold attribute
#fenrirBlink = speak the blink attribute
#fenrirFont = the font
#fenrirFontSize = the fontsize
attributeFormatString=Background fenrirBGColor,Foreground fenrirFGColor,fenrirUnderline,fenrirBold,fenrirBlink, Font fenrirFont,Fontsize fenrirFontSize
autoPresentIndent=False
# play a sound when attributes are changeing
hasAttributes=True
# shell for PTY emulatiun (empty = default shell)
shell=
[focus]
#follow the text cursor
cursor=True
#follow highlighted text changes
highlight=False
[remote]
enable=True
# connection type
# unix = unix sockets
# tcp = tcp (localhost only)
method=unix
# tcp port
port=22447
# socket filepath
socketpath=/tmp/
# allow settings to overwrite
enableSettingsRemote=True
# allow commands to be executed
enableCommandRemote=True
[barrier]
enabled=True
leftBarriers=│└┌─
rightBarriers=│┘┐─
[review]
lineBreak=True
endOfScreen=True
# leave the review when pressing a key
leaveReviewOnCursorChange=True
# leave the review when changing the screen
leaveReviewOnScreenChange=True
[promote]
enabled=True
inactiveTimeoutSec=120
list=
[time]
# automatic time anouncement
enabled=False
# present time
presentTime=True
# present date (on change)
presentDate=True
# present time after a given period of seconds
delaySec=0
# present time after to given minutes example every 15 minutes: 00,15,30,45
# if delaySec is >0 onMinutes is ignored
onMinutes=00,30
# announce via soundicon (not interrupting)
announce=True
# interrupt current speech for time announcement
interrupt=False

View File

@ -1,4 +1,5 @@
#!/bin/python #!/bin/python
import evdev
iDevices = {} iDevices = {}
iDeviceNo = 0 iDeviceNo = 0
def updateInputDevices(force = False, init = False): def updateInputDevices(force = False, init = False):
@ -46,3 +47,4 @@ def updateInputDevices(force = False, init = False):
print('Device added:' + iDevices[currDevice.fd].name) print('Device added:' + iDevices[currDevice.fd].name)
except Exception as e: except Exception as e:
print("Skip Inputdevice : " + deviceFile +' ' + str(e)) print("Skip Inputdevice : " + deviceFile +' ' + str(e))
updateInputDevices()

View File

@ -45,22 +45,22 @@ class driver(inputDriver):
self.watchDog = Value(c_bool, True) self.watchDog = Value(c_bool, True)
def initialize(self, environment): def initialize(self, environment):
self.env = environment self.env = environment
self.env['runtime']['inputManager'].setShortcutType('KEY') self.env['runtime']['inputManager'].setShortcutType('KEY')
global _evdevAvailable global _evdevAvailable
global _udevAvailable global _udevAvailable
self._initialized = _evdevAvailable and _udevAvailable self._initialized = _evdevAvailable and _udevAvailable
if not self._initialized: if not self._initialized:
global _evdevAvailableError global _evdevAvailableError
global _udevAvailableError global _udevAvailableError
currError = ' ' currError = ' '
if not _evdevAvailable: if not _evdevAvailable:
currError += _evdevAvailableError currError += _evdevAvailableError
if not _udevAvailable: if not _udevAvailable:
currError += ' ' + _udevAvailableError currError += ' ' + _udevAvailableError
self.env['runtime']['debug'].writeDebugOut('InputDriver:' + currError, debug.debugLevel.ERROR) self.env['runtime']['debug'].writeDebugOut('InputDriver:' + currError, debug.debugLevel.ERROR)
return return
self.env['runtime']['processManager'].addCustomEventThread(self.plugInputDeviceWatchdogUdev) self.env['runtime']['processManager'].addCustomEventThread(self.plugInputDeviceWatchdogUdev)
self.env['runtime']['processManager'].addCustomEventThread(self.inputWatchdog) self.env['runtime']['processManager'].addCustomEventThread(self.inputWatchdog)
def plugInputDeviceWatchdogUdev(self,active , eventQueue): def plugInputDeviceWatchdogUdev(self,active , eventQueue):
context = pyudev.Context() context = pyudev.Context()
@ -71,6 +71,7 @@ class driver(inputDriver):
validDevices = [] validDevices = []
device = monitor.poll(1) device = monitor.poll(1)
while device: while device:
self.env['runtime']['debug'].writeDebugOut('plugInputDeviceWatchdogUdev:' + str(device), debug.debugLevel.INFO)
try: try:
if not '/sys/devices/virtual/input/' in device.sys_path: if not '/sys/devices/virtual/input/' in device.sys_path:
if device.device_node: if device.device_node:
@ -99,6 +100,7 @@ class driver(inputDriver):
except: except:
self.removeDevice(fd) self.removeDevice(fd)
while(event): while(event):
self.env['runtime']['debug'].writeDebugOut('inputWatchdog: EVENT:' + str(event), debug.debugLevel.INFO)
self.env['input']['eventBuffer'].append( [self.iDevices[fd], self.uDevices[fd], event]) self.env['input']['eventBuffer'].append( [self.iDevices[fd], self.uDevices[fd], event])
if event.type == evdev.events.EV_KEY: if event.type == evdev.events.EV_KEY:
if not foundKeyInSequence: if not foundKeyInSequence: