From 6eceeee07b20b0c109b5634d3ce53c2a4b2cc734 Mon Sep 17 00:00:00 2001 From: chrys Date: Wed, 10 Aug 2016 02:09:49 +0200 Subject: [PATCH] prepare keyboard grab --- TODO | 1 + config/keyboard/desktop.conf | 1 + config/settings/settings.conf | 2 + config/settings/settings.conf.chrys | 38 +++++++++++++ config/settings/settings.conf.orig | 38 +++++++++++++ config/sound/default/promotedtext.opus | Bin 1229 -> 0 bytes src/fenrir-package/bin.dmp | 1 + src/fenrir-package/consumeEvents.py | 40 ++++++++++++++ src/fenrir-package/core/settings.py | 2 + tools/configure_pulse.sh | 73 +++++++++++++++++++++++++ tools/traceEvdev.py | 1 + 11 files changed, 197 insertions(+) create mode 100644 config/settings/settings.conf.chrys create mode 100644 config/settings/settings.conf.orig delete mode 100644 config/sound/default/promotedtext.opus create mode 100644 src/fenrir-package/bin.dmp create mode 100644 src/fenrir-package/consumeEvents.py create mode 100755 tools/configure_pulse.sh mode change 100644 => 100755 tools/traceEvdev.py diff --git a/TODO b/TODO index b998743e..cb11b195 100644 --- a/TODO +++ b/TODO @@ -23,6 +23,7 @@ ToDos in Priority order: - implement onScreenChange commands read highlighted text mode window mode (define a area and just read that changes) + promoted text - autostart systemd - implement braille diff --git a/config/keyboard/desktop.conf b/config/keyboard/desktop.conf index 17797911..2a67d71f 100644 --- a/config/keyboard/desktop.conf +++ b/config/keyboard/desktop.conf @@ -1,3 +1,4 @@ +1-KEY_KP0=fenrirKey 1-KEY_LEFTCTRL=shut_up 1-KEY_RIGHTCTRL=shut_up 1-KEY_KP8=curr_line diff --git a/config/settings/settings.conf b/config/settings/settings.conf index af20a6cf..0ea208d0 100644 --- a/config/settings/settings.conf +++ b/config/settings/settings.conf @@ -25,6 +25,8 @@ screenUpdateDelay=0.4 [keyboard] device=all +grabDevices=True +ignoreShortcuts=False keyboardLayout=desktop charEcho=False charDeleteEcho=True diff --git a/config/settings/settings.conf.chrys b/config/settings/settings.conf.chrys new file mode 100644 index 00000000..1b374c0c --- /dev/null +++ b/config/settings/settings.conf.chrys @@ -0,0 +1,38 @@ +[sound] +enabled=True +driver=sox +theme=default +volume=1.0 + +[speech] +enabled=True +driver=speechd +rate=0.75 +pitch=0.5 +volume=1.0 +module=espeak +voice=de +language=de +autoReadIncomming=True + +[braille] +enabled=False +layout=en + +[screen] +driver=linux +screenUpdateDelay=0.4 + +[keyboard] +device=all +grabDevices=True +ignoreShortcuts=False +keyboardLayout=desktop +charEcho=True +charDeleteEcho=True +wordEcho=True +interruptOnKeyPress=False + +[general] +debugLevel=0 +punctuationLevel=1 diff --git a/config/settings/settings.conf.orig b/config/settings/settings.conf.orig new file mode 100644 index 00000000..73c6169e --- /dev/null +++ b/config/settings/settings.conf.orig @@ -0,0 +1,38 @@ +[sound] +enabled=True +driver=sox +theme=default +volume=1.0 + +[speech] +enabled=True +driver=espeak +rate=0.75 +pitch=0.5 +module=espeak +voice=en-us +language=en-us +volume=1.0 +autoReadIncomming=True + +[braille] +enabled=False +layout=en + +[screen] +driver=linux +screenUpdateDelay=0.4 + +[keyboard] +device=all +grabDevices=True +ignoreShortcuts=False +keyboardLayout=desktop +charEcho=False +charDeleteEcho=True +wordEcho=False +interruptOnKeyPress=False + +[general] +debugLevel=0 +punctuationLevel=1 diff --git a/config/sound/default/promotedtext.opus b/config/sound/default/promotedtext.opus deleted file mode 100644 index d4b4b34f1fa5283f0c6a0a223eee30ab19276be1..0000000000000000000000000000000000000000 GIT binary patch literal 0 HcmV?d00001 literal 1229 zcmeZIPY-5bVt|7DS94-P%%Zo8W-to-7nBxzq$Z{?GFmV;>;{Q5fR%$;AOfVEk%581 zKh4&f`TzfaAPpgj>BUkE3=BD$N%;k(#R`UchI+=jhK829>82@(1}2sk%nS?+stgPa zu71w`F0MhgAZ4j}$qH#j`MC-pj&4bQeonE1fu5nBr3^x0ynjH5r@vpYt*&lTW=Ti>J~r12Z4`*vlU>RE zPbAT&;?wlf>G!$)8BgmAbENK!TkrF#^G@2Et!uTli@N+Z>w_w`$e!d42wONa(`3h% zHy0iS{>WIHdz|Uch67yPYMzg4IFE}<$c64oto3>KtM>ki>Ed|_0j38y_BN#}g)w!` z>}WeJu(x9Om-pgXi)J5{ley4);^fR1r4xIfyeTczH=Z $xdgPath/pulse/default.pa +echo "If you have not yet done so, please run this script as root to write the client.conf file." +else +# This section does the root part: +xdgPath="/root/.config" +mkdir -p "$xdgPath/pulse" + +# Warn user if we are going to overwrite an existing default.pa +if [ -f "$xdgPath/pulse/default.pa" ]; then + read -p "This will replace the current file located at $xdgPath/pulse/default.pa, press enter to continue or control+c to abort. " continue +fi + +cat << EOF > "$xdgPath/pulse/client.conf" +# This file is part of PulseAudio. +# +# PulseAudio is free software; you can redistribute it and/or modify +# it under the terms of the GNU Lesser General Public License as published by +# the Free Software Foundation; either version 2 of the License, or +# (at your option) any later version. +# +# PulseAudio is distributed in the hope that it will be useful, but +# WITHOUT ANY WARRANTY; without even the implied warranty of +# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU +# General Public License for more details. +# +# You should have received a copy of the GNU Lesser General Public License +# along with PulseAudio; if not, see . + +## Configuration file for PulseAudio clients. See pulse-client.conf(5) for +## more information. Default values are commented out. Use either ; or # for +## commenting. + +; default-sink = +; default-source = +default-server = unix:/tmp/pulse.sock +; default-dbus-server = + +autospawn = no +; autospawn = yes +; daemon-binary = /usr/bin/pulseaudio +; extra-arguments = --log-target=syslog + +; cookie-file = + +; enable-shm = yes +; shm-size-bytes = 0 # setting this 0 will use the system-default, usually 64 MiB + +; auto-connect-localhost = no +; auto-connect-display = no +EOF +echo "If you have not yet done so, run this script as your normal user to write the user default.pa" +fi + +# If there were no errors tell user to restart, else warn them errors happened. +if [ $? -eq 0 ]; then +echo "Configuration created succeswsfully, restart pulse, or your system, for changes to take affect." +else +echo "Errors were encountered while writing the configuration. please correct them manually." +fi +exit 0 diff --git a/tools/traceEvdev.py b/tools/traceEvdev.py old mode 100644 new mode 100755 index 2d921904..434190d2 --- a/tools/traceEvdev.py +++ b/tools/traceEvdev.py @@ -1,3 +1,4 @@ +#!/bin/python import evdev from evdev import InputDevice from select import select