Compare commits

..

No commits in common. "master" and "2024.12.20" have entirely different histories.

16 changed files with 308 additions and 411 deletions

View File

@ -46,33 +46,28 @@ _:===:Lienie unten
[customDict] [customDict]
[emoticonDict] [emoticonDict]
regex;(?:^|\s)(?::-\)|:\))(?:\s|$):===:smile # This dictionary uses regexp when prefixed with "regex;", so be sure to escape anything that would be parsed by regexp, e.g. *, ., ^, $, etc.
regex;(?:^|\s)(?::-\(|:\()(?:\s|$):===:frown regex;[\s*|'|"][\s*|'|"]<{-.-}>:===:Raves
regex;(?:^|\s)(?::-D|:D)(?:\s|$):===:big grin regex;[\s*|'|"][\s*|'|"]8-\):===:smile with sunglasses
regex;(?:^|\s)(?:;-\)|;\))(?:\s|$):===:wink regex;[\s*|'|"][\s*|'|"]:-/:===:confused
regex;(?:^|\s)(?::-P|:P)(?:\s|$):===:tongue out regex;[\s*|'|"][\s*|'|"]-\.-:===:bugged
regex;(?:^|\s)(?::-O|:O)(?:\s|$):===:surprised regex;[\s*|'|"][\s*|'|"]>\.<:===:laughing
regex;(?:^|\s)(?::-/|:/)(?:\s|$):===:skeptical regex;[\s*|'|"][\s*|'|"]8-X:===:skull
regex;(?:^|\s)(?:>:-\(|>:\()(?:\s|$):===:angry regex;[\s*|'|"][\s*|'|"]>:\):===:evil smile
regex;(?:^|\s)(?::'\(|:'-\()(?:\s|$):===:crying regex;[\s*|'|"][\s*|'|"]>:-\):===:evil smile
regex;(?:^|\s)(?::-\||:\|)(?:\s|$):===:neutral regex;[\s*|'|"][\s*|'|"]\\o/:===:Hurray
regex;(?:^|\s)(?:8-\)|B-\))(?:\s|$):===:cool regex;[\s*|'|"][\s*|'|"]:/:===:confused
regex;(?:^|\s)8-X(?:\s|$):===:skull and crossbones regex;[\s*|'|"][\s*|'|"]8\):===:smile with sunglasses
regex;(?:^|\s)(?:X-X|x-x)(?:\s|$):===:knocked out regex;[\s*|'|"]:D[\s*|'|"]:===:laugh
regex;(?:^|\s)(?::-X|:-x|:X|:x)(?:\s|$):===:lips sealed regex;[\s*|'|"];\)[\s*|'|"]:===:wink
regex;(?:^|\s)XD(?:\s|$):===:laughing hard regex;[\s*|'|"]XD[\s*|'|"]:===:LOL
regex;(?:^|\s)\^_\^(?:\s|$):===:happy regex;[\s*|'|"]:-\)[\s*|'|"]:===:smile
regex;(?:^|\s)-_-(?:\s|$):===:annoyed regex;[\s*|'|"]:\)[\s*|'|"]:===:smile
regex;(?:^|\s)o_O(?:\s|$):===:confused regex;[\s*|'|"]->[\s*|'|"]:===:arrow right
regex;(?:^|\s)>_<(?:\s|$):===:frustrated # example for arrow left
regex;(?:^|\s)\\o/(?:\s|$):===:hurray #(?:[ |^])(<-)(?:[ ,.!?$]):===:arrow left
regex;(?:^|\s)<3(?:\s|$):===:heart # or
regex;(?:^|\s)</3(?:\s|$):===:broken heart #([ |^])<-([ ,.!?$]):===:arrow left\2
regex;(?:^|\s)(?:Oo|oO)(?:\s|$):===:WTF? regex;[\s*|'|"]<-[\s*|'|"]:===:arrow left
regex;(?:^|\s)<{-.-}>(?:\s|$):===:Raves regex;[\s*|'|"][O|o][O|o][\s*|'|"]:===:WTF?
regex;(?:^|\s)-\.-(?:\s|$):===:bugged regex;[\s*|'|"]\^\^[\s*|'|"]:===:enjoy smile
regex;(?:^|\s)>\.<(?:\s|$):===:laughing
regex;(?:^|\s)(?:>:\)|>:-\))(?:\s|$):===:evil smile
regex;(?:^|\s)\^\^(?:\s|$):===:enjoy smile
regex;(?:^|\s)->(?:\s|$):===:arrow right
regex;(?:^|\s)<-(?:\s|$):===:arrow left

View File

@ -46,33 +46,27 @@ _:===:line
[customDict] [customDict]
[emoticonDict] [emoticonDict]
regex;(?:^|\s)(?::-\)|:\))(?:\s|$):===:smile # This dictionary uses regexp when prefixed with "regex;", so be sure to escape anything that would be parsed by regexp, e.g. *, ., ^, $, etc.
regex;(?:^|\s)(?::-\(|:\()(?:\s|$):===:frown regex;[\s*|'|"][\s*|'|"]<{-.-}>:===:Raves
regex;(?:^|\s)(?::-D|:D)(?:\s|$):===:big grin regex;[\s*|'|"][\s*|'|"]8-\):===:smile with sunglasses
regex;(?:^|\s)(?:;-\)|;\))(?:\s|$):===:wink regex;[\s*|'|"][\s*|'|"]:-/:===:confused
regex;(?:^|\s)(?::-P|:P)(?:\s|$):===:tongue out regex;[\s*|'|"][\s*|'|"]-\.-:===:bugged
regex;(?:^|\s)(?::-O|:O)(?:\s|$):===:surprised regex;[\s*|'|"][\s*|'|"]>\.<:===:laughing
regex;(?:^|\s)(?::-/|:/)(?:\s|$):===:skeptical regex;[\s*|'|"][\s*|'|"]8-X:===:skull
regex;(?:^|\s)(?:>:-\(|>:\()(?:\s|$):===:angry regex;[\s*|'|"][\s*|'|"]>:\):===:evil smile
regex;(?:^|\s)(?::'\(|:'-\()(?:\s|$):===:crying regex;[\s*|'|"][\s*|'|"]>:-\):===:evil smile
regex;(?:^|\s)(?::-\||:\|)(?:\s|$):===:neutral regex;[\s*|'|"][\s*|'|"]\\o/:===:Hurray
regex;(?:^|\s)(?:8-\)|B-\))(?:\s|$):===:cool regex;[\s*|'|"][\s*|'|"]:/:===:confused
regex;(?:^|\s)8-X(?:\s|$):===:skull and crossbones regex;[\s*|'|"]:D[\s*|'|"]:===:laugh
regex;(?:^|\s)(?:X-X|x-x)(?:\s|$):===:knocked out regex;[\s*|'|"];\)[\s*|'|"]:===:wink
regex;(?:^|\s)(?::-X|:-x|:X|:x)(?:\s|$):===:lips sealed regex;[\s*|'|"]XD[\s*|'|"]:===:LOL
regex;(?:^|\s)XD(?:\s|$):===:laughing hard regex;[\s*|'|"]:-\)[\s*|'|"]:===:smile
regex;(?:^|\s)\^_\^(?:\s|$):===:happy regex;[\s*|'|"]:\)[\s*|'|"]:===:smile
regex;(?:^|\s)-_-(?:\s|$):===:annoyed regex;[\s*|'|"]->[\s*|'|"]:===:arrow right
regex;(?:^|\s)o_O(?:\s|$):===:confused # example for arrow left
regex;(?:^|\s)>_<(?:\s|$):===:frustrated #(?:[ |^])(<-)(?:[ ,.!?$]):===:arrow left
regex;(?:^|\s)\\o/(?:\s|$):===:hurray # or
regex;(?:^|\s)<3(?:\s|$):===:heart #([ |^])<-([ ,.!?$]):===:arrow left\2
regex;(?:^|\s)</3(?:\s|$):===:broken heart regex;[\s*|'|"]<-[\s*|'|"]:===:arrow left
regex;(?:^|\s)(?:Oo|oO)(?:\s|$):===:WTF? regex;[\s+|'|"](Oo)|(oO)[\s+|'|"]:===:WTF?
regex;(?:^|\s)<{-.-}>(?:\s|$):===:Raves regex;[\s*|'|"]\^\^[\s*|'|"]:===:enjoy smile
regex;(?:^|\s)-\.-(?:\s|$):===:bugged
regex;(?:^|\s)>\.<(?:\s|$):===:laughing
regex;(?:^|\s)(?:>:\)|>:-\))(?:\s|$):===:evil smile
regex;(?:^|\s)\^\^(?:\s|$):===:enjoy smile
regex;(?:^|\s)->(?:\s|$):===:arrow right
regex;(?:^|\s)<-(?:\s|$):===:arrow left

View File

@ -46,33 +46,27 @@ _:===:line
[customDict] [customDict]
[emoticonDict] [emoticonDict]
regex;(?:^|\s)(?::-\)|:\))(?:\s|$):===:smile # This dictionary uses regexp when prefixed with "regex;", so be sure to escape anything that would be parsed by regexp, e.g. *, ., ^, $, etc.
regex;(?:^|\s)(?::-\(|:\()(?:\s|$):===:frown regex;[\s*|'|"][\s*|'|"]<{-.-}>:===:Raves
regex;(?:^|\s)(?::-D|:D)(?:\s|$):===:big grin regex;[\s*|'|"][\s*|'|"]8-\):===:smile with sunglasses
regex;(?:^|\s)(?:;-\)|;\))(?:\s|$):===:wink regex;[\s*|'|"][\s*|'|"]:-/:===:confused
regex;(?:^|\s)(?::-P|:P)(?:\s|$):===:tongue out regex;[\s*|'|"][\s*|'|"]-\.-:===:bugged
regex;(?:^|\s)(?::-O|:O)(?:\s|$):===:surprised regex;[\s*|'|"][\s*|'|"]>\.<:===:laughing
regex;(?:^|\s)(?::-/|:/)(?:\s|$):===:skeptical regex;[\s*|'|"][\s*|'|"]8-X:===:skull
regex;(?:^|\s)(?:>:-\(|>:\()(?:\s|$):===:angry regex;[\s*|'|"][\s*|'|"]>:\):===:evil smile
regex;(?:^|\s)(?::'\(|:'-\()(?:\s|$):===:crying regex;[\s*|'|"][\s*|'|"]>:-\):===:evil smile
regex;(?:^|\s)(?::-\||:\|)(?:\s|$):===:neutral regex;[\s*|'|"][\s*|'|"]\\o/:===:Hurray
regex;(?:^|\s)(?:8-\)|B-\))(?:\s|$):===:cool regex;[\s*|'|"][\s*|'|"]:/:===:confused
regex;(?:^|\s)8-X(?:\s|$):===:skull and crossbones regex;[\s*|'|"]:D[\s*|'|"]:===:laugh
regex;(?:^|\s)(?:X-X|x-x)(?:\s|$):===:knocked out regex;[\s*|'|"];\)[\s*|'|"]:===:wink
regex;(?:^|\s)(?::-X|:-x|:X|:x)(?:\s|$):===:lips sealed regex;[\s*|'|"]XD[\s*|'|"]:===:LOL
regex;(?:^|\s)XD(?:\s|$):===:laughing hard regex;[\s*|'|"]:-\)[\s*|'|"]:===:smile
regex;(?:^|\s)\^_\^(?:\s|$):===:happy regex;[\s*|'|"]:\)[\s*|'|"]:===:smile
regex;(?:^|\s)-_-(?:\s|$):===:annoyed regex;[\s*|'|"]->[\s*|'|"]:===:arrow right
regex;(?:^|\s)o_O(?:\s|$):===:confused # example for arrow left
regex;(?:^|\s)>_<(?:\s|$):===:frustrated #(?:[ |^])(<-)(?:[ ,.!?$]):===:arrow left
regex;(?:^|\s)\\o/(?:\s|$):===:hurray # or
regex;(?:^|\s)<3(?:\s|$):===:heart #([ |^])<-([ ,.!?$]):===:arrow left\2
regex;(?:^|\s)</3(?:\s|$):===:broken heart regex;[\s*|'|"]<-[\s*|'|"]:===:arrow left
regex;(?:^|\s)(?:Oo|oO)(?:\s|$):===:WTF? regex;[\s+|'|"][O|o][O|o][\s+|'|"]:===:WTF?
regex;(?:^|\s)<{-.-}>(?:\s|$):===:Raves regex;[\s*|'|"]\^\^[\s*|'|"]:===:enjoy smile
regex;(?:^|\s)-\.-(?:\s|$):===:bugged
regex;(?:^|\s)>\.<(?:\s|$):===:laughing
regex;(?:^|\s)(?:>:\)|>:-\))(?:\s|$):===:evil smile
regex;(?:^|\s)\^\^(?:\s|$):===:enjoy smile
regex;(?:^|\s)->(?:\s|$):===:arrow right
regex;(?:^|\s)<-(?:\s|$):===:arrow left

View File

@ -46,33 +46,28 @@ _:===:subrayado
[customDict] [customDict]
[emoticonDict] [emoticonDict]
regex;(?:^|\s)(?::-\)|:\))(?:\s|$):===:smile # This dictionary uses regexp when prefixed with "regex;", so be sure to escape anything that would be parsed by regexp, e.g. *, ., ^, $, etc.
regex;(?:^|\s)(?::-\(|:\()(?:\s|$):===:frown regex;[\s*|'|"][\s*|'|"]<{-.-}>:===:Raves
regex;(?:^|\s)(?::-D|:D)(?:\s|$):===:big grin regex;[\s*|'|"][\s*|'|"]8-\):===:smile with sunglasses
regex;(?:^|\s)(?:;-\)|;\))(?:\s|$):===:wink regex;[\s*|'|"][\s*|'|"]:-/:===:confused
regex;(?:^|\s)(?::-P|:P)(?:\s|$):===:tongue out regex;[\s*|'|"][\s*|'|"]-\.-:===:bugged
regex;(?:^|\s)(?::-O|:O)(?:\s|$):===:surprised regex;[\s*|'|"][\s*|'|"]>\.<:===:laughing
regex;(?:^|\s)(?::-/|:/)(?:\s|$):===:skeptical regex;[\s*|'|"][\s*|'|"]8-X:===:skull
regex;(?:^|\s)(?:>:-\(|>:\()(?:\s|$):===:angry regex;[\s*|'|"][\s*|'|"]>:\):===:evil smile
regex;(?:^|\s)(?::'\(|:'-\()(?:\s|$):===:crying regex;[\s*|'|"][\s*|'|"]>:-\):===:evil smile
regex;(?:^|\s)(?::-\||:\|)(?:\s|$):===:neutral regex;[\s*|'|"][\s*|'|"]\\o/:===:Hurray
regex;(?:^|\s)(?:8-\)|B-\))(?:\s|$):===:cool regex;[\s*|'|"][\s*|'|"]:/:===:confused
regex;(?:^|\s)8-X(?:\s|$):===:skull and crossbones regex;[\s*|'|"][\s*|'|"]8\):===:smile with sunglasses
regex;(?:^|\s)(?:X-X|x-x)(?:\s|$):===:knocked out regex;[\s*|'|"]:D[\s*|'|"]:===:laugh
regex;(?:^|\s)(?::-X|:-x|:X|:x)(?:\s|$):===:lips sealed regex;[\s*|'|"];\)[\s*|'|"]:===:wink
regex;(?:^|\s)XD(?:\s|$):===:laughing hard regex;[\s*|'|"]XD[\s*|'|"]:===:LOL
regex;(?:^|\s)\^_\^(?:\s|$):===:happy regex;[\s*|'|"]:-\)[\s*|'|"]:===:smile
regex;(?:^|\s)-_-(?:\s|$):===:annoyed regex;[\s*|'|"]:\)[\s*|'|"]:===:smile
regex;(?:^|\s)o_O(?:\s|$):===:confused regex;[\s*|'|"]->[\s*|'|"]:===:arrow right
regex;(?:^|\s)>_<(?:\s|$):===:frustrated # example for arrow left
regex;(?:^|\s)\\o/(?:\s|$):===:hurray #(?:[ |^])(<-)(?:[ ,.!?$]):===:arrow left
regex;(?:^|\s)<3(?:\s|$):===:heart # or
regex;(?:^|\s)</3(?:\s|$):===:broken heart #([ |^])<-([ ,.!?$]):===:arrow left\2
regex;(?:^|\s)(?:Oo|oO)(?:\s|$):===:WTF? regex;[\s*|'|"]<-[\s*|'|"]:===:arrow left
regex;(?:^|\s)<{-.-}>(?:\s|$):===:Raves regex;[\s*|'|"][O|o][O|o][\s*|'|"]:===:WTF?
regex;(?:^|\s)-\.-(?:\s|$):===:bugged regex;[\s*|'|"]\^\^[\s*|'|"]:===:enjoy smile
regex;(?:^|\s)>\.<(?:\s|$):===:laughing
regex;(?:^|\s)(?:>:\)|>:-\))(?:\s|$):===:evil smile
regex;(?:^|\s)\^\^(?:\s|$):===:enjoy smile
regex;(?:^|\s)->(?:\s|$):===:arrow right
regex;(?:^|\s)<-(?:\s|$):===:arrow left

View File

@ -46,33 +46,28 @@ _:===:souligné
[customDict] [customDict]
[emoticonDict] [emoticonDict]
regex;(?:^|\s)(?::-\)|:\))(?:\s|$):===:smile # This dictionary uses regexp when prefixed with "regex;", so be sure to escape anything that would be parsed by regexp, e.g. *, ., ^, $, etc.
regex;(?:^|\s)(?::-\(|:\()(?:\s|$):===:frown regex;[\s*|'|"][\s*|'|"]<{-.-}>:===:Raves
regex;(?:^|\s)(?::-D|:D)(?:\s|$):===:big grin regex;[\s*|'|"][\s*|'|"]8-\):===:smile with sunglasses
regex;(?:^|\s)(?:;-\)|;\))(?:\s|$):===:wink regex;[\s*|'|"][\s*|'|"]:-/:===:confused
regex;(?:^|\s)(?::-P|:P)(?:\s|$):===:tongue out regex;[\s*|'|"][\s*|'|"]-\.-:===:bugged
regex;(?:^|\s)(?::-O|:O)(?:\s|$):===:surprised regex;[\s*|'|"][\s*|'|"]>\.<:===:laughing
regex;(?:^|\s)(?::-/|:/)(?:\s|$):===:skeptical regex;[\s*|'|"][\s*|'|"]8-X:===:skull
regex;(?:^|\s)(?:>:-\(|>:\()(?:\s|$):===:angry regex;[\s*|'|"][\s*|'|"]>:\):===:evil smile
regex;(?:^|\s)(?::'\(|:'-\()(?:\s|$):===:crying regex;[\s*|'|"][\s*|'|"]>:-\):===:evil smile
regex;(?:^|\s)(?::-\||:\|)(?:\s|$):===:neutral regex;[\s*|'|"][\s*|'|"]\\o/:===:Hurray
regex;(?:^|\s)(?:8-\)|B-\))(?:\s|$):===:cool regex;[\s*|'|"][\s*|'|"]:/:===:confused
regex;(?:^|\s)8-X(?:\s|$):===:skull and crossbones regex;[\s*|'|"][\s*|'|"]8\):===:smile with sunglasses
regex;(?:^|\s)(?:X-X|x-x)(?:\s|$):===:knocked out regex;[\s*|'|"]:D[\s*|'|"]:===:laugh
regex;(?:^|\s)(?::-X|:-x|:X|:x)(?:\s|$):===:lips sealed regex;[\s*|'|"];\)[\s*|'|"]:===:wink
regex;(?:^|\s)XD(?:\s|$):===:laughing hard regex;[\s*|'|"]XD[\s*|'|"]:===:LOL
regex;(?:^|\s)\^_\^(?:\s|$):===:happy regex;[\s*|'|"]:-\)[\s*|'|"]:===:smile
regex;(?:^|\s)-_-(?:\s|$):===:annoyed regex;[\s*|'|"]:\)[\s*|'|"]:===:smile
regex;(?:^|\s)o_O(?:\s|$):===:confused regex;[\s*|'|"]->[\s*|'|"]:===:arrow right
regex;(?:^|\s)>_<(?:\s|$):===:frustrated # example for arrow left
regex;(?:^|\s)\\o/(?:\s|$):===:hurray #(?:[ |^])(<-)(?:[ ,.!?$]):===:arrow left
regex;(?:^|\s)<3(?:\s|$):===:heart # or
regex;(?:^|\s)</3(?:\s|$):===:broken heart #([ |^])<-([ ,.!?$]):===:arrow left\2
regex;(?:^|\s)(?:Oo|oO)(?:\s|$):===:WTF? regex;[\s*|'|"]<-[\s*|'|"]:===:arrow left
regex;(?:^|\s)<{-.-}>(?:\s|$):===:Raves regex;[\s*|'|"][O|o][O|o][\s*|'|"]:===:WTF?
regex;(?:^|\s)-\.-(?:\s|$):===:bugged regex;[\s*|'|"]\^\^[\s*|'|"]:===:enjoy smile
regex;(?:^|\s)>\.<(?:\s|$):===:laughing
regex;(?:^|\s)(?:>:\)|>:-\))(?:\s|$):===:evil smile
regex;(?:^|\s)\^\^(?:\s|$):===:enjoy smile
regex;(?:^|\s)->(?:\s|$):===:arrow right
regex;(?:^|\s)<-(?:\s|$):===:arrow left

View File

@ -46,33 +46,28 @@ _:===:podkreślnik
[customDict] [customDict]
[emoticonDict] [emoticonDict]
regex;(?:^|\s)(?::-\)|:\))(?:\s|$):===:smile # This dictionary uses regexp when prefixed with "regex;", so be sure to escape anything that would be parsed by regexp, e.g. *, ., ^, $, etc.
regex;(?:^|\s)(?::-\(|:\()(?:\s|$):===:frown regex;[\s*|'|"][\s*|'|"]<{-.-}>:===:Raves
regex;(?:^|\s)(?::-D|:D)(?:\s|$):===:big grin regex;[\s*|'|"][\s*|'|"]8-\):===:smile with sunglasses
regex;(?:^|\s)(?:;-\)|;\))(?:\s|$):===:wink regex;[\s*|'|"][\s*|'|"]:-/:===:confused
regex;(?:^|\s)(?::-P|:P)(?:\s|$):===:tongue out regex;[\s*|'|"][\s*|'|"]-\.-:===:bugged
regex;(?:^|\s)(?::-O|:O)(?:\s|$):===:surprised regex;[\s*|'|"][\s*|'|"]>\.<:===:laughing
regex;(?:^|\s)(?::-/|:/)(?:\s|$):===:skeptical regex;[\s*|'|"][\s*|'|"]8-X:===:skull
regex;(?:^|\s)(?:>:-\(|>:\()(?:\s|$):===:angry regex;[\s*|'|"][\s*|'|"]>:\):===:evil smile
regex;(?:^|\s)(?::'\(|:'-\()(?:\s|$):===:crying regex;[\s*|'|"][\s*|'|"]>:-\):===:evil smile
regex;(?:^|\s)(?::-\||:\|)(?:\s|$):===:neutral regex;[\s*|'|"][\s*|'|"]\\o/:===:Hurray
regex;(?:^|\s)(?:8-\)|B-\))(?:\s|$):===:cool regex;[\s*|'|"][\s*|'|"]:/:===:confused
regex;(?:^|\s)8-X(?:\s|$):===:skull and crossbones regex;[\s*|'|"][\s*|'|"]8\):===:smile with sunglasses
regex;(?:^|\s)(?:X-X|x-x)(?:\s|$):===:knocked out regex;[\s*|'|"]:D[\s*|'|"]:===:laugh
regex;(?:^|\s)(?::-X|:-x|:X|:x)(?:\s|$):===:lips sealed regex;[\s*|'|"];\)[\s*|'|"]:===:wink
regex;(?:^|\s)XD(?:\s|$):===:laughing hard regex;[\s*|'|"]XD[\s*|'|"]:===:LOL
regex;(?:^|\s)\^_\^(?:\s|$):===:happy regex;[\s*|'|"]:-\)[\s*|'|"]:===:smile
regex;(?:^|\s)-_-(?:\s|$):===:annoyed regex;[\s*|'|"]:\)[\s*|'|"]:===:smile
regex;(?:^|\s)o_O(?:\s|$):===:confused regex;[\s*|'|"]->[\s*|'|"]:===:arrow right
regex;(?:^|\s)>_<(?:\s|$):===:frustrated # example for arrow left
regex;(?:^|\s)\\o/(?:\s|$):===:hurray #(?:[ |^])(<-)(?:[ ,.!?$]):===:arrow left
regex;(?:^|\s)<3(?:\s|$):===:heart # or
regex;(?:^|\s)</3(?:\s|$):===:broken heart #([ |^])<-([ ,.!?$]):===:arrow left\2
regex;(?:^|\s)(?:Oo|oO)(?:\s|$):===:WTF? regex;[\s*|'|"]<-[\s*|'|"]:===:arrow left
regex;(?:^|\s)<{-.-}>(?:\s|$):===:Raves regex;[\s*|'|"][O|o][O|o][\s*|'|"]:===:WTF?
regex;(?:^|\s)-\.-(?:\s|$):===:bugged regex;[\s*|'|"]\^\^[\s*|'|"]:===:enjoy smile
regex;(?:^|\s)>\.<(?:\s|$):===:laughing
regex;(?:^|\s)(?:>:\)|>:-\))(?:\s|$):===:evil smile
regex;(?:^|\s)\^\^(?:\s|$):===:enjoy smile
regex;(?:^|\s)->(?:\s|$):===:arrow right
regex;(?:^|\s)<-(?:\s|$):===:arrow left

View File

@ -52,33 +52,27 @@ regex;(?i)shit:===:shitt
regex;(?i)slither:===:slitther regex;(?i)slither:===:slitther
[emoticonDict] [emoticonDict]
regex;(?:^|\s)(?::-\)|:\))(?:\s|$):===:smile # This dictionary uses regexp when prefixed with "regex;", so be sure to escape anything that would be parsed by regexp, e.g. *, ., ^, $, etc.
regex;(?:^|\s)(?::-\(|:\()(?:\s|$):===:frown regex;[\s*|'|"][\s*|'|"]<{-.-}>:===:Raves
regex;(?:^|\s)(?::-D|:D)(?:\s|$):===:big grin regex;[\s*|'|"][\s*|'|"]8-\):===:smile with sunglasses
regex;(?:^|\s)(?:;-\)|;\))(?:\s|$):===:wink regex;[\s*|'|"][\s*|'|"]:-/:===:confused
regex;(?:^|\s)(?::-P|:P)(?:\s|$):===:tongue out regex;[\s*|'|"][\s*|'|"]-\.-:===:bugged
regex;(?:^|\s)(?::-O|:O)(?:\s|$):===:surprised regex;[\s*|'|"][\s*|'|"]>\.<:===:laughing
regex;(?:^|\s)(?::-/|:/)(?:\s|$):===:skeptical regex;[\s*|'|"][\s*|'|"]8-X:===:skull
regex;(?:^|\s)(?:>:-\(|>:\()(?:\s|$):===:angry regex;[\s*|'|"][\s*|'|"]>:\):===:evil smile
regex;(?:^|\s)(?::'\(|:'-\()(?:\s|$):===:crying regex;[\s*|'|"][\s*|'|"]>:-\):===:evil smile
regex;(?:^|\s)(?::-\||:\|)(?:\s|$):===:neutral regex;[\s*|'|"][\s*|'|"]\\o/:===:Hurray
regex;(?:^|\s)(?:8-\)|B-\))(?:\s|$):===:cool regex;[\s*|'|"][\s*|'|"]:/:===:confused
regex;(?:^|\s)8-X(?:\s|$):===:skull and crossbones regex;[\s*|'|"]:D[\s*|'|"]:===:laugh
regex;(?:^|\s)(?:X-X|x-x)(?:\s|$):===:knocked out regex;[\s*|'|"];\)[\s*|'|"]:===:wink
regex;(?:^|\s)(?::-X|:-x|:X|:x)(?:\s|$):===:lips sealed regex;[\s*|'|"]XD[\s*|'|"]:===:LOL
regex;(?:^|\s)XD(?:\s|$):===:laughing hard regex;[\s*|'|"]:-\)[\s*|'|"]:===:smile
regex;(?:^|\s)\^_\^(?:\s|$):===:happy regex;[\s*|'|"]:\)[\s*|'|"]:===:smile
regex;(?:^|\s)-_-(?:\s|$):===:annoyed regex;[\s*|'|"]->[\s*|'|"]:===:arrow right
regex;(?:^|\s)o_O(?:\s|$):===:confused # example for arrow left
regex;(?:^|\s)>_<(?:\s|$):===:frustrated #(?:[ |^])(<-)(?:[ ,.!?$]):===:arrow left
regex;(?:^|\s)\\o/(?:\s|$):===:hurray # or
regex;(?:^|\s)<3(?:\s|$):===:heart #([ |^])<-([ ,.!?$]):===:arrow left\2
regex;(?:^|\s)</3(?:\s|$):===:broken heart regex;[\s*|'|"]<-[\s*|'|"]:===:arrow left
regex;(?:^|\s)(?:Oo|oO)(?:\s|$):===:WTF? regex;[\s+|'|"][O|o][O|o][\s+|'|"]:===:WTF?
regex;(?:^|\s)<{-.-}>(?:\s|$):===:Raves regex;[\s*|'|"]\^\^[\s*|'|"]:===:enjoy smile
regex;(?:^|\s)-\.-(?:\s|$):===:bugged
regex;(?:^|\s)>\.<(?:\s|$):===:laughing
regex;(?:^|\s)(?:>:\)|>:-\))(?:\s|$):===:evil smile
regex;(?:^|\s)\^\^(?:\s|$):===:enjoy smile
regex;(?:^|\s)->(?:\s|$):===:arrow right
regex;(?:^|\s)<-(?:\s|$):===:arrow left

View File

@ -3,6 +3,5 @@ daemonize>=2.5.0
dbus-python>=1.2.8 dbus-python>=1.2.8
pyudev>=0.21.0 pyudev>=0.21.0
pexpect pexpect
ppyperclip pyttsx3
pyte>=0.7.0 pyte>=0.7.0
rapidfuzz>=2.0.0

View File

@ -99,11 +99,10 @@ setup(
"evdev>=1.1.2", "evdev>=1.1.2",
"daemonize>=2.5.0", "daemonize>=2.5.0",
"dbus-python>=1.2.8", "dbus-python>=1.2.8",
"pyperclip",
"pyudev>=0.21.0", "pyudev>=0.21.0",
"rapidfuzz>=2.0.0",
"setuptools", "setuptools",
"pexpect", "pexpect",
"pyttsx3",
"pyte>=0.7.0", "pyte>=0.7.0",
], ],
) )

View File

@ -5,16 +5,15 @@
# By Chrys, Storm Dragon, and contributers. # By Chrys, Storm Dragon, and contributers.
from fenrirscreenreader.core import debug from fenrirscreenreader.core import debug
import os import subprocess, os
from subprocess import Popen, PIPE
import _thread import _thread
import pyperclip
class command(): class command():
def __init__(self): def __init__(self):
pass pass
def initialize(self, environment, scriptPath=''): def initialize(self, environment):
self.env = environment self.env = environment
self.scriptPath = scriptPath
def shutdown(self): def shutdown(self):
pass pass
def getDescription(self): def getDescription(self):
@ -23,47 +22,56 @@ class command():
_thread.start_new_thread(self._threadRun , ()) _thread.start_new_thread(self._threadRun , ())
def _threadRun(self): def _threadRun(self):
try: try:
# Check if clipboard is empty
if self.env['runtime']['memoryManager'].isIndexListEmpty('clipboardHistory'): if self.env['runtime']['memoryManager'].isIndexListEmpty('clipboardHistory'):
self.env['runtime']['outputManager'].presentText(_('clipboard empty'), interrupt=True) self.env['runtime']['outputManager'].presentText(_('clipboard empty'), interrupt=True)
return return
# Get current clipboard content
clipboard = self.env['runtime']['memoryManager'].getIndexListElement('clipboardHistory') clipboard = self.env['runtime']['memoryManager'].getIndexListElement('clipboardHistory')
user = self.env['general']['currUser']
# Remember original display environment variable if it exists # First try to find xclip in common locations
originalDisplay = os.environ.get('DISPLAY', '') xclip_paths = [
success = False '/usr/bin/xclip',
'/bin/xclip',
'/usr/local/bin/xclip'
]
# Try different display options xclip_path = None
for i in range(10): for path in xclip_paths:
display = f":{i}" if os.path.isfile(path) and os.access(path, os.X_OK):
try: xclip_path = path
# Set display environment variable
os.environ['DISPLAY'] = display
# Attempt to set clipboard content
pyperclip.copy(clipboard)
# If we get here without exception, we found a working display
success = True
break break
except Exception:
# Failed for this display, try next one
continue
# Restore original display setting if not xclip_path:
if originalDisplay: self.env['runtime']['outputManager'].presentText(
os.environ['DISPLAY'] = originalDisplay 'xclip not found in common locations',
else: interrupt=True
os.environ.pop('DISPLAY', None) )
return
# Notify the user of the result for display in range(10):
if success: p = Popen(
self.env['runtime']['outputManager'].presentText(_('exported to the X session.'), interrupt=True) ['su', user, '-p', '-c', f"{xclip_path} -d :{display} -selection clipboard"],
stdin=PIPE, stdout=PIPE, stderr=PIPE, preexec_fn=os.setpgrp
)
stdout, stderr = p.communicate(input=clipboard.encode('utf-8'))
self.env['runtime']['outputManager'].interruptOutput()
stderr = stderr.decode('utf-8')
stdout = stdout.decode('utf-8')
if stderr == '':
break
if stderr != '':
self.env['runtime']['outputManager'].presentText(stderr, soundIcon='', interrupt=False)
else: else:
self.env['runtime']['outputManager'].presentText(_('failed to export to X clipboard. No available display found.'), interrupt=True) self.env['runtime']['outputManager'].presentText('exported to the X session.', interrupt=True)
except Exception as e: except Exception as e:
self.env['runtime']['outputManager'].presentText(str(e), soundIcon='', interrupt=False) self.env['runtime']['outputManager'].presentText(str(e), soundIcon='', interrupt=False)
def setCallback(self, callback): def setCallback(self, callback):
pass pass

View File

@ -5,10 +5,9 @@
# By Chrys, Storm Dragon, and contributers. # By Chrys, Storm Dragon, and contributers.
from fenrirscreenreader.core import debug from fenrirscreenreader.core import debug
import subprocess, os
from subprocess import Popen, PIPE
import _thread import _thread
import pyperclip
import os
class command(): class command():
def __init__(self): def __init__(self):
pass pass
@ -23,40 +22,33 @@ class command():
_thread.start_new_thread(self._threadRun , ()) _thread.start_new_thread(self._threadRun , ())
def _threadRun(self): def _threadRun(self):
try: try:
# Remember original display environment variable if it exists # Find xclip path
originalDisplay = os.environ.get('DISPLAY', '') xclip_paths = ['/usr/bin/xclip', '/bin/xclip', '/usr/local/bin/xclip']
clipboardContent = None xclip_path = None
for path in xclip_paths:
# Try different display options if os.path.isfile(path) and os.access(path, os.X_OK):
for i in range(10): xclip_path = path
display = f":{i}"
try:
# Set display environment variable
os.environ['DISPLAY'] = display
# Attempt to get clipboard content
clipboardContent = pyperclip.paste()
# If we get here without exception, we found a working display
if clipboardContent:
break break
except Exception: if not xclip_path:
# Failed for this display, try next one self.env['runtime']['outputManager'].presentText('xclip not found in common locations', interrupt=True)
continue return
xClipboard = ''
# Restore original display setting for display in range(10):
if originalDisplay: p = Popen('su ' + self.env['general']['currUser'] + ' -p -c "' + xclip_path + ' -d :' + str(display) + ' -o"', stdout=PIPE, stderr=PIPE, shell=True)
os.environ['DISPLAY'] = originalDisplay stdout, stderr = p.communicate()
self.env['runtime']['outputManager'].interruptOutput()
stderr = stderr.decode('utf-8')
xClipboard = stdout.decode('utf-8')
if (stderr == ''):
break
if stderr != '':
self.env['runtime']['outputManager'].presentText(stderr , soundIcon='', interrupt=False)
else: else:
os.environ.pop('DISPLAY', None) self.env['runtime']['memoryManager'].addValueToFirstIndex('clipboardHistory', xClipboard)
# Process the clipboard content if we found any
if clipboardContent and isinstance(clipboardContent, str):
self.env['runtime']['memoryManager'].addValueToFirstIndex('clipboardHistory', clipboardContent)
self.env['runtime']['outputManager'].presentText('Import to Clipboard', soundIcon='CopyToClipboard', interrupt=True) self.env['runtime']['outputManager'].presentText('Import to Clipboard', soundIcon='CopyToClipboard', interrupt=True)
self.env['runtime']['outputManager'].presentText(clipboardContent, soundIcon='', interrupt=False) self.env['runtime']['outputManager'].presentText(xClipboard, soundIcon='', interrupt=False)
else:
self.env['runtime']['outputManager'].presentText('No text found in clipboard or no accessible display', interrupt=True)
except Exception as e: except Exception as e:
self.env['runtime']['outputManager'].presentText(str(e), soundIcon='', interrupt=False) self.env['runtime']['outputManager'].presentText(e , soundIcon='', interrupt=False)
def setCallback(self, callback): def setCallback(self, callback):
pass pass

View File

@ -35,18 +35,12 @@ class command():
if not (self.env['runtime']['byteManager'].getLastByteKey() in [b'^[[A',b'^[[B']): if not (self.env['runtime']['byteManager'].getLastByteKey() in [b'^[[A',b'^[[B']):
return return
# Get the current cursor's line from both old and new content
prevLine = self.env['screen']['oldContentText'].split('\n')[self.env['screen']['newCursor']['y']] prevLine = self.env['screen']['oldContentText'].split('\n')[self.env['screen']['newCursor']['y']]
currLine = self.env['screen']['newContentText'].split('\n')[self.env['screen']['newCursor']['y']] currLine = self.env['screen']['newContentText'].split('\n')[self.env['screen']['newCursor']['y']]
is_blank = currLine.strip() == ''
if prevLine == currLine: if prevLine == currLine:
if self.env['screen']['newDelta'] != '': if self.env['screen']['newDelta'] != '':
return return
if not currLine.isspace():
announce = currLine
if not is_blank:
currPrompt = currLine.find('$') currPrompt = currLine.find('$')
rootPrompt = currLine.find('#') rootPrompt = currLine.find('#')
if currPrompt <= 0: if currPrompt <= 0:
@ -61,13 +55,13 @@ class command():
else: else:
announce = currLine announce = currLine
if is_blank: if currLine.isspace():
self.env['runtime']['outputManager'].presentText(_("blank"), soundIcon='EmptyLine', interrupt=True, flush=False) self.env['runtime']['outputManager'].presentText(_("blank"), soundIcon='EmptyLine', interrupt=True, flush=False)
else: else:
self.env['runtime']['outputManager'].presentText(announce, interrupt=True, flush=False) self.env['runtime']['outputManager'].presentText(announce, interrupt=True, flush=False)
self.env['commandsIgnore']['onScreenUpdate']['CHAR_DELETE_ECHO'] = True self.env['commandsIgnore']['onScreenUpdate']['CHAR_DELETE_ECHO'] = True
self.env['commandsIgnore']['onScreenUpdate']['CHAR_ECHO'] = True self.env['commandsIgnore']['onScreenUpdate']['CHAR_ECHO'] = True
self.env['commandsIgnore']['onScreenUpdate']['INCOMING_IGNORE'] = True self.env['commandsIgnore']['onScreenUpdate']['INCOMING_IGNORE'] = True
def setCallback(self, callback): def setCallback(self, callback):
pass pass

View File

@ -159,13 +159,7 @@ class commandManager():
self.env['runtime']['debug'].writeDebugOut("Loading script:" + fileName ,debug.debugLevel.ERROR) self.env['runtime']['debug'].writeDebugOut("Loading script:" + fileName ,debug.debugLevel.ERROR)
self.env['runtime']['debug'].writeDebugOut(str(e),debug.debugLevel.ERROR) self.env['runtime']['debug'].writeDebugOut(str(e),debug.debugLevel.ERROR)
continue continue
def shutdownCommands(self, section): def shutdownCommands(self, section):
# Check if the section exists in the commands dictionary
if section not in self.env['commands']:
self.env['runtime']['debug'].writeDebugOut("shutdownCommands: section not found:" + section, debug.debugLevel.WARNING)
return
for command in sorted(self.env['commands'][section]): for command in sorted(self.env['commands'][section]):
try: try:
self.env['commands'][section][command].shutdown() self.env['commands'][section][command].shutdown()

View File

@ -7,7 +7,6 @@
from fenrirscreenreader.core import debug from fenrirscreenreader.core import debug
from fenrirscreenreader.utils import screen_utils from fenrirscreenreader.utils import screen_utils
import time, os, re, difflib import time, os, re, difflib
from rapidfuzz.distance import Levenshtein
class screenManager(): class screenManager():
def __init__(self): def __init__(self):
@ -83,7 +82,6 @@ class screenManager():
def updateScreenIgnored(self): def updateScreenIgnored(self):
self.prevScreenIgnored = self.currScreenIgnored self.prevScreenIgnored = self.currScreenIgnored
self.currScreenIgnored = self.isSuspendingScreen(self.env['screen']['newTTY']) self.currScreenIgnored = self.isSuspendingScreen(self.env['screen']['newTTY'])
def update(self, eventData, trigger='onUpdate'): def update(self, eventData, trigger='onUpdate'):
# set new "old" values # set new "old" values
self.env['screen']['oldContentBytes'] = self.env['screen']['newContentBytes'] self.env['screen']['oldContentBytes'] = self.env['screen']['newContentBytes']
@ -146,11 +144,8 @@ class screenManager():
cursorLineEndOffset = cursorLineStart + self.env['screen']['newCursor']['x'] + 3 cursorLineEndOffset = cursorLineStart + self.env['screen']['newCursor']['x'] + 3
oldScreenText = self.env['screen']['oldContentText'][cursorLineStartOffset:cursorLineEndOffset] oldScreenText = self.env['screen']['oldContentText'][cursorLineStartOffset:cursorLineEndOffset]
newScreenText = self.env['screen']['newContentText'][cursorLineStartOffset:cursorLineEndOffset] newScreenText = self.env['screen']['newContentText'][cursorLineStartOffset:cursorLineEndOffset]
# Use the original differ for typing mode to preserve behavior
diff = self.differ.compare(oldScreenText, newScreenText) diff = self.differ.compare(oldScreenText, newScreenText)
diffList = list(diff) diffList = list(diff)
typing = True typing = True
tempNewDelta = ''.join(x[2:] for x in diffList if x[0] == '+') tempNewDelta = ''.join(x[2:] for x in diffList if x[0] == '+')
if tempNewDelta.strip() != '': if tempNewDelta.strip() != '':
@ -158,26 +153,7 @@ class screenManager():
diffList = ['+ ' + self.env['screen']['newContentText'].split('\n')[self.env['screen']['newCursor']['y']] +'\n'] diffList = ['+ ' + self.env['screen']['newContentText'].split('\n')[self.env['screen']['newCursor']['y']] +'\n']
typing = False typing = False
else: else:
# For screen changes, use the original differ diff = self.differ.compare(oldScreenText.split('\n'),\
if self.isScreenChange() or trigger == 'onScreenChange':
diff = self.differ.compare(oldScreenText.split('\n'),
newScreenText.split('\n'))
diffList = list(diff)
else:
# Use rapidfuzz for normal updates - not for screen changes
try:
# Process line by line using rapidfuzz
old_lines = oldScreenText.split('\n')
new_lines = newScreenText.split('\n')
# Use standard differ for better word grouping
diff = self.differ.compare(old_lines, new_lines)
diffList = list(diff)
except Exception as e:
# Fall back to standard differ if there's any issue
self.env['runtime']['debug'].writeDebugOut('screenManager:update:rapidfuzz: ' + str(e), debug.debugLevel.ERROR)
diff = self.differ.compare(oldScreenText.split('\n'),
newScreenText.split('\n')) newScreenText.split('\n'))
diffList = list(diff) diffList = list(diff)

View File

@ -4,5 +4,5 @@
# Fenrir TTY screen reader # Fenrir TTY screen reader
# By Chrys, Storm Dragon, and contributers. # By Chrys, Storm Dragon, and contributers.
version = "2025.03.02" version = "2024.12.20"
codeName = "master" codeName = "stable"

View File

@ -72,16 +72,14 @@ class driver(inputDriver):
self.env['runtime']['debug'].writeDebugOut('plugInputDeviceWatchdogUdev:' + str(device), debug.debugLevel.INFO) self.env['runtime']['debug'].writeDebugOut('plugInputDeviceWatchdogUdev:' + str(device), debug.debugLevel.INFO)
try: try:
try: try:
# FIX: Check if attributes exist before accessing them if device.name.upper() in ['','SPEAKUP','FENRIR-UINPUT']:
if hasattr(device, 'name') and device.name and device.name.upper() in ['','SPEAKUP','FENRIR-UINPUT']:
ignorePlug = True ignorePlug = True
if hasattr(device, 'phys') and device.phys and device.phys.upper() in ['','SPEAKUP','FENRIR-UINPUT']: if device.phys.upper() in ['','SPEAKUP','FENRIR-UINPUT']:
ignorePlug = True ignorePlug = True
if hasattr(device, 'name') and device.name and 'BRLTTY' in device.name.upper(): if 'BRLTTY' in device.name.upper():
ignorePlug = True ignorePlug = True
except Exception as e: except Exception as e:
self.env['runtime']['debug'].writeDebugOut("plugInputDeviceWatchdogUdev CHECK NAME CRASH: " + str(e),debug.debugLevel.ERROR) self.env['runtime']['debug'].writeDebugOut("plugInputDeviceWatchdogUdev CHECK NAME CRASH: " + str(e),debug.debugLevel.ERROR)
if not ignorePlug: if not ignorePlug:
virtual = '/sys/devices/virtual/input/' in device.sys_path virtual = '/sys/devices/virtual/input/' in device.sys_path
if device.device_node: if device.device_node:
@ -91,7 +89,7 @@ class driver(inputDriver):
try: try:
pollTimeout = 1 pollTimeout = 1
device = monitor.poll(pollTimeout) device = monitor.poll(pollTimeout)
except Exception: except:
device = None device = None
ignorePlug = False ignorePlug = False
if validDevices: if validDevices:
@ -148,7 +146,7 @@ class driver(inputDriver):
if uDevice: if uDevice:
if self.gDevices[iDevice.fd]: if self.gDevices[iDevice.fd]:
self.writeUInput(uDevice, event) self.writeUInput(uDevice, event)
except Exception: except Exception as e:
pass pass
def writeUInput(self, uDevice, event): def writeUInput(self, uDevice, event):
@ -193,7 +191,7 @@ class driver(inputDriver):
try: try:
with open(deviceFile) as f: with open(deviceFile) as f:
pass pass
except Exception: except Exception as e:
continue continue
# 3 pos absolute # 3 pos absolute
# 2 pos relative # 2 pos relative
@ -203,12 +201,11 @@ class driver(inputDriver):
except: except:
continue continue
try: try:
# FIX: Check if attributes exist before accessing them if currDevice.name.upper() in ['','SPEAKUP','FENRIR-UINPUT']:
if hasattr(currDevice, 'name') and currDevice.name and currDevice.name.upper() in ['', 'SPEAKUP', 'FENRIR-UINPUT']:
continue continue
if hasattr(currDevice, 'phys') and currDevice.phys and currDevice.phys.upper() in ['', 'SPEAKUP', 'FENRIR-UINPUT']: if currDevice.phys.upper() in ['','SPEAKUP','FENRIR-UINPUT']:
continue continue
if hasattr(currDevice, 'name') and currDevice.name and 'BRLTTY' in currDevice.name.upper(): if 'BRLTTY' in currDevice.name.upper():
continue continue
except: except:
pass pass
@ -236,11 +233,7 @@ class driver(inputDriver):
self.addDevice(currDevice) self.addDevice(currDevice)
self.env['runtime']['debug'].writeDebugOut('Device added (Name):' + self.iDevices[currDevice.fd].name,debug.debugLevel.INFO) self.env['runtime']['debug'].writeDebugOut('Device added (Name):' + self.iDevices[currDevice.fd].name,debug.debugLevel.INFO)
except Exception as e: except Exception as e:
try: self.env['runtime']['debug'].writeDebugOut("Device Skipped (Exception): " + deviceFile +' ' + currDevice.name +' '+ str(e),debug.debugLevel.INFO)
device_name = currDevice.name if hasattr(currDevice, 'name') else "unknown"
self.env['runtime']['debug'].writeDebugOut("Device Skipped (Exception): " + deviceFile + ' ' + device_name + ' ' + str(e), debug.debugLevel.INFO)
except:
self.env['runtime']['debug'].writeDebugOut("Device Skipped (Exception): " + deviceFile + ' ' + str(e), debug.debugLevel.INFO)
self.iDeviceNo = len(evdev.list_devices()) self.iDeviceNo = len(evdev.list_devices())
self.updateMPiDevicesFD() self.updateMPiDevicesFD()
@ -254,7 +247,6 @@ class driver(inputDriver):
self.iDevicesFD.remove(fd) self.iDevicesFD.remove(fd)
except: except:
pass pass
def mapEvent(self, event): def mapEvent(self, event):
if not self._initialized: if not self._initialized:
return None return None
@ -276,7 +268,7 @@ class driver(inputDriver):
mEvent['EventState'] = event.value mEvent['EventState'] = event.value
mEvent['EventType'] = event.type mEvent['EventType'] = event.type
return mEvent return mEvent
except Exception: except Exception as e:
return None return None
def getLedState(self, led = 0): def getLedState(self, led = 0):
@ -289,7 +281,6 @@ class driver(inputDriver):
if led in dev.leds(): if led in dev.leds():
return True return True
return False return False
def toggleLedState(self, led = 0): def toggleLedState(self, led = 0):
if not self.hasIDevices(): if not self.hasIDevices():
return False return False
@ -302,7 +293,6 @@ class driver(inputDriver):
self.iDevices[i].set_led(led , 0) self.iDevices[i].set_led(led , 0)
else: else:
self.iDevices[i].set_led(led , 1) self.iDevices[i].set_led(led , 1)
def grabAllDevices(self): def grabAllDevices(self):
if not self._initialized: if not self._initialized:
return True return True
@ -311,7 +301,6 @@ class driver(inputDriver):
if not self.gDevices[fd]: if not self.gDevices[fd]:
ok = ok and self.grabDevice(fd) ok = ok and self.grabDevice(fd)
return ok return ok
def ungrabAllDevices(self): def ungrabAllDevices(self):
if not self._initialized: if not self._initialized:
return True return True
@ -320,7 +309,6 @@ class driver(inputDriver):
if self.gDevices[fd]: if self.gDevices[fd]:
ok = ok and self.ungrabDevice(fd) ok = ok and self.ungrabDevice(fd)
return ok return ok
def createUInputDev(self, fd): def createUInputDev(self, fd):
if not self.env['runtime']['settingsManager'].getSettingAsBool('keyboard', 'grabDevices'): if not self.env['runtime']['settingsManager'].getSettingAsBool('keyboard', 'grabDevices'):
self.uDevices[fd] = None self.uDevices[fd] = None
@ -348,7 +336,6 @@ class driver(inputDriver):
except Exception as e: except Exception as e:
self.env['runtime']['debug'].writeDebugOut('InputDriver evdev: init Uinput not possible: ' + str(e),debug.debugLevel.ERROR) self.env['runtime']['debug'].writeDebugOut('InputDriver evdev: init Uinput not possible: ' + str(e),debug.debugLevel.ERROR)
return return
def addDevice(self, newDevice): def addDevice(self, newDevice):
self.env['runtime']['debug'].writeDebugOut('InputDriver evdev: device added: ' + str(newDevice.fd) + ' ' +str(newDevice),debug.debugLevel.INFO) self.env['runtime']['debug'].writeDebugOut('InputDriver evdev: device added: ' + str(newDevice.fd) + ' ' +str(newDevice),debug.debugLevel.INFO)
try: try:
@ -373,9 +360,6 @@ class driver(inputDriver):
def grabDevice(self, fd): def grabDevice(self, fd):
if not self.env['runtime']['settingsManager'].getSettingAsBool('keyboard', 'grabDevices'): if not self.env['runtime']['settingsManager'].getSettingAsBool('keyboard', 'grabDevices'):
return True return True
# FIX: Handle exception variable scope correctly
grab_error = None
try: try:
self.iDevices[fd].grab() self.iDevices[fd].grab()
self.gDevices[fd] = True self.gDevices[fd] = True
@ -387,26 +371,19 @@ class driver(inputDriver):
try: try:
self.uDevices[fd].write(e.EV_KEY, key, 0) # 0 = key up self.uDevices[fd].write(e.EV_KEY, key, 0) # 0 = key up
self.uDevices[fd].syn() self.uDevices[fd].syn()
except Exception as mod_error: except Exception as e:
self.env['runtime']['debug'].writeDebugOut('Failed to reset modifier key: ' + str(mod_error), debug.debugLevel.WARNING) self.env['runtime']['debug'].writeDebugOut('Failed to reset modifier key: ' + str(e), debug.debugLevel.WARNING)
except IOError: except IOError:
if not self.gDevices[fd]: if not self.gDevices[fd]:
return False return False
except Exception as ex: except Exception as e:
grab_error = ex self.env['runtime']['debug'].writeDebugOut('InputDriver evdev: grabing not possible: ' + str(e),debug.debugLevel.ERROR)
if grab_error:
self.env['runtime']['debug'].writeDebugOut('InputDriver evdev: grabing not possible: ' + str(grab_error), debug.debugLevel.ERROR)
return False return False
return True return True
def ungrabDevice(self,fd): def ungrabDevice(self,fd):
if not self.env['runtime']['settingsManager'].getSettingAsBool('keyboard', 'grabDevices'): if not self.env['runtime']['settingsManager'].getSettingAsBool('keyboard', 'grabDevices'):
return True return True
# FIX: Handle exception variable scope correctly
ungrab_error = None
try: try:
self.iDevices[fd].ungrab() self.iDevices[fd].ungrab()
self.gDevices[fd] = False self.gDevices[fd] = False
@ -414,15 +391,11 @@ class driver(inputDriver):
except IOError: except IOError:
if self.gDevices[fd]: if self.gDevices[fd]:
return False return False
except Exception as ex: # self.gDevices[fd] = False
ungrab_error = ex # #self.removeDevice(fd)
except Exception as e:
if ungrab_error:
self.env['runtime']['debug'].writeDebugOut('InputDriver evdev: ungrabing not possible: ' + str(ungrab_error), debug.debugLevel.ERROR)
return False return False
return True return True
def removeDevice(self,fd): def removeDevice(self,fd):
self.env['runtime']['debug'].writeDebugOut('InputDriver evdev: device removed: ' + str(fd) + ' ' +str(self.iDevices[fd]),debug.debugLevel.INFO) self.env['runtime']['debug'].writeDebugOut('InputDriver evdev: device removed: ' + str(fd) + ' ' +str(self.iDevices[fd]),debug.debugLevel.INFO)
self.clearEventBuffer() self.clearEventBuffer()