mod: rm unused shortcuts in crereader

pull/2/merge
Qingping Hou 12 years ago
parent 9650a4a057
commit 5e58a94632

@ -88,6 +88,7 @@ function Commands:addGroup(keygroup,keys,help,func)
end
end
--@TODO handle MOD_ANY 06.04 2012 (houqp)
function Commands:del(keycode, modifier, keydescr)
local keydef = nil
@ -106,6 +107,16 @@ function Commands:del(keycode, modifier, keydescr)
self.map[keydef] = nil
end
function Commands:delGroup(keygroup)
if keygroup then
for k,v in pairs(self.map) do
if v.keygroup == keygroup then
self.map[k] = nil
end
end -- EOF for
end
end
function Commands:_addImpl(keydef,help,func,keygroup)
if keydef.modifier==MOD_ANY then
self:addGroup(keygroup or keydef.descr,{Keydef:new(keydef.keycode,nil), Keydef:new(keydef.keycode,MOD_SHIFT), Keydef:new(keydef.keycode,MOD_ALT)},help,func)

@ -131,6 +131,7 @@ end
function CREReader:adjustCreReaderCommands()
-- delete commands
self.commands:delGroup("[joypad]")
self.commands:del(KEY_G, nil, "G")
self.commands:del(KEY_J, nil, "J")
self.commands:del(KEY_K, nil, "K")

@ -13,6 +13,27 @@ function DJVUReader:open(filename)
return ok
end
function DJVUReader:init()
self:addAllCommands()
self:adjustDjvuReaderCommand()
end
function DJVUReader:adjustDjvuReaderCommand()
self.commands:add(KEY_N, nil, "N",
"start highlight mode",
function(unireader)
unireader:startHighLightMode()
unireader:goto(unireader.pageno)
end
)
self.commands:add(KEY_N, MOD_SHIFT, "N",
"display all highlights",
function(unireader)
unireader:showHighLight()
unireader:goto(unireader.pageno)
end
)
end
-----------[ highlight support ]----------

@ -1096,18 +1096,6 @@ function UniReader:addAllCommands()
function(unireader)
unireader:screenRotate("anticlockwise")
end)
self.commands:add(KEY_N, nil, "N",
"start highlight mode",
function(unireader)
unireader:startHighLightMode()
unireader:goto(unireader.pageno)
end)
self.commands:add(KEY_N, MOD_SHIFT, "N",
"display all highlights",
function(unireader)
unireader:showHighLight()
unireader:goto(unireader.pageno)
end)
self.commands:add(KEY_R, MOD_SHIFT, "R",
"manual full screen refresh",
function(unireader)

Loading…
Cancel
Save