mirror of
https://github.com/koreader/koreader.git
synced 2025-08-10 00:52:38 +00:00
add KT support
This commit is contained in:
@@ -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
|
||||
|
||||
@@ -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()
|
||||
|
||||
Reference in New Issue
Block a user