Skip to content

Commit

Permalink
Request the default orientation of the lookup table.
Browse files Browse the repository at this point in the history
  • Loading branch information
ueno committed Dec 29, 2009
1 parent d4fa90d commit 6ae5121
Showing 1 changed file with 15 additions and 2 deletions.
17 changes: 15 additions & 2 deletions engine/engine.py
Original file line number Diff line number Diff line change
Expand Up @@ -116,6 +116,7 @@ def __init__(self, bus, object_path):
self.__lookup_table = ibus.LookupTable(page_size=page_size,
labels=labels,
round=False)
self.__lookup_table.set_orientation(1)
self.__candidate_selector = CandidateSelector(self.__lookup_table,
page_size,
pagination_start)
Expand Down Expand Up @@ -248,11 +249,23 @@ def process_key_event(self, keyval, keycode, state):
self.page_down()
return True
elif keyval in (keysyms.Up, keysyms.Left):
self.__candidate_selector.previous_candidate(False)
orientation = self.__lookup_table.get_orientation()
if (orientation == 1 and keyval == keysyms.Up) or \
(orientation == 2 and keyval == keysyms.Left):
pagination = True
else:
pagination = False
self.__candidate_selector.previous_candidate(pagination)
self.__update()
return True
elif keyval in (keysyms.Down, keysyms.Right):
self.__candidate_selector.next_candidate(False)
orientation = self.__lookup_table.get_orientation()
if (orientation == 1 and keyval == keysyms.Down) or \
(orientation == 2 and keyval == keysyms.Right):
pagination = True
else:
pagination = False
self.__candidate_selector.next_candidate(pagination)
self.__update()
return True
elif self.__candidate_selector.lookup_table_visible() and \
Expand Down

0 comments on commit 6ae5121

Please sign in to comment.