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:
@@ -91,10 +91,10 @@ local ReaderZooming = InputContainer:extend{
|
||||
}
|
||||
|
||||
function ReaderZooming:init()
|
||||
self:registerKeyEvents(true)
|
||||
self:registerKeyEvents()
|
||||
end
|
||||
|
||||
function ReaderZooming:registerKeyEvents(init)
|
||||
function ReaderZooming:registerKeyEvents()
|
||||
if Device:hasKeyboard() then
|
||||
self.key_events = {
|
||||
ZoomIn = {
|
||||
@@ -143,13 +143,10 @@ function ReaderZooming:registerKeyEvents(init)
|
||||
args = "manual",
|
||||
},
|
||||
}
|
||||
elseif not init then
|
||||
self.key_events = {}
|
||||
end
|
||||
end
|
||||
|
||||
ReaderZooming.onPhysicalKeyboardConnected = ReaderZooming.registerKeyEvents
|
||||
ReaderZooming.onPhysicalKeyboardDisconnected = ReaderZooming.registerKeyEvents
|
||||
|
||||
-- Conversions between genus/type combos and zoom_mode...
|
||||
function ReaderZooming:mode_to_combo(zoom_mode)
|
||||
|
||||
Reference in New Issue
Block a user