View Single Post
Old 12-28-2023, 01:05 PM   #479
Althusser
Member
Althusser began at the beginning.
 
Posts: 22
Karma: 10
Join Date: Apr 2023
Device: PW5
Quote:
Originally Posted by Tialex View Post
Anyway, the script below works for any file (epub, pdf) and probably for any view of the program. Anyone who want to force the program rotation (vs system) for KoReader 2023.08 should create the file named 1-force-soft-rot.lua in the sdcard/koreader/patches directory with the following text

Code:
local logger = require("logger")
local frBuffer = require("ffi/framebuffer_android")

frBuffer.setRotationMode = function(self, mode)
  logger.info("Forcing software rotation")
  frBuffer.parent.setRotationMode(self, mode)
end

frBuffer.getRotationMode = function(self)
  return self.cur_rotation_mode
end
Thank you! On my device, an old tablet with Android 8.1, the script worked correctly even when I set the tablet to auto-rotate.
Althusser is offline   Reply With Quote