Make sure InputText has a consistent API, regardless of hasDPad

Fix #8967
Regression since #8859
reviewable/pr8972/r1
NiLuJe 2 years ago
parent 815c078b89
commit 930fa9ac1f

@ -68,6 +68,11 @@ local InputText = InputContainer:new{
is_keyboard_hidden = false, -- to be able to show the keyboard again when it was hidden
}
-- These may be (internally) overloaded as needed, depending on Device capabilities.
function InputText:initEventListener() end
function InputText:onFocus() end
function InputText:onUnfocus() end
-- only use PhysicalKeyboard if the device does not have touch screen
if Device:isTouchDevice() or Device:hasDPad() then
Keyboard = require("ui/widget/virtualkeyboard")
@ -278,10 +283,6 @@ if Device:isTouchDevice() or Device:hasDPad() then
end
end
if Device:hasDPad() then
if not InputText.initEventListener then
function InputText:initEventListener() end
end
function InputText:onFocus()
-- Event called by the focusmanager
if self.parent.onSwitchFocus then
@ -301,7 +302,6 @@ if Device:isTouchDevice() or Device:hasDPad() then
end
else
Keyboard = require("ui/widget/physicalkeyboard")
function InputText:initEventListener() end
end
function InputText:checkTextEditability()

Loading…
Cancel
Save