From fc89b1affaa6b8a0b80694240a5584e66766d364 Mon Sep 17 00:00:00 2001 From: Alistair Francis Date: Tue, 4 Jul 2023 17:08:31 +1000 Subject: [PATCH] Remarkable: support the mainline touchscreen (#10585) --- frontend/device/remarkable/device.lua | 21 ++++++++++++++------- 1 file changed, 14 insertions(+), 7 deletions(-) diff --git a/frontend/device/remarkable/device.lua b/frontend/device/remarkable/device.lua index 9d3981e31..bc084a4b5 100644 --- a/frontend/device/remarkable/device.lua +++ b/frontend/device/remarkable/device.lua @@ -143,13 +143,6 @@ function Remarkable:init() wacom_protocol = true, } - self.input.open(self.input_wacom) -- Wacom - self.input.open(self.input_ts) -- Touchscreen - self.input.open(self.input_buttons) -- Buttons - - local scalex = screen_width / self.mt_width - local scaley = screen_height / self.mt_height - -- Assume input stuff is saner on mainline kernels... -- (c.f., https://github.com/koreader/koreader/issues/10012) local is_mainline = false @@ -164,6 +157,20 @@ function Remarkable:init() is_mainline = true end end + + if is_mainline then + self.input_wacom = "/dev/input/by-path/platform-30a20000.i2c-event-mouse" + self.input_buttons = "/dev/input/by-path/platform-30370000.snvs:snvs-powerkey-event" + self.input_ts = "/dev/input/touchscreen0" + end + + self.input.open(self.input_wacom) -- Wacom + self.input.open(self.input_ts) -- Touchscreen + self.input.open(self.input_buttons) -- Buttons + + local scalex = screen_width / self.mt_width + local scaley = screen_height / self.mt_height + if is_mainline then -- NOTE: The panel sends *both* ABS_MT_ & ABS_ coordinates, while the pen only sends ABS_ coordinates. -- Since we have to apply *different* mangling to each of them,