diff --git a/base b/base index 6301277ce..e6c959418 160000 --- a/base +++ b/base @@ -1 +1 @@ -Subproject commit 6301277ce89adf6350a0956444610d5f715598ab +Subproject commit e6c95941869a9c439fd80e785060d777642a159c diff --git a/frontend/device/android/event_map.lua b/frontend/device/android/event_map.lua index f15164a0f..4cdf34a33 100644 --- a/frontend/device/android/event_map.lua +++ b/frontend/device/android/event_map.lua @@ -14,6 +14,7 @@ return { [23] = "Press", -- DPAD_CENTER [24] = "LPgBack", -- VOLUME_UP [25] = "LPgFwd", -- VOLUME_DOWN + [27] = "Camera", -- CAMERA [56] = ".", -- PERIOD [59] = "Shift", -- SHIFT_LEFT [60] = "Shift", -- SHIFT_RIGHT diff --git a/frontend/device/input.lua b/frontend/device/input.lua index 089293b0f..c6dc7f446 100755 --- a/frontend/device/input.lua +++ b/frontend/device/input.lua @@ -322,6 +322,23 @@ 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 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. diff --git a/platform/android/luajit-launcher b/platform/android/luajit-launcher index c82631d29..788d0f070 160000 --- a/platform/android/luajit-launcher +++ b/platform/android/luajit-launcher @@ -1 +1 @@ -Subproject commit c82631d29f0d7e8e87cdd6bad0503369513b320c +Subproject commit 788d0f0707e69fe37699e5fa6a68ef928aee0c7f