From ea71f94e6c7f4727393063d1324b70d7bbf4922f Mon Sep 17 00:00:00 2001 From: Aki Date: Mon, 4 Sep 2017 03:51:16 +0200 Subject: Demux passes controller callbacks only if focused --- not/Demultiplexer.lua | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) (limited to 'not') diff --git a/not/Demultiplexer.lua b/not/Demultiplexer.lua index 468f007..ee6cbc9 100644 --- a/not/Demultiplexer.lua +++ b/not/Demultiplexer.lua @@ -53,11 +53,15 @@ function Demultiplexer:update (dt) end function Demultiplexer:controlpressed (set, action, key) - self:callOne(set, "controlpressed", set, action, key) + if self.focused then + self:callOne(set, "controlpressed", set, action, key) + end end function Demultiplexer:controlreleased (set, action, key) - self:callOne(set, "controlreleased", set, action, key) + if self.focused then + self:callOne(set, "controlreleased", set, action, key) + end end return Demultiplexer -- cgit v1.1