Auto-detect the touchscreen input device on the PW4 (#5113)

Once again, LTE devices have an extra proximity sensors that shifts the
evdev path by one...

Fix #5110
pull/5124/head
NiLuJe 5 years ago committed by GitHub
parent 912e617377
commit 564ee15679
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

@ -347,6 +347,9 @@ local KindlePaperWhite4 = Kindle:new{
isTouchDevice = yes,
hasFrontlight = yes,
display_dpi = 300,
-- NOTE: LTE devices once again have a mysterious extra SX9310 proximity sensor...
-- Except this time, we can't rely on by-path, because there's no entry for the TS :/.
-- Should be event2 on WiFi, event3 on LTE, we'll fix it in init.
touch_dev = "/dev/input/event2",
}
@ -740,6 +743,16 @@ function KindlePaperWhite4:init()
Kindle.init(self)
-- So, look for a goodix TS input device (c.f., #5110)...
local std_out = io.popen("grep -e 'Handlers\\|Name=' /proc/bus/input/devices | grep -A1 'goodix-ts' | grep -o 'event[0-9]'", "r")
if std_out then
local goodix_dev = std_out:read()
std_out:close()
if goodix_dev then
self.touch_dev = "/dev/input/" .. goodix_dev
end
end
self.input.open(self.touch_dev)
self.input.open("fake_events")
end

Loading…
Cancel
Save