Change util.isEmulated to boolean and fix frontlight

Device:hasFrontlight always returned a true-like value because util.isEmulated was an integer.
Fixed this, also, used a polymorphic object design to reduce FrontLight code, and
adapted BaseFrontLight for the emulator.
This commit is contained in:
Paulo Matias
2013-08-22 10:10:29 -03:00
parent 945c4b3470
commit d7b747d6dd
4 changed files with 21 additions and 15 deletions

View File

@@ -24,7 +24,7 @@ function exitReader()
input.closeAll()
if util.isEmulated() == 0 then
if not util.isEmulated() 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")