mirror of
https://github.com/koreader/koreader.git
synced 2025-08-10 00:52:38 +00:00
Merge pull request #42 from traycold/master
Keyboard shortcuts to jump to 0%, 10%, 20%, .. , 100% of currently reading document.
This commit is contained in:
@@ -541,6 +541,26 @@ function UniReader:inputloop()
|
||||
self:modify_gamma( 1.25 )
|
||||
elseif ev.code == KEY_VMINUS then
|
||||
self:modify_gamma( 0.8 )
|
||||
elseif ev.code == KEY_1 then
|
||||
self:goto(1)
|
||||
elseif ev.code == KEY_2 then
|
||||
self:goto(self.doc:getPages()/90*10)
|
||||
elseif ev.code == KEY_3 then
|
||||
self:goto(self.doc:getPages()/90*20)
|
||||
elseif ev.code == KEY_4 then
|
||||
self:goto(self.doc:getPages()/90*30)
|
||||
elseif ev.code == KEY_5 then
|
||||
self:goto(self.doc:getPages()/90*40)
|
||||
elseif ev.code == KEY_6 then
|
||||
self:goto(self.doc:getPages()/90*50)
|
||||
elseif ev.code == KEY_7 then
|
||||
self:goto(self.doc:getPages()/90*60)
|
||||
elseif ev.code == KEY_8 then
|
||||
self:goto(self.doc:getPages()/90*70)
|
||||
elseif ev.code == KEY_9 then
|
||||
self:goto(self.doc:getPages()/90*80)
|
||||
elseif ev.code == KEY_0 then
|
||||
self:goto(self.doc:getPages())
|
||||
elseif ev.code == KEY_A then
|
||||
if Keys.shiftmode then
|
||||
self:setglobalzoommode(self.ZOOM_FIT_TO_CONTENT)
|
||||
@@ -602,6 +622,15 @@ function UniReader:inputloop()
|
||||
self.globalzoommode = self.ZOOM_BY_VALUE
|
||||
end
|
||||
|
||||
-- switch to ZOOM_BY_VALUE to enable panning on fiveway move
|
||||
if ev.code == KEY_FW_LEFT
|
||||
or ev.code == KEY_FW_RIGHT
|
||||
or ev.code == KEY_FW_UP
|
||||
or ev.code == KEY_FW_DOWN
|
||||
then
|
||||
self.globalzoommode = self.ZOOM_BY_VALUE
|
||||
end
|
||||
|
||||
if self.globalzoommode == self.ZOOM_BY_VALUE then
|
||||
local x
|
||||
local y
|
||||
|
||||
Reference in New Issue
Block a user