android: add a toggle to ignore back button events (#6269)

Requires koreader/android-luajit-launcher#233
Requires koreader/koreader-base#1117

It is a workaround for #6263 but can be useful on some devices with erratic back key behaviour too (yep, Onyx)
This commit is contained in:
Martín Fernández
2020-06-15 07:43:37 +02:00
committed by GitHub
parent b23af97914
commit 765b35a7bf
6 changed files with 19 additions and 2 deletions

View File

@@ -224,6 +224,11 @@ function Device:init()
android.setVolumeKeysIgnored(true)
end
-- check if we ignore the back button completely
if G_reader_settings:isTrue("android_ignore_back_button") then
android.setBackButtonIgnored(true)
end
-- check if we enable a custom light level for this activity
local last_value = G_reader_settings:readSetting("fl_last_level")
if type(last_value) == "number" and last_value >= 0 then