예제 #1
0
 def _init_props(self):
     self._prop_list = IBus.PropList()
     self._input_mode_prop = IBus.Property(
         key='InputMode',
         prop_type=IBus.PropType.NORMAL,
         symbol=IBus.Text.new_from_string(self._mode),
         label=IBus.Text.new_from_string(_("Input mode (%s)") % self._mode),
         icon=None,
         tooltip=None,
         sensitive=False,
         visible=True,
         state=IBus.PropState.UNCHECKED,
         sub_props=None)
     self._prop_list.append(self._input_mode_prop)
     prop = IBus.Property(key='Setup',
                          prop_type=IBus.PropType.NORMAL,
                          label=IBus.Text.new_from_string(_("Setup")),
                          icon=None,
                          tooltip=None,
                          sensitive=True,
                          visible=True,
                          state=IBus.PropState.UNCHECKED,
                          sub_props=None)
     self._prop_list.append(prop)
     prop = IBus.Property(key='About',
                          prop_type=IBus.PropType.NORMAL,
                          label=IBus.Text.new_from_string(
                              _("About Hiragana IME...")),
                          icon=None,
                          tooltip=None,
                          sensitive=True,
                          visible=True,
                          state=IBus.PropState.UNCHECKED,
                          sub_props=None)
     self._prop_list.append(prop)
예제 #2
0
    def __init_method_prop_menu(self):
        method_prop_list = IBus.PropList()
        for method in Config.methods:
            method_prop_list.append(
                IBus.Property(
                    key=method,
                    prop_type=IBus.PropType.RADIO,
                    label=IBus.Text.new_from_string(Config.methods[method][0]),
                    icon=None,
                    tooltip=IBus.Text.new_from_string(
                        Config.methods[method][1]),
                    sensitive=True,
                    visible=True,
                    state=IBus.PropState.CHECKED if method == self.input_method
                    else IBus.PropState.UNCHECKED,
                    sub_props=None))

        self.__method_prop_menu = IBus.Property(
            key="method",
            prop_type=IBus.PropType.MENU,
            label=IBus.Text.new_from_string(
                Config.methods['im.' + self.input_method][0]),
            icon=None,
            tooltip=IBus.Text.new_from_string("Choose typing method"),
            sensitive=True,
            visible=True,
            state=IBus.PropState.UNCHECKED,
            sub_props=method_prop_list)
        return self.__method_prop_menu
예제 #3
0
    def init_properties(self):
        self.prop_list = IBus.PropList()

        for (key, label) in (("halfwidth-chars", _("Half-Width Characters")),
                             ):
            stored_value = self.settings.get_boolean(key)
            state = IBus.PropState.CHECKED if stored_value else IBus.PropState.UNCHECKED

            try:
                # Try the new constructor from IBus >= 1.5
                prop = IBus.Property(key=key,
                                     prop_type=IBus.PropType.TOGGLE,
                                     label=label,
                                     icon='',
                                     sensitive=True,
                                     visible=True,
                                     state=state,
                                     sub_props=None)

            except TypeError:
                # IBus 1.4.x didn't have the GI overrides for the nice
                # constructor, so let's do it the old, non-pythonic way.
                #   IBus.Property.new(key, type, label, icon, tooltip,
                #                     sensitive, visible, state, sub_props)
                prop = IBus.Property.new(key, IBus.PropType.TOGGLE,
                                         IBus.Text.new_from_string(label),
                                         '', IBus.Text.new_from_string(''),
                                         True, True, state, None)

            self.prop_list.append(prop)
예제 #4
0
    def __init_charset_prop_menu(self):
        charset_prop_list = IBus.PropList()
        for charset in Config.charsets:
            charset_prop_list.append(
                IBus.Property(
                    key=charset,
                    prop_type=IBus.PropType.RADIO,
                    label=IBus.Text.new_from_string(
                        Config.charsets[charset][0]),
                    tooltip=IBus.Text.new_from_string(
                        Config.charsets[charset][1]),
                    sensitive=True,
                    visible=True,
                    state=IBus.PropState.CHECKED if Config.charsets[charset][2]
                    == self.output_charset else IBus.PropState.UNCHECKED,
                    sub_props=None))

        self.__charset_prop_menu = IBus.Property(
            key="charset",
            prop_type=IBus.PropType.MENU,
            label=IBus.Text.new_from_string(
                Config.charsets['charset.' + self.output_charset][0]),
            icon=None,
            tooltip=IBus.Text.new_from_string("Choose charset"),
            sensitive=True,
            visible=True,
            state=IBus.PropState.UNCHECKED,
            sub_props=charset_prop_list)
        return self.__charset_prop_menu
