From 3450aaba990c3f33da3091b80bf81332a5aab14f Mon Sep 17 00:00:00 2001 From: David <97603719+Commodore64user@users.noreply.github.com> Date: Tue, 13 Aug 2024 21:54:08 +0100 Subject: [PATCH] Bug Fix: DPad conflict on Kindle Keyboard (#12341) * fix conflicting panning and content selection * accurate keyboard info message --- frontend/apps/reader/modules/readerpanning.lua | 2 +- frontend/ui/elements/menu_keyboard_layout.lua | 10 ++++++++-- 2 files changed, 9 insertions(+), 3 deletions(-) diff --git a/frontend/apps/reader/modules/readerpanning.lua b/frontend/apps/reader/modules/readerpanning.lua index a6f7eba76..2888db24a 100644 --- a/frontend/apps/reader/modules/readerpanning.lua +++ b/frontend/apps/reader/modules/readerpanning.lua @@ -21,7 +21,7 @@ end function ReaderPanning:onGesture() end function ReaderPanning:registerKeyEvents() - if Device:hasKeyboard() then + if Device:hasKeyboard() and Device:hasDPad() and not Device:useDPadAsActionKeys() then self.key_events = { -- these will all generate the same event, just with different arguments MoveUp = { diff --git a/frontend/ui/elements/menu_keyboard_layout.lua b/frontend/ui/elements/menu_keyboard_layout.lua index f3dfe7a0f..94cbfad8c 100644 --- a/frontend/ui/elements/menu_keyboard_layout.lua +++ b/frontend/ui/elements/menu_keyboard_layout.lua @@ -231,15 +231,21 @@ if Device:hasKeyboard() or Device:hasScreenKB() then -- we use same pos. 4 as below so we are always above "keyboard apperance settings" table.insert(sub_item_table, 4, { text = _("Show virtual keyboard"), - help_text = _("Enable this setting to always display the virtual keyboard within a text input field. When a field is selected (in focus), you can temporarily toggle the keyboard on/off by pressing 'Shift' + 'Home'."), + help_text = _("Enable this setting to always display the virtual keyboard within a text input field. When a field is selected (in focus), you can temporarily toggle the keyboard on/off by pressing 'Shift' (or 'ScreenKB') + 'Home'."), checked_func = function() return G_reader_settings:nilOrTrue("virtual_keyboard_enabled") end, callback = function() G_reader_settings:flipNilOrTrue("virtual_keyboard_enabled") if G_reader_settings:isFalse("virtual_keyboard_enabled") then + local keyboard_infomessage + if Device:hasScreenKB() then + keyboard_infomessage = _("When a text field is selected (in focus), you can temporarily bring up the virtual keyboard by pressing 'ScreenKB' + 'Home'.") + else + keyboard_infomessage = _("When a text field is selected (in focus), you can temporarily bring up the virtual keyboard by pressing 'Shift' + 'Home'.") + end UIManager:show(InfoMessage:new{ - text = _("When a text field is selected (in focus), you can temporarily bring up the virtual keyboard by pressing 'Shift' + 'Home'.") + text = keyboard_infomessage }) end end,