mirror of
https://github.com/koreader/koreader.git
synced 2025-08-10 00:52:38 +00:00
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
This commit is contained in:
@@ -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
|
||||
|
||||
Reference in New Issue
Block a user