mirror of
https://github.com/koreader/koreader.git
synced 2025-12-24 12:14:05 +01:00
Android: Get rid of the Camera key hack
Unnecessary now that we have a standard mechanism to disable touch input ;).
This commit is contained in:
@@ -570,24 +570,6 @@ function Input:handleKeyBoardEv(ev)
|
||||
return keycode
|
||||
end
|
||||
|
||||
-- The hardware camera button is used in Android to toggle the touchscreen
|
||||
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
|
||||
android.toggleTouchscreenIgnored()
|
||||
|
||||
-- show a toast with the new behaviour
|
||||
if android.isTouchscreenIgnored() then
|
||||
android.notification(_("Touchscreen disabled"))
|
||||
else
|
||||
android.notification(_("Touchscreen enabled"))
|
||||
end
|
||||
end
|
||||
return
|
||||
end
|
||||
|
||||
if keycode == "Power" then
|
||||
-- Kobo generates Power keycode only, we need to decide whether it's
|
||||
-- power-on or power-off ourselves.
|
||||
|
||||
@@ -310,13 +310,6 @@ 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,
|
||||
}
|
||||
|
||||
common_settings.android_back_button = {
|
||||
text = _("Ignore back button completely"),
|
||||
checked_func = function() return android.isBackButtonIgnored() end,
|
||||
|
||||
@@ -67,7 +67,6 @@ local order = {
|
||||
"backspace_as_back",
|
||||
"----------------------------",
|
||||
"android_volume_keys",
|
||||
"android_camera_key",
|
||||
"android_haptic_feedback",
|
||||
"android_back_button",
|
||||
"----------------------------",
|
||||
|
||||
@@ -111,7 +111,6 @@ local order = {
|
||||
"----------------------------",
|
||||
"page_turns_non_touch",
|
||||
"android_volume_keys",
|
||||
"android_camera_key",
|
||||
"android_haptic_feedback",
|
||||
"android_back_button",
|
||||
"----------------------------",
|
||||
|
||||
Reference in New Issue
Block a user