예제 #5
0
    def __init__(self):
        """initialize the newly created engine

        """
        self.properties = IBus.PropList()
        # self.properties.append(IBus.Property(
        #     key='source',
        #     type=IBus.PropType.NORMAL,
        #     label='Microphone',
        #     tooltip='ALSA device such as hw:0,0 or hw:1,0 (see arecord -l for ids)',
        #     visible=True,
        # ))
        self.properties.append(
            IBus.Property(
                key='listening',
                type=IBus.PropType.TOGGLE,
                label='DeepSpeech',
                tooltip='Toggle whether the engine is currently listening',
                visible=True,
            ))
        # self.lookup_table = IBus.LookupTable.new(
        #     5, 0, True, True,  # size  # index,  # cursor visible  # round
        # )
        # self.lookup_table_content = []
        # self.interpreter_rules, self.rule_set = interpreter.load_rules(
        #     interpreter.good_commands,
        # )
        # self.lookup_table.ref_sink()
        super(ListenerEngine, self).__init__()
예제 #6
0
    def __init_charset_prop_menu(self):
        charset_prop_list = IBus.PropList()
        for charset in self.__charset_list:
            charset_prop_list.append(
                IBus.Property(key=charset,
                              prop_type=IBus.PropType.RADIO,
                              label=IBus.Text.new_from_string(charset),
                              icon='',
                              tooltip=IBus.Text.new_from_string(charset),
                              sensitive=True,
                              visible=True,
                              state=IBus.PropState.CHECKED if charset == "UTF8"
                              else IBus.PropState.UNCHECKED,
                              sub_props=None))

        charset_prop_menu = IBus.Property(
            key="charset",
            prop_type=IBus.PropType.MENU,
            label=IBus.Text.new_from_string("Charset"),
            icon="gtk-preferences",
            tooltip=IBus.Text.new_from_string("Choose charset"),
            sensitive=True,
            visible=True,
            state=IBus.PropState.UNCHECKED,
            sub_props=charset_prop_list)
        return charset_prop_menu
예제 #7
0
    def __init__(self):
        super(UniEmoji, self).__init__()
        self.is_invalidate = False
        self.preedit_string = u""
        self.lookup_table = IBus.LookupTable.new(10, 0, True, True)
        self.prop_list = IBus.PropList()
        self.table = {}
        with open(os.path.join(__base_dir__,
                               'UnicodeData.txt')) as unicodedata:
            _ranges = ranges[:]
            range = _ranges.pop()
            for line in unicodedata.readlines():
                if not line.strip(): continue
                code, name, category, _ = line.split(';', 3)
                code = int(code, 16)
                if code < range[0]:
                    continue
                if code > range[1]:
                    try:
                        range = _ranges.pop()
                    except IndexError:
                        break
                if category != 'So':
                    continue
                self.table[name.lower()] = unichr(code)

        debug("Create UniEmoji engine OK")
예제 #8
0
    def __init__(self):
        super(UniEmoji, self).__init__()
        self.is_invalidate = False
        self.preedit_string = u""
        self.lookup_table = IBus.LookupTable.new(10, 0, True, True)
        self.prop_list = IBus.PropList()

        debug("Create UniEmoji engine OK")
예제 #9
0
 def __init__(self):
     super(EngineEnchant, self).__init__()
     self.__is_invalidate = False
     self.__preedit_string = ""
     self.__lookup_table = IBus.LookupTable.new(10, 0, True, True)
     self.__prop_list = IBus.PropList()
     self.__prop_list.append(IBus.Property(key="test", icon="ibus-local"))
     print("Create EngineEnchant OK")
