prepare keyboard grab

This commit is contained in:
chrys committed 2016-08-10 02:09:49 +02:00
1 parent 03d8dcd751
commit 6eceeee07b
11 files changed
+197

No files matched your search

+1
View File
@@ -23,6 +23,7 @@ ToDos in Priority order:
- implement onScreenChange commands - implement onScreenChange commands
read highlighted text mode read highlighted text mode
window mode (define a area and just read that changes) window mode (define a area and just read that changes)
promoted text
- autostart systemd - autostart systemd
- implement braille - implement braille
+1
View File
@@ -1,3 +1,4 @@
1-KEY_KP0=fenrirKey
1-KEY_LEFTCTRL=shut_up 1-KEY_LEFTCTRL=shut_up
1-KEY_RIGHTCTRL=shut_up 1-KEY_RIGHTCTRL=shut_up
1-KEY_KP8=curr_line 1-KEY_KP8=curr_line
+2
View File
@@ -25,6 +25,8 @@ screenUpdateDelay=0.4
[keyboard] [keyboard]
device=all device=all
grabDevices=True
ignoreShortcuts=False
keyboardLayout=desktop keyboardLayout=desktop
charEcho=False charEcho=False
charDeleteEcho=True charDeleteEcho=True
+38
View File
@@ -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
+38
View File
@@ -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
Binary file not shown.
+1
View File
@@ -0,0 +1 @@
asdf das ist ein teest wie geht es ddidasddr das istdasdasdas ist ein tese t wie geht es dir denn so ddddd das dddddddddddd das wie geeht es dir denn sdolol das issst ein test das ist das ist ein e hallo du chrys das ist ein das ist das ist ein test das ist das ist ein test iha lol wie geht es dir das ist ein test lol mir geht es ggut das ist das ist ein test lol das ist ein test das ist ein hallo wie geht es dir den so das ist ein test das ist das ist ein test mir geht es guti mir geht es sau guti wie geht es dir das ist ein wie geht es dir das ist ein ete das ist ein s das t ein test wie geht es dir den so das test wie geht es dir denn so? dasi ist eis ist ein Line truncated
+40
View File
@@ -0,0 +1,40 @@
#!/bin/python
import evdev
from evdev import InputDevice, UInput
from select import select
import time
iDevices = map(evdev.InputDevice, (evdev.list_devices()))
iDevices = {dev.fd: dev for dev in iDevices if dev.fn in ['/dev/input/event18']}
uDevices = {}
for fd in iDevices:
dev = iDevices[fd]
uDevices[fd] = UInput()
dev.grab()
# dev.capabilities(),
# dev.name,
# dev.info.vendor,
# dev.info.product,
# dev.version,
# dev.info.bustype,
# '/dev/uinput'
# )
i = 0
while i < 10:
r, w, x = select(iDevices, [], [])
if r != []:
i += 1
for fd in r:
for event in iDevices[fd].read():
if event.code != 30:
uDevices[fd].write_event(event)
uDevices[fd].syn()
#print('Devicename:'+ devices[fd].name + ' Devicepath:' + devices[fd].fn + ' Events:' + str(devices[fd].active_keys(verbose=True)) + ' Value:' + str(event.value))
for fd in iDevices:
iDevices[fd].ungrab()
+2
View File
@@ -35,6 +35,8 @@ settings = {
}, },
'keyboard':{ 'keyboard':{
'device':"all", 'device':"all",
'grabDevices':True,
'ignoreShortcuts':False,
'keyboardLayout': "desktop", 'keyboardLayout': "desktop",
'charEcho':False, 'charEcho':False,
'charDeleteEcho':True, 'charDeleteEcho':True,
+73
View File
@@ -0,0 +1,73 @@
#!/bin/bash
# This script configures pulse to work both in the graphical invironment and in the console with root apps.
if [[ $(whoami) != "root" ]]; then
# Get the current user's XDG_HOME
xdgPath="${XDG_CONFIG_HOME:-$HOME/.config}"
# 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
echo '.include /etc/pulse/default.pa
load-module module-native-protocol-unix auth-anonymous=1 socket=/tmp/pulse.sock' > $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 <http://www.gnu.org/licenses/>.
## 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
Regular → Executable
+1
View File
@@ -1,3 +1,4 @@
#!/bin/python
import evdev import evdev
from evdev import InputDevice from evdev import InputDevice
from select import select from select import select