add two finger swipe gestures for showing TOC and bookmarks

two_finger_swipe to east is for TOC
two_finger_swipe to west is for bookmarks
This commit is contained in:
chrox
2014-02-12 20:32:23 +08:00
parent 4fcb39494c
commit f21d34f682
3 changed files with 38 additions and 1 deletions

View File

@@ -18,11 +18,26 @@ local ReaderBookmark = InputContainer:new{
function ReaderBookmark:init()
if Device:hasKeyboard() then
self.key_events = {
ShowToc = {
ShowBookmark = {
{ "B" },
doc = _("show bookmarks") },
}
end
if Device:isTouchDevice() then
self.ges_events = {
ShowBookmark = {
GestureRange:new{
ges = "two_finger_swipe",
range = Geom:new{
x = 0, y = 0,
w = Screen:getWidth(),
h = Screen:getHeight(),
},
direction = "west"
}
},
}
end
self.ui.menu:registerToMainMenu(self)
end