Kobo: Unbreak input translation when a viewport is active

Generic is responsible for setting up the translation via input hooks;
since our own input hooks involve swapping or mirroring X/Y, we need to
run our own hooks *first*, so that the viewport translation actually
does the right thing...

Probably broken for a good long while, I'd just assumed the inaccuracies
on the H2O were due to the IR grid... :/.

Reported @ https://www.mobileread.com/forums/showthread.php?t=351340
reviewable/pr10017/r1
NiLuJe 1 year ago
parent 843c4bfe66
commit 64af750c6c

@ -197,6 +197,9 @@ function Device:init()
self.powerd = require("device/generic/powerd"):new{device = self}
end
-- NOTE: This needs to run *after* implementation-specific event hooks,
-- especially if those require swapping/mirroring...
-- (e.g., Device implementations should setup their own hooks *before* calling this via Generic.init(self)).
if self.viewport then
logger.dbg("setting a viewport:", self.viewport)
self.screen:setViewport(self.viewport)

@ -752,7 +752,13 @@ function Kobo:init()
dodgy_rtc = dodgy_rtc,
}
-- Input handling on Kobo is a thing of nightmares, start by setting up the actual evdev handler...
self:setTouchEventHandler()
-- And then handle the extra shenanigans if necessary.
self:initEventAdjustHooks()
-- Let generic properly setup the standard stuff
-- (*after* we've set our input hooks, so that the viewport translation runs last).
Generic.init(self)
-- Various HW Buttons, Switches & Synthetic NTX events
@ -771,11 +777,6 @@ function Kobo:init()
-- NOTE: usb hotplug event is also available in /tmp/nickel-hardware-status (... but only when Nickel is running ;p)
self.input.open("fake_events")
-- Input handling on Kobo is a thing of nightmares, start by setting up the actual evdev handler...
self:setTouchEventHandler()
-- And then handle the extra shenanigans if necessary.
self:initEventAdjustHooks()
-- See if the device supports key repeat
if not self:getKeyRepeat() then
-- NOP unsupported methods

Loading…
Cancel
Save