mirror of
https://github.com/koreader/koreader.git
synced 2025-08-10 00:52:38 +00:00
InputContainer/FocusManager: Simplify key_events clearing on unplug
Thanks to @poire-z for the idea, it's indeed much nicer this way ;).
This commit is contained in:
@@ -305,4 +305,13 @@ function InputContainer:closeInputDialog()
|
||||
UIManager:close(self.input_dialog)
|
||||
end
|
||||
|
||||
function InputContainer:onPhysicalKeyboardDisconnected()
|
||||
-- Clear the key bindings if Device no longer has keys
|
||||
-- NOTE: hasKeys is the lowest common denominator of key-related Device caps,
|
||||
-- hasDPad/hasFewKeys/hasKeyboard all imply hasKeys ;).
|
||||
if not Device:hasKeys() then
|
||||
self.key_events = {}
|
||||
end
|
||||
end
|
||||
|
||||
return InputContainer
|
||||
|
||||
Reference in New Issue
Block a user