From cc38d9e6fcd8b51d16d9d39e6bdcb5cae9eab2db Mon Sep 17 00:00:00 2001 From: Qingping Hou Date: Sat, 8 Dec 2012 01:06:47 -0500 Subject: [PATCH] add KT support --- frontend/ui/device.lua | 11 +++++++++-- frontend/ui/inputevent.lua | 6 +++++- 2 files changed, 14 insertions(+), 3 deletions(-) diff --git a/frontend/ui/device.lua b/frontend/ui/device.lua index aaa3b1525..915b60447 100644 --- a/frontend/ui/device.lua +++ b/frontend/ui/device.lua @@ -15,9 +15,16 @@ function Device:getModel() end end if cpu_mod == "MX50" then - local f = lfs.attributes("/sys/devices/system/fl_tps6116x/fl_tps6116x0/fl_intensity") - if f then + -- for KPW + local pw_test_fd = lfs.attributes("/sys/devices/system/fl_tps6116x/fl_tps6116x0/fl_intensity") + -- for KT + local kt_test_fd = lfs.attributes("/sys/devices/platform/whitney-button") + -- another special file for KT is Neonode zForce touchscreen: + -- /sys/devices/platform/zforce.0/ + if pw_test_fd then return "KindlePaperWhite" + elseif kt_test_fd then + return "KindleTouch" else return "Kindle4" end diff --git a/frontend/ui/inputevent.lua b/frontend/ui/inputevent.lua index 89a496f29..efd2a58b8 100644 --- a/frontend/ui/inputevent.lua +++ b/frontend/ui/inputevent.lua @@ -239,13 +239,17 @@ function Input:init() else input.open("fake_events") local dev_mod = Device:getModel() - + -- open event0 for all models input.open("/dev/input/event0") if dev_mod ~= "KindlePaperWhite" then -- we don't have event1 in KindlePaperWhite input.open("/dev/input/event1") elseif dev_mod == "KindlePaperWhite" then print("Auto-detected Kindle PaperWhite") + elseif dev_mod == "KindleTouch" then + input.open("/dev/input/event2") + input.open("/dev/input/event3") + print("Auto-detected Kindle Touch") elseif dev_mod == "Kindle4" then print("Auto-detected Kindle 4") self:adjustKindle4EventMap()