Skip to content
GitLab
Explore
Sign in
Register
Hypra
ibus-braille
Compare revisions
9a034aeaac51f3c7f3a58edc4bf01aa4ce162604 to 8516d65f0c256d2de5f0ec8a12fa436dc4747639
Commits on Source (3)
fix debug log
· c2be5099
Samuel Thibault
authored
Jun 14, 2019
c2be5099
comment
· 24d9fd27
Samuel Thibault
authored
Jun 14, 2019
24d9fd27
Let braille keyboards always type braille
· 8516d65f
Samuel Thibault
authored
Jun 14, 2019
8516d65f
Hide whitespace changes
Inline
Side-by-side
ibus-braille.py
View file @
8516d65f
...
...
@@ -306,24 +306,20 @@ class EngineBraille(IBus.Engine):
# keysym is AT scancode,
debug
(
4
,
"
got key %x %d %x
"
%
(
keysym
,
scancode
,
state
))
if
not
self
.
enabled
:
debug
(
5
,
"
but not enabled
"
)
return
False
if
scancode
in
self
.
key_map
:
dot
=
self
.
key_map
[
scancode
]
self
.
__process_dot_key
(
dot
,
is_press
)
if
keysym
&
~
0xff
==
XK_braille_blank
:
self
.
__process_pattern
(
keysym
&
0xff
)
return
True
elif
keysym
>=
XK_braille_dot_1
and
keysym
<=
XK_braille_dot_10
:
self
.
__process_dot_key
(
keysym
-
XK_braille_dot_1
+
1
,
is_press
)
return
True
elif
keysym
&
~
0xff
==
XK_braille_blank
:
self
.
__process_pattern
(
keysym
&
0xff
)
if
self
.
enabled
and
scancode
in
self
.
key_map
:
dot
=
self
.
key_map
[
scancode
]
self
.
__process_dot_key
(
dot
,
is_press
)
return
True
else
:
if
self
.
contracted
:
self
.
__commit
()
if
self
.
contracted
:
self
.
__commit
()
# don't eat
return
False
...
...
@@ -433,7 +429,7 @@ class EngineBraille(IBus.Engine):
self
.
__process_char
(
char
)
def
__process_char
(
self
,
char
):
debug
(
3
,
"
got
pattern
"
+
char
)
debug
(
3
,
"
got
char
"
+
char
)
if
char
in
separators
:
# A separator got pressed, commit word
self
.
__commit
()
...
...
@@ -445,6 +441,7 @@ class EngineBraille(IBus.Engine):
# patterns for a-z
# TODO: should perhaps do this also in maths mode, and convert
# to pure braille before passing to natbraille?
# But then we can't know whether the content is braillemath or starmath
char
=
brf
[
char
]
self
.
preedit
+=
char
self
.
contracted
=
True
...
...