Using Quick (速成) with ibus

It surely is a nightmare for ubuntu users who type in Quick (速成) – from begin 10.04 scim is no longer the default but ibus. I am not saying ibus is bad, it really isn’t. OMHO it’s more stable and crashes less. The problem is that I type in Quick – and the table engine of ibus is, well, too primitive. The UI doesn’t expose any settings. And since I learned typing quick when I was still a Windows kid I can barely type any Chinese with ibus’s Quick because page size is different, spacebar always pick the first character instead of switching to the next page, and candidate orders are different from the classic one. Fortunately a trivial patch will fix it and I hope this can save someone’s life:


--- /usr/share/ibus-table/engine/table.py 2010-06-22 16:09:33.000000000 +0800
+++ table.py 2010-10-12 11:45:06.000000000 +0800
@@ -123,7 +123,7 @@ class editor(object):
else:
if self.db._is_chinese:
# if IME declare as Chinese IME
- return 0
+ return 4
else:
return -1
except:
@@ -831,7 +831,7 @@ class tabengine (ibus.EngineBase):
# _new_phrase_color = 0xffffff

# lookup table page size
- _page_size = 6
+ _page_size = 9

def __init__ (self, bus, obj_path, db ):
super(tabengine,self).__init__ (bus,obj_path)
@@ -870,7 +870,7 @@ class tabengine (ibus.EngineBase):
del self._chars

# check whether we can use '=' and '-' for page_down/up
- self._page_down_keys = [keysyms.Page_Down, keysyms.KP_Page_Down]
+ self._page_down_keys = [keysyms.space, keysyms.Page_Down, keysyms.KP_Page_Down]
self._page_up_keys = [keysyms.Page_Up, keysyms.KP_Page_Up]
if '=' not in self._valid_input_chars \
and '-' not in self._valid_input_chars:
@@ -1436,7 +1436,7 @@ class tabengine (ibus.EngineBase):
self._update_ui ()
return res

- elif key.code == keysyms.space:
+ elif len (self._editor._chars[0]) < self._editor._max_key_len and key.code == keysyms.space:
o_py = self._editor._py_mode
sp_res = self._editor.space ()
#return (KeyProcessResult,whethercommit,commitstring)

or get it from pastebin

One Response

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s

%d bloggers like this: