don't allow keyboard keys to bleed through

when multiple keys are hit at once
develop
Myk Taylor 2023-11-20 09:43:43 -08:00
parent 3c58240ceb
commit dce753c593
No known key found for this signature in database
1 changed files with 12 additions and 1 deletions

@ -89,12 +89,23 @@ function SortOverlay:onRenderBody(dc)
SortOverlay.super.onRenderBody(self, dc) SortOverlay.super.onRenderBody(self, dc)
end end
local function is_mouse_key(keys)
return keys._MOUSE_L
or keys._MOUSE_R
or keys._MOUSE_M
or keys.CONTEXT_SCROLL_UP
or keys.CONTEXT_SCROLL_DOWN
or keys.CONTEXT_SCROLL_PAGEUP
or keys.CONTEXT_SCROLL_PAGEDOWN
end
function SortOverlay:onInput(keys) function SortOverlay:onInput(keys)
if keys._MOUSE_R and self.subviews.search.focus and self:get_key() then if keys._MOUSE_R and self.subviews.search.focus and self:get_key() then
self.subviews.search:setFocus(false) self.subviews.search:setFocus(false)
return true return true
end end
return SortOverlay.super.onInput(self, keys) return SortOverlay.super.onInput(self, keys) or
(self.subviews.search.focus and not is_mouse_key(keys))
end end
function SortOverlay:do_search(text, force_full_search) function SortOverlay:do_search(text, force_full_search)