Skip to content
Commits on Source (3)
......@@ -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
......