mirror of
https://github.com/koreader/koreader.git
synced 2025-08-10 00:52:38 +00:00
android: add an option to ignore volume keys or use them to turn pages
This commit is contained in:
2
base
2
base
Submodule base updated: 9ee0e9ebe7...6301277ce8
@@ -182,6 +182,11 @@ function Device:init()
|
||||
self:toggleFullscreen()
|
||||
end
|
||||
|
||||
-- check if we ignore volume keys and then they're forwarded to system services.
|
||||
if G_reader_settings:isTrue("android_ignore_volume_keys") then
|
||||
android.setVolumeKeysIgnored(true);
|
||||
end
|
||||
|
||||
Generic.init(self)
|
||||
end
|
||||
|
||||
|
||||
@@ -175,6 +175,17 @@ if Device:isAndroid() then
|
||||
-- screen timeout options, disabled if device needs wakelocks.
|
||||
common_settings.screen_timeout = require("ui/elements/screen_android"):getTimeoutMenuTable()
|
||||
|
||||
-- volume key events
|
||||
common_settings.android_volume_keys = {
|
||||
text = _("Volume key page turning"),
|
||||
checked_func = function() return not android.getVolumeKeysIgnored() end,
|
||||
callback = function()
|
||||
local is_ignored = android.getVolumeKeysIgnored()
|
||||
android.setVolumeKeysIgnored(not is_ignored)
|
||||
G_reader_settings:saveSetting("android_ignore_volume_keys", not is_ignored)
|
||||
end,
|
||||
}
|
||||
|
||||
-- fullscreen toggle on devices with compatible fullscreen methods (apis 14-18)
|
||||
if Device.firmware_rev < 19 then
|
||||
common_settings.fullscreen = {
|
||||
|
||||
@@ -49,6 +49,7 @@ local order = {
|
||||
"back_to_exit",
|
||||
"back_in_filemanager",
|
||||
"enable_back_history",
|
||||
"android_volume_keys",
|
||||
"----------------------------",
|
||||
"invert_page_turn_buttons",
|
||||
},
|
||||
|
||||
@@ -68,6 +68,7 @@ local order = {
|
||||
"back_to_exit",
|
||||
"back_in_filemanager",
|
||||
"enable_back_history",
|
||||
"android_volume_keys",
|
||||
"----------------------------",
|
||||
"invert_page_turn_buttons",
|
||||
},
|
||||
|
||||
Submodule platform/android/luajit-launcher updated: e4dd25e10b...c82631d29f
Reference in New Issue
Block a user