@@ -41,60 +41,79 @@ local ReaderPaging = InputContainer:extend{
4141}
4242
4343function ReaderPaging :init ()
44- self .key_events = {}
4544 if Device :hasKeys () then
4645 self .key_events .GotoNextPage = {
47- { {" RPgFwd" , " LPgFwd" , " Right" } }, doc = " go to next page" ,
48- event = " GotoViewRel" , args = 1 ,
46+ { { " RPgFwd" , " LPgFwd" , not Device :hasFewKeys () and " Right" } },
47+ event = " GotoViewRel" ,
48+ args = 1 ,
4949 }
5050 self .key_events .GotoPrevPage = {
51- { { " RPgBack" , " LPgBack" , " Left" } }, doc = " go to previous page" ,
52- event = " GotoViewRel" , args = - 1 ,
51+ { { " RPgBack" , " LPgBack" , not Device :hasFewKeys () and " Left" } },
52+ event = " GotoViewRel" ,
53+ args = - 1 ,
5354 }
54- if Device :hasFewKeys () then
55- table.remove (self .key_events .GotoNextPage [1 ][1 ], 3 ) -- right
56- table.remove (self .key_events .GotoPrevPage [1 ][1 ], 3 ) -- left
57- end
5855 self .key_events .GotoNextPos = {
59- { {" Down" } }, doc = " go to next position" ,
60- event = " GotoPosRel" , args = 1 ,
56+ { " Down" },
57+ event = " GotoPosRel" ,
58+ args = 1 ,
6159 }
6260 self .key_events .GotoPrevPos = {
63- { { " Up" } }, doc = " go to previous position" ,
64- event = " GotoPosRel" , args = - 1 ,
61+ { " Up" },
62+ event = " GotoPosRel" ,
63+ args = - 1 ,
6564 }
6665
6766 end
6867 if Device :hasKeyboard () then
6968 self .key_events .GotoFirst = {
70- {" 1" }, doc = " go to start" , event = " GotoPercent" , args = 0 ,
69+ { " 1" },
70+ event = " GotoPercent" ,
71+ args = 0 ,
7172 }
7273 self .key_events .Goto11 = {
73- {" 2" }, doc = " go to 11%" , event = " GotoPercent" , args = 11 ,
74+ { " 2" },
75+ event = " GotoPercent" ,
76+ args = 11 ,
7477 }
7578 self .key_events .Goto22 = {
76- {" 3" }, doc = " go to 22%" , event = " GotoPercent" , args = 22 ,
79+ { " 3" },
80+ event = " GotoPercent" ,
81+ args = 22 ,
7782 }
7883 self .key_events .Goto33 = {
79- {" 4" }, doc = " go to 33%" , event = " GotoPercent" , args = 33 ,
84+ { " 4" },
85+ event = " GotoPercent" ,
86+ args = 33 ,
8087 }
8188 self .key_events .Goto44 = {
82- {" 5" }, doc = " go to 44%" , event = " GotoPercent" , args = 44 ,
89+ { " 5" },
90+ event = " GotoPercent" ,
91+ args = 44 ,
8392 }
8493 self .key_events .Goto55 = {
85- {" 6" }, doc = " go to 55%" , event = " GotoPercent" , args = 55 ,
94+ { " 6" },
95+ event = " GotoPercent" ,
96+ args = 55 ,
8697 }
8798 self .key_events .Goto66 = {
88- {" 7" }, doc = " go to 66%" , event = " GotoPercent" , args = 66 ,
99+ { " 7" },
100+ event = " GotoPercent" ,
101+ args = 66 ,
89102 }
90103 self .key_events .Goto77 = {
91- {" 8" }, doc = " go to 77%" , event = " GotoPercent" , args = 77 ,
104+ { " 8" },
105+ event = " GotoPercent" ,
106+ args = 77 ,
92107 }
93108 self .key_events .Goto88 = {
94- {" 9" }, doc = " go to 88%" , event = " GotoPercent" , args = 88 ,
109+ { " 9" },
110+ event = " GotoPercent" ,
111+ args = 88 ,
95112 }
96113 self .key_events .GotoLast = {
97- {" 0" }, doc = " go to end" , event = " GotoPercent" , args = 100 ,
114+ { " 0" },
115+ event = " GotoPercent" ,
116+ args = 100 ,
98117 }
99118 end
100119 self .pan_interval = time .s (1 / self .pan_rate )
@@ -106,7 +125,8 @@ function ReaderPaging:onReaderReady()
106125end
107126
108127function ReaderPaging :setupTouchZones ()
109- self .ges_events = {}
128+ -- delegate gesture listener to readerui
129+ self .ges_events = nil
110130 self .onGesture = nil
111131 if not Device :isTouchDevice () then return end
112132
0 commit comments