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:
1 parent
d585cd5d86
commit
925fd647dc
19 files changed
+66
-141
No files matched your search
@@ -50,7 +50,7 @@ function TweakInfoWidget:init()
|
||||
}
|
||||
}
|
||||
end
|
||||
self:registerKeyEvents(true)
|
||||
self:registerKeyEvents()
|
||||
|
||||
local content = VerticalGroup:new{
|
||||
TextBoxWidget:new{
|
||||
@@ -166,16 +166,13 @@ function TweakInfoWidget:init()
|
||||
}
|
||||
end
|
||||
|
||||
function TweakInfoWidget:registerKeyEvents(init)
|
||||
function TweakInfoWidget:registerKeyEvents()
|
||||
if Device:hasKeys() then
|
||||
self.key_events.Close = { { Device.input.group.Back } }
|
||||
elseif not init then
|
||||
self.key_events.Close = nil
|
||||
end
|
||||
end
|
||||
|
||||
TweakInfoWidget.onPhysicalKeyboardConnected = TweakInfoWidget.registerKeyEvents
|
||||
TweakInfoWidget.onPhysicalKeyboardDisconnected = TweakInfoWidget.registerKeyEvents
|
||||
|
||||
function TweakInfoWidget:onShow()
|
||||
UIManager:setDirty(self, function()
|
||||
|
||||
Reference in new issue
Block a user