mod: screen rotation implemented by ioctl

Now you get a instance rotate :) With only one bug.
I have to restore to previous rotation state of the
native system after exists. Because the native system
does poll the new rotation state that changed by ioctl.

Currently, I don't know how to force the native system
to detect the changes.
This commit is contained in:
Qingping Hou
2012-03-09 18:34:56 +08:00
parent f795bda6e0
commit 319826c385
5 changed files with 62 additions and 32 deletions

View File

@@ -114,6 +114,7 @@ fb = einkfb.open("/dev/fb0")
width, height = fb:getSize()
-- read current rotation mode
Screen:updateRotationMode()
origin_rotation_mode = Screen.cur_rotation_mode
-- set up reader's setting: font
reader_settings = DocSettings:open(".reader")
@@ -158,6 +159,10 @@ end
reader_settings:savesetting("cfont", FontChooser.cfont)
reader_settings:close()
-- @TODO dirty workaround, find a way to force native system poll
-- screen orientation and upside down mode 09.03 2012
fb:setOrientation(origin_rotation_mode)
input.closeAll()
--os.execute('test -e /proc/keypad && echo "send '..KEY_HOME..'" > /proc/keypad ')
if optarg["d"] ~= "emu" then