bugfix: hack swipe to unlock after going out of screensaver

by feeding a fake tap at the bottom of the screen
This commit is contained in:
chrox
2013-03-17 19:33:59 +08:00
parent d00ee9b6de
commit 819467df0b
3 changed files with 25 additions and 1 deletions

View File

@@ -34,11 +34,22 @@ function exitReader()
input.closeAll()
if util.isEmulated() ==0 then
if util.isEmulated() == 0 then
if Device:isKindle3() or (Device:getModel() == "KindleDXG") then
-- send double menu key press events to trigger screen refresh
os.execute("echo 'send 139' > /proc/keypad;echo 'send 139' > /proc/keypad")
end
if Device:isTouchDevice() and Device.survive_screen_saver then
-- hack the swipe to unlock screen
local dev = Device:getTouchInputDev()
if dev then
local width, height = Screen:getWidth(), Screen:getHeight()
input.fakeTapInput(dev,
math.min(width, height)/2,
math.max(width, height)-30
)
end
end
end
end