respect device setting for keyboard values are AUTO, ALL, and a device name

This commit is contained in:
chrys 2016-10-01 03:06:16 +02:00
parent dc6a635e1f
commit ee24881169
4 changed files with 23 additions and 14 deletions

View File

@ -58,7 +58,7 @@ voice=
language=english-us
# Read new text as it happens?
autoReadIncomming=True
autoReadIncoming=True
[braille]
#braille is not implemented yet
@ -70,22 +70,23 @@ driver=linux
encoding=cp850
screenUpdateDelay=0.4
suspendingScreen=
autodetectSuspendingScreen=False
autodetectSuspendingScreen=True
[keyboard]
driver=evdev
device=all
# filter input devices AUTO, ALL or a DEVICE NAME
device=AUTO
# gives fenrir exclusive access to the keyboard and let consume keystrokes. just disable on problems.
grabDevices=True
ignoreShortcuts=False
# the current shortcut layout located in /etc/fenrir/keyboard
keyboardLayout=test
keyboardLayout=desktop
# echo chars while typing.
charEcho=True
charEcho=False
# echo deleted chars
charDeleteEcho=True
# echo word after pressing space
wordEcho=True
wordEcho=False
# interrupt speech on any keypress
interruptOnKeyPress=False
# timeout for double tap in sec
@ -96,7 +97,7 @@ debugLevel=0
punctuationLevel=Some
numberOfClipboards=10
# define the current fenrir key
fenrirKeys=KEY_KP0
fenrirKeys=KEY_KP0,KEY_META
timeFormat=%H:%M:%P
dateFormat=%A, %B %d, %Y
autoSpellCheck=True

View File

@ -72,7 +72,8 @@ autodetectSuspendingScreen=True
[keyboard]
driver=evdev
device=all
# filter input devices AUTO, ALL or a DEVICE NAME
device=AUTO
# gives fenrir exclusive access to the keyboard and let consume keystrokes. just disable on problems.
grabDevices=True
ignoreShortcuts=False

View File

@ -31,7 +31,8 @@ autodetectSuspendingScreen=False
[keyboard]
driver=evdev
device=all
# filter input devices AUTO, ALL or a DEVICE NAME
device=AUTO
grabDevices=True
ignoreShortcuts=False
keyboardLayout=desktop

View File

@ -60,10 +60,16 @@ class driver():
# 1 Keys
# we try to filter out mices and other stuff here
self.iDevices = map(evdev.InputDevice, (evdev.list_devices()))
self.iDevices = {dev.fd: dev for dev in self.iDevices if 1 in dev.capabilities() and not 3 in dev.capabilities() and not 2 in dev.capabilities()}
#self.iDevices = {dev.fd: dev for dev in self.iDevices if 1 in dev.capabilities()}
self.ledDevices = map(evdev.InputDevice, (evdev.list_devices()))
if self.env['runtime']['settingsManager'].getSetting('keyboard', 'device').upper() == 'ALL':
self.iDevices = {dev.fd: dev for dev in self.iDevices if 1 in dev.capabilities()}
self.ledDevices = {dev.fd: dev for dev in self.ledDevices if 1 in dev.capabilities() and 17 in dev.capabilities()}
elif self.env['runtime']['settingsManager'].getSetting('keyboard', 'device').upper() == 'AUTO':
self.iDevices = {dev.fd: dev for dev in self.iDevices if 1 in dev.capabilities() and not 3 in dev.capabilities() and not 2 in dev.capabilities()}
self.ledDevices = {dev.fd: dev for dev in self.ledDevices if 1 in dev.capabilities() and 17 in dev.capabilities() and not 3 in dev.capabilities() and not 2 in dev.capabilities()}
else:
self.iDevices = {dev.fd: dev for dev in self.iDevices if dev.name.upper() in self.env['runtime']['settingsManager'].getSetting('keyboard', 'device').upper()}
self.ledDevices = {dev.fd: dev for dev in self.ledDevices if dev.name.upper() in self.env['runtime']['settingsManager'].getSetting('keyboard', 'device').upper()}
def mapEvent(self, event):
if not event: