android: touchscreen toggle option (#5564)

This commit is contained in:
Martín Fernández
2019-11-06 00:52:44 +01:00
committed by poire-z
parent 371e3336a5
commit f1f75c5cb0
4 changed files with 11 additions and 1 deletions

View File

@@ -324,7 +324,8 @@ function Input:handleKeyBoardEv(ev)
end
-- The hardware camera button is used in Android to toggle the touchscreen
if keycode == "Camera" and ev.value == EVENT_VALUE_KEY_RELEASE then
if keycode == "Camera" and ev.value == EVENT_VALUE_KEY_RELEASE
and G_reader_settings:isTrue("camera_key_toggles_touchscreen") then
local isAndroid, android = pcall(require, "android")
if isAndroid then
-- toggle touchscreen behaviour

View File

@@ -220,6 +220,13 @@ if Device:isAndroid() then
end,
}
-- camera key events
common_settings.android_camera_key = {
text = _("Camera key toggles touchscreen support"),
checked_func = function() return G_reader_settings:isTrue("camera_key_toggles_touchscreen") end,
callback = function() G_reader_settings:flipNilOrFalse("camera_key_toggles_touchscreen") end,
}
-- fullscreen toggle on devices with compatible fullscreen methods (apis 14-18)
if Device.firmware_rev < 19 then
common_settings.fullscreen = {

View File

@@ -53,6 +53,7 @@ local order = {
"back_in_filemanager",
"enable_back_history",
"android_volume_keys",
"android_camera_key",
"----------------------------",
"invert_page_turn_buttons",
},

View File

@@ -72,6 +72,7 @@ local order = {
"back_in_filemanager",
"enable_back_history",
"android_volume_keys",
"android_camera_key",
"----------------------------",
"invert_page_turn_gestures",
"invert_page_turn_buttons",