예제 #10
0
파일: ibus.py 프로젝트: ep12/ibus-uniemoji
 def __init__(self):
     super(UniEmojiIBusEngine, self).__init__()
     self.candidates = []
     self.uniemoji = UniEmoji()
     self.is_invalidate = False
     self.preedit_string = ''
     self.lookup_table = IBus.LookupTable.new(10, 0, True, True)
     self.prop_list = IBus.PropList()
     logger.info('Create UniEmojiIBusEngine: OK')
예제 #11
0
    def __init__(self):
        super(EngineAbalone, self).__init__()
        self.recording = False
        self.__is_invalidate = False
        self.__preedit_string = ""
        self.__prop_list = IBus.PropList()
        self.__prop_list.append(IBus.Property(key="toggle-recording", icon="audio-input-microphone", type=IBus.PropType.TOGGLE, state=0, tooltip="Toggle speech recognition"))

        self.pipeline = Gst.parse_launch("pulsesrc ! audioconvert ! audiorate ! audioresample ! deepspeech silence-threshold=0.3 silence-length=20 ! fakesink")
        self.bus = self.pipeline.get_bus()
        self.bus.add_signal_watch()
        self.bus.connect ("message", self.bus_message)
예제 #12
0
파일: iwubi.py 프로젝트: gitdhsx/iwubi
 def __init__(self):
     super(IbusWubiEngine, self).__init__()
     self.candidates = []
     self.iwubi = IWubi()
     self.is_invalidate = False
     self.preedit_string = ''
     # new(page_size:int, cursor_pos:int, cursor_visible:bool, round:bool)
     self.lookup_table = IBus.LookupTable.new(5, 0, True, True)
     self.prop_list = IBus.PropList()
     self._input_mode = 0  # 0: Use direct input. 1: Use the WuBi table.
     self._prev_key = None
     self._last_wubi_list_len = 0
     logger.info("Create iwubi engine OK")
예제 #13
0
 def __init__(self) -> None:
     super(EngineDeepSpeech, self).__init__()
     self.recording = False
     self.worker_thread: Optional[DictationThread] = None
     self.__prop_list = IBus.PropList()
     self.__prop_list.append(
         IBus.Property(
             key="toggle-recording",
             icon="audio-input-microphone",
             type=IBus.PropType.TOGGLE,
             state=0,
             label="Toggle speech recognition",
         )
     )
예제 #14
0
 def __init_props(self):
     self.__prop_list = IBus.PropList()
     self.__input_mode_prop = IBus.Property(
         key='InputMode',
         prop_type=IBus.PropType.NORMAL,
         symbol=IBus.Text.new_from_string(self.__mode),
         label=IBus.Text.new_from_string('Input mode (%s)' % self.__mode),
         icon=None,
         tooltip=None,
         sensitive=False,
         visible=True,
         state=IBus.PropState.UNCHECKED,
         sub_props=None)
     self.__prop_list.append(self.__input_mode_prop)
예제 #15
0
    def __init__(self):
        super(EngineUnicodeDb, self).__init__()
        self.__is_invalidate = False
        self.__preedit_string = u""
        self.__lookup_table = IBus.LookupTable.new(10, 0, True, True)
        self.__prop_list = IBus.PropList()
        self.__prop_list.append(IBus.Property(key="test", icon="ibus-local"))

        self.__lookup_table.set_orientation(IBus.Orientation.VERTICAL)

        # initialize mmap
        self.__data = DataParse()

        print "Create EngineUnicodeDb OK"
예제 #16
0
    def __init__(self):
        super(LekhaneeEngine, self).__init__()
        #Transliterator
        np_base_keymap = base_keymap.base_keymap
        np_dictionary_file = "libLekhanee/dictionaries/ne_NP/ne_NP_plain.dic"
        self.__transliterator = Transliterator("ne_NP", np_base_keymap,
                                               np_dictionary_file)

        #
        self.__is_invalidate = False
        self.__preedit_string = u""
        self.__lookup_table = IBus.LookupTable.new(10, 0, True, True)
        self.__prop_list = IBus.PropList()
        self.__prop_list.append(IBus.Property(key="test", icon="ibus-local"))
        print "Create Lekhanee OK"
