diff --git a/frontend/device/generic/device.lua b/frontend/device/generic/device.lua index 42bfe980a..445f1e0cb 100644 --- a/frontend/device/generic/device.lua +++ b/frontend/device/generic/device.lua @@ -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) diff --git a/frontend/device/kobo/device.lua b/frontend/device/kobo/device.lua index 88b44229f..e90d55862 100644 --- a/frontend/device/kobo/device.lua +++ b/frontend/device/kobo/device.lua @@ -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