From 41e9b216cc6df3a5d6b6ae6834d9e170bb2691a2 Mon Sep 17 00:00:00 2001 From: traycold Date: Tue, 6 Mar 2012 23:46:10 +0100 Subject: [PATCH] Shortcut to jump to page corresponding to 0%, 10%, 20%, .., 100% of document using respectively key 1, 2, .., 9, 0. --- unireader.lua | 20 ++++++++++++++++++++ 1 file changed, 20 insertions(+) diff --git a/unireader.lua b/unireader.lua index acd8cd733..f8266dbe2 100644 --- a/unireader.lua +++ b/unireader.lua @@ -531,6 +531,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)