예제 #17
0
파일: ui.py 프로젝트: Narga/ibus-ringo
    def setup_tool_buttons(self):
        self.prop_list = IBus.PropList()

        pref_label = IBus.Text.new_from_string("Preferences")
        pref_tooltip = pref_label

        help_label = IBus.Text.new_from_string("Help")
        help_tooltip = help_label

        pref_button = IBus.Property.new(key="preferences",
                                        type=IBus.PropType.NORMAL,
                                        label=pref_label,
                                        icon="preferences-other",
                                        tooltip=pref_tooltip,
                                        sensitive=True,
                                        visible=True,
                                        state=0,
                                        prop_list=None)

        help_button = IBus.Property.new(key="help",
                                        type=IBus.PropType.NORMAL,
                                        label=help_label,
                                        icon="system-help",
                                        tooltip=help_tooltip,
                                        sensitive=True,
                                        visible=True,
                                        state=0,
                                        prop_list=None)

        mode_label = INPUT_MODE[self.engine.vietnameseMode]["label"]
        mode_symbol = INPUT_MODE[self.engine.vietnameseMode]["symbol"]
        mode_tooltip = IBus.Text.new_from_string("Switch input mode")

        self.input_mode_prop = IBus.Property(key='InputMode',
                                             prop_type=IBus.PropType.NORMAL,
                                             label=mode_label,
                                             symbol=mode_symbol,
                                             icon='',
                                             tooltip=mode_tooltip,
                                             sensitive=True,
                                             visible=True,
                                             state=IBus.PropState.UNCHECKED,
                                             sub_props=None)

        self.prop_list.append(self.input_mode_prop)
        self.prop_list.append(pref_button)
        self.prop_list.append(help_button)
        self.engine.register_properties(self.prop_list)
예제 #18
0
 def _init_input_mode_props(self):
     props = IBus.PropList()
     props.append(IBus.Property(key='InputMode.Alphanumeric',
                                prop_type=IBus.PropType.RADIO,
                                label=IBus.Text.new_from_string(_("Alphanumeric (A)")),
                                icon=None,
                                tooltip=None,
                                sensitive=True,
                                visible=True,
                                state=IBus.PropState.CHECKED,
                                sub_props=None))
     props.append(IBus.Property(key='InputMode.Hiragana',
                                prop_type=IBus.PropType.RADIO,
                                label=IBus.Text.new_from_string(_("Hiragana (あ)")),
                                icon=None,
                                tooltip=None,
                                sensitive=True,
                                visible=True,
                                state=IBus.PropState.UNCHECKED,
                                sub_props=None))
     props.append(IBus.Property(key='InputMode.Katakana',
                                prop_type=IBus.PropType.RADIO,
                                label=IBus.Text.new_from_string(_("Katakana (ア)")),
                                icon=None,
                                tooltip=None,
                                sensitive=True,
                                visible=True,
                                state=IBus.PropState.UNCHECKED,
                                sub_props=None))
     props.append(IBus.Property(key='InputMode.WideAlphanumeric',
                                prop_type=IBus.PropType.RADIO,
                                label=IBus.Text.new_from_string(_("Wide Alphanumeric (A)")),
                                icon=None,
                                tooltip=None,
                                sensitive=True,
                                visible=True,
                                state=IBus.PropState.UNCHECKED,
                                sub_props=None))
     props.append(IBus.Property(key='InputMode.HalfWidthKatakana',
                                prop_type=IBus.PropType.RADIO,
                                label=IBus.Text.new_from_string(_("Halfwidth Katakana (ア)")),
                                icon=None,
                                tooltip=None,
                                sensitive=True,
                                visible=True,
                                state=IBus.PropState.UNCHECKED,
                                sub_props=None))
     return props
