diff --git a/commands.lua b/commands.lua index 43dfca87d..a6622ac43 100644 --- a/commands.lua +++ b/commands.lua @@ -62,8 +62,15 @@ Commands = { size = 0 } function Commands:add(keycode,modifier,keydescr,help,func) - local keydef = Keydef:new(keycode,modifier,keydescr) - self:_addImpl(keydef,help,func) + if type(keycode) == "table" then + for i=1,#keycode,1 do + local keydef = Keydef:new(keycode[i],modifier,keydescr) + self:_addImpl(keydef,help,func) + end + else + local keydef = Keydef:new(keycode,modifier,keydescr) + self:_addImpl(keydef,help,func) + end end function Commands:addGroup(keygroup,keys,help,func) for _k,keydef in pairs(keys) do diff --git a/keys.lua b/keys.lua index 43e683120..489a93e05 100644 --- a/keys.lua +++ b/keys.lua @@ -123,6 +123,8 @@ end function setEmuKeycodes() KEY_PGFWD = 117 KEY_PGBCK = 112 + KEY_LPGBCK = 69 -- F3 + KEY_LPGFWD = 70 -- F4 KEY_HOME = 110 -- home KEY_BACK = 22 -- backspace KEY_DEL = 119 -- Delete diff --git a/unireader.lua b/unireader.lua index bf190fabd..b2cb982a1 100644 --- a/unireader.lua +++ b/unireader.lua @@ -875,12 +875,12 @@ end -- command definitions function UniReader:addAllCommands() self.commands = Commands:new() - self.commands:add(KEY_PGFWD,nil,">", + self.commands:add({KEY_PGFWD,KEY_LPGFWD},nil,">", "next page", function(unireader) unireader:goto(unireader:nextView()) end) - self.commands:add(KEY_PGBCK,nil,"<", + self.commands:add({KEY_PGBCK,KEY_LPGBCK},nil,"<", "previous page", function(unireader) unireader:goto(unireader:prevView()) @@ -1175,6 +1175,5 @@ function UniReader:addAllCommands() end end) -- end panning - --print defined commands - --for k,v in pairs(self.commands.map) do print(v) end + print("## defined commands "..dump(self.commands.map)) end