mirror of
https://github.com/koreader/koreader.git
synced 2025-08-10 00:52:38 +00:00
KT input device patch from eureka
* add KT detection * remove unnacessary input device for KT
This commit is contained in:
@@ -67,7 +67,7 @@ end
|
||||
|
||||
function Device:isTouchDevice()
|
||||
local model = self:getModel()
|
||||
return (model == "Kindle4") or (model == "KindlePaperWhite") or util.isEmulated()
|
||||
return (model == "Kindle4") or (model == "KindlePaperWhite") or (model == "KindleTouch") or util.isEmulated()
|
||||
end
|
||||
|
||||
function Device:intoScreenSaver()
|
||||
|
||||
@@ -239,16 +239,20 @@ 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
|
||||
if dev_mod ~= "KindleTouch" then
|
||||
-- event0 in KindleTouch is "WM8962 Beep Generator" (useless)
|
||||
input.open("/dev/input/event0")
|
||||
end
|
||||
if dev_mod ~= "KindleTouch" and dev_mod ~= "KindlePaperWhite" then
|
||||
-- event1 in KindleTouch is "imx-yoshi Headset" (useless)
|
||||
-- and we don't have event1 in KindlePaperWhite
|
||||
input.open("/dev/input/event1")
|
||||
elseif dev_mod == "KindlePaperWhite" then
|
||||
end
|
||||
if dev_mod == "KindlePaperWhite" then
|
||||
print("Auto-detected Kindle PaperWhite")
|
||||
elseif dev_mod == "KindleTouch" then
|
||||
input.open("/dev/input/event2")
|
||||
input.open("/dev/input/event3")
|
||||
input.open("/dev/input/event2") -- Home button
|
||||
input.open("/dev/input/event3") -- touchscreen
|
||||
print("Auto-detected Kindle Touch")
|
||||
elseif dev_mod == "Kindle4" then
|
||||
print("Auto-detected Kindle 4")
|
||||
|
||||
Reference in New Issue
Block a user