mirror of
https://github.com/koreader/koreader.git
synced 2025-08-10 00:52:38 +00:00
screenshot shorcut patch by NuPogodi@mobileread
This commit is contained in:
@@ -37,6 +37,7 @@ function CREReader:open(filename)
|
||||
end
|
||||
|
||||
-- detect file type for documents inside zip file
|
||||
-- @TODO do the detection after the file is unzipped 30.04 2012 (houqp)
|
||||
if file_type == "zip" then
|
||||
-- store filename without zip-extention to fn
|
||||
local fn = string.lower(string.sub(filename,0,-4))
|
||||
|
||||
@@ -2402,6 +2402,17 @@ function UniReader:addAllCommands()
|
||||
unireader:goto(unireader.pageno)
|
||||
end
|
||||
)
|
||||
self.commands:add(KEY_P, MOD_SHIFT, "P",
|
||||
"make screenshot",
|
||||
function(unireader)
|
||||
--@TODO convert bitmap to png or jpeg 30.04 2012 (houqp)
|
||||
os.execute("mkdir ".."/mnt/us/kindlepdfviewer/screenshots")
|
||||
local d = os.date("%Y%m%d%H%M%S")
|
||||
InfoMessage:show("making screenshot...", 1)
|
||||
os.execute("dd ".."if=/dev/fb0 ".."of=/mnt/us/kindlepdfviewer/screenshots/" .. d .. ".raw")
|
||||
unireader:redrawCurrentPage()
|
||||
end
|
||||
)
|
||||
-- commands.map is very large, impacts startup performance on device
|
||||
--debug("defined commands "..dump(self.commands.map))
|
||||
end
|
||||
|
||||
Reference in New Issue
Block a user