예제 #19
0
    def __init__(self):
        super(UniEmoji, self).__init__()
        self.is_invalidate = False
        self.preedit_string = u""
        self.lookup_table = IBus.LookupTable.new(10, 0, True, True)
        self.prop_list = IBus.PropList()
        self.table = {}
        with codecs.open(os.path.join(__base_dir__, 'UnicodeData.txt'),
                         encoding='utf-8') as unicodedata:
            for line in unicodedata.readlines():
                if not line.strip(): continue
                code, name, category, _ = line.split(';', 3)
                code = int(code, 16)
                if not in_range(code):
                    continue
                if category not in ('Sm', 'So', 'Po'):
                    continue
                self.table[name.lower()] = unichr(code)

        # Load custom file(s)
        for d in reversed(SETTINGS_DIRS):
            custom_filename = os.path.join(d, 'custom.json')
            debug('Loading custom emoji from {}'.format(custom_filename))
            if os.path.isfile(custom_filename):
                custom_table = None
                try:
                    with codecs.open(custom_filename, encoding='utf-8') as f:
                        custom_table = json.loads(f.read())
                except:
                    error = sys.exc_info()[1]
                    debug(error)
                    self.table = {
                        u'Failed to load custom file {}: {}'.format(
                            custom_filename, error):
                        u'ERROR'
                    }
                    break
                else:
                    debug(custom_table)
                    self.table.update(custom_table)

        debug("Create UniEmoji engine OK")
예제 #20
0
파일: ui.py 프로젝트: loservn/ibus-ringo
    def setup_tool_buttons(self):
        self.prop_list = IBus.PropList()

        pref_label = IBus.Text.new_from_string("Preferences")
        pref_tooltip = pref_label

        help_label = IBus.Text.new_from_string("Help")
        help_tooltip = help_label

        pref_button = IBus.Property.new(key="preferences",
                                        type=IBus.PropType.NORMAL,
                                        label=pref_label,
                                        icon="preferences-other",
                                        tooltip=pref_tooltip,
                                        sensitive=True,
                                        visible=True,
                                        state=0,
                                        prop_list=None)
        help_button = IBus.Property.new(key="help",
                                        type=IBus.PropType.NORMAL,
                                        label=help_label,
                                        icon="system-help",
                                        tooltip=help_tooltip,
                                        sensitive=True,
                                        visible=True,
                                        state=0,
                                        prop_list=None)
        self.input_mode_prop = IBus.Property(
            key='InputMode',
            prop_type=IBus.PropType.MENU,
            label=IBus.Text.new_from_string("BoGo"),
            symbol=IBus.Text.new_from_string("ấ"),
            icon='',
            tooltip=IBus.Text.new_from_string("Switch input mode"),
            sensitive=True,
            visible=True,
            state=IBus.PropState.UNCHECKED,
            sub_props=None)
        self.prop_list.append(self.input_mode_prop)
        self.prop_list.append(pref_button)
        self.prop_list.append(help_button)
예제 #21
0
    def __init__(self):
        super(EngineSharadaBraille, self).__init__()
        self.pressed_keys = u""

        Config = configparser.ConfigParser()
        if (Config.read("{}/isb.cfg".format(home_dir)) == []):
            self.checked_languages = ["english-en", "hindi-hi"]
            self.simple_mode = 0
            self.keycode_map = {
                33: "1",
                32: "2",
                31: "3",
                36: "4",
                37: "5",
                38: "6",
                30: "7",
                34: "8",
                35: "9",
                39: "0"
            }
            self.key_to_switch_between_languages = 119
            self.list_switch_key = 56
            self.language_iter = 0
        else:
            self.checked_languages = Config.get('cfg',
                                                "checked_languages").split(",")
            self.simple_mode = int(Config.get('cfg', "simple-mode"))
            self.keycode_map = {}
            for key, value in {
                    "dot-1": "1",
                    "dot-2": "2",
                    "dot-3": "3",
                    "dot-4": "4",
                    "dot-5": "5",
                    "dot-6": "6",
                    "punctuation_key": "0",
                    "capitol_switch_key": "8",
                    "letter_deletion_key": "9",
                    "abbreviation_key": "7"
            }.items():
                self.keycode_map[int(Config.get('cfg', key))] = value
            self.key_to_switch_between_languages = int(
                Config.get('cfg', "switch_between_languages"))
            self.list_switch_key = int(Config.get('cfg', "list_switch_key"))
            self.language_iter = int(Config.get('cfg', "default-language"))

        #Braille Iter's
        self.braille_letter_map_pos = 0

        #capital switch
        self.capital_switch = 0
        self.capital = 0

        self.__is_invalidate = False
        self.__preedit_string = ""
        self.__lookup_table = IBus.LookupTable.new(10, 0, True, True)
        self.__prop_list = IBus.PropList()
        self.__prop_list.append(IBus.Property(key="test", icon="ibus-local"))

        #Load the first language by default
        self.load_map(self.checked_languages[self.language_iter])
예제 #22
0
    def __init__(self):
        super(UniEmoji, self).__init__()
        self.is_invalidate = False
        self.preedit_string = ''
        self.lookup_table = IBus.LookupTable.new(10, 0, True, True)
        self.prop_list = IBus.PropList()
        self.table = defaultdict(UniEmojiChar)
        self.unicode_chars_to_names = {}
        self.unicode_chars_to_shortnames = {}
        self.ascii_table = {}
        self.reverse_ascii_table = {}
        self.alias_table = {}
        with codecs.open(os.path.join(__base_dir__, 'UnicodeData.txt'),
                         encoding='utf-8') as unicodedata:
            for line in unicodedata.readlines():
                if not line.strip(): continue
                code, name, category, _ = line.split(';', 3)
                code = int(code, 16)
                if category not in VALID_CATEGORIES:
                    continue
                if not in_range(code):
                    continue
                name = name.lower()
                unicode_char = chr(code)
                self.table[name] = UniEmojiChar(unicode_char)
                self.unicode_chars_to_names[unicode_char] = name

        # Load emojione file
        alias_counter = Counter()
        temp_alias_table = defaultdict(set)

        emojione = json.load(
            codecs.open(os.path.join(__base_dir__, 'emojione.json'),
                        encoding='utf-8'))
        for emoji_shortname, info in emojione.items():

            # ZWJ emojis such as 'family', 'couple', and 'kiss' appear in an
            # alternate field
            alternate_form = info.get('unicode_alternates')
            if alternate_form and '200d' in alternate_form:
                chars = alternate_form
            else:
                chars = info['unicode']

            unicode_str = ''.join(
                chr(int(codepoint, 16)) for codepoint in chars.split('-'))
            self.unicode_chars_to_shortnames[unicode_str] = emoji_shortname

            emoji_shortname = emoji_shortname.replace('_', ' ')

            if emoji_shortname in self.table:
                # Check for clashes between emojione's names and the existing unicode name.
                # Clashes turn into aliases.
                if unicode_str != self.table[emoji_shortname].unicode_str:
                    self.table[emoji_shortname].aliasing.append(unicode_str)
            elif info['category'] == 'flags':
                flag_name = 'flag of ' + info['name']
                self.table[flag_name] = UniEmojiChar(unicode_str,
                                                     is_emojione=True)
                self.unicode_chars_to_names[unicode_str] = flag_name
            else:
                self.table[emoji_shortname] = UniEmojiChar(unicode_str,
                                                           is_emojione=True)

            # When the string defined by emojione isn't in Unicode
            # (because it's a combination of characters), use emojione's
            # descriptive name, and set the shortname as an alias
            if unicode_str not in self.unicode_chars_to_names:
                long_name = info['name']
                self.unicode_chars_to_names[unicode_str] = long_name
                if long_name not in self.table:
                    self.table[long_name] = UniEmojiChar(unicode_str)

            # EmojiOne has duplicate entries in the keywords array
            keywords = set(info.get('keywords', []))
            for alias in keywords:
                alias_counter[alias] += 1
                temp_alias_table[alias].add(unicode_str)

            for ascii_aliases in info.get('aliases_ascii', []):
                self.ascii_table[ascii_aliases] = unicode_str
                self.reverse_ascii_table[unicode_str] = info['name']

        # Load less-frequent aliases from emojione file
        for alias, n in alias_counter.most_common():
            if n >= 20:
                continue
            self.table[alias].aliasing.extend(temp_alias_table[alias])

        # Load custom file(s)
        for d in reversed(SETTINGS_DIRS):
            custom_filename = os.path.join(d, 'custom.json')
            debug('Loading custom emoji from {}'.format(custom_filename))
            if os.path.isfile(custom_filename):
                custom_table = None
                try:
                    with codecs.open(custom_filename, encoding='utf-8') as f:
                        custom_table = json.loads(f.read())
                except:
                    error = sys.exc_info()[1]
                    debug(error)
                    self.table = {
                        'Failed to load custom file {}: {}'.format(
                            custom_filename, error):
                        'ERROR'
                    }
                    break
                else:
                    debug(custom_table)
                    for k, v in custom_table.items():
                        self.table[k] = UniEmojiChar(v, is_custom=True)

        debug("Create UniEmoji engine OK")
예제 #23
0
 def __init_props(self):
     self.__prop_list = IBus.PropList()
     self.__charset_prop_menu = self.__init_charset_prop_menu()
     self.__prop_list.append(self.__charset_prop_menu)
예제 #24
0
    def __init__(self):
        super(EngineSharadaBraille, self).__init__()
        self.pressed_keys = u""

        Config = configparser.ConfigParser()
        try:
            Config.read("{}/isb.cfg".format(home_dir))
            self.checked_languages = Config.get('cfg',
                                                "checked_languages").split(",")
            self.simple_mode = int(Config.get('cfg', "simple-mode"))
            self.keycode_map = {}
            for key, value in {
                    "dot-1": "1",
                    "dot-2": "2",
                    "dot-3": "3",
                    "dot-4": "4",
                    "dot-5": "5",
                    "dot-6": "6",
                    "dot-7": "7",
                    "dot-8": "8",
                    "punctuation_key": "0",
                    "capitol_switch_key": "c",
                    "letter_deletion_key": "9",
                    "abbreviation_key": "a",
                    "one_hand_skip_key": "o"
            }.items():
                self.keycode_map[int(Config.get('cfg', key))] = value
            self.key_to_switch_between_languages = int(
                Config.get('cfg', "switch_between_languages"))
            self.list_switch_key = int(Config.get('cfg', "list_switch_key"))
            self.language_iter = int(Config.get('cfg', "default-language"))
            self.conventional_braille = int(
                Config.get('cfg', "conventional-braille"))
            self.liblouis_mode = int(Config.get('cfg', "liblouis-mode"))
            self.one_hand_mode = int(Config.get('cfg', "one-hand-mode"))
            self.one_hand_conversion_delay = int(
                Config.get('cfg', "one-hand-conversion-delay")) * 1 / 1000
            self.liblouis_table_list = Config.get(
                'cfg', "liblouis-table-list").split(",")
        except:
            self.checked_languages = ["english-en", "hindi-hi"]
            self.simple_mode = 0
            self.keycode_map = {
                33: "1",
                32: "2",
                31: "3",
                36: "4",
                37: "5",
                38: "6",
                44: "7",
                52: "8",
                30: "a",
                34: "c",
                35: "9",
                39: "0"
            }
            self.key_to_switch_between_languages = 119
            self.list_switch_key = 56
            self.language_iter = 0
            self.conventional_braille = False
            self.one_hand_mode = False
            self.one_hand_conversion_delay = 0.5
            self.liblouis_mode = False
            self.liblouis_table_list = ['unicode.dis', 'en-us-g2.ctb']

        self.conventional_braille_dot_4 = False
        self.conventional_braille_dot_4_pass = False
        self.conventional_braille_dot_3 = False

        #Three dot braille
        self.three_dot_pos = 1

        #Braille Iter's
        self.braille_letter_map_pos = 0

        #capital switch
        self.capital_switch = 0
        self.capital = 0

        self.__is_invalidate = False
        self.__preedit_string = ""
        self.__lookup_table = IBus.LookupTable.new(10, 0, True, True)
        self.__prop_list = IBus.PropList()
        self.__prop_list.append(IBus.Property(key="test", icon="ibus-local"))

        #Load the first language by default
        self.load_map(self.checked_languages[self.language_iter])