diff options
author | Aki <nthirtyone@gmail.com> | 2017-09-04 03:51:16 +0200 |
---|---|---|
committer | Aki <nthirtyone@gmail.com> | 2017-09-04 03:51:16 +0200 |
commit | ea71f94e6c7f4727393063d1324b70d7bbf4922f (patch) | |
tree | 3f59b802624207cfad3537168b1c4942f4d8f1ef | |
parent | 7afcf7efbead72263d97da376de802e553bfb7eb (diff) | |
download | roflnauts-ea71f94e6c7f4727393063d1324b70d7bbf4922f.zip roflnauts-ea71f94e6c7f4727393063d1324b70d7bbf4922f.tar.gz roflnauts-ea71f94e6c7f4727393063d1324b70d7bbf4922f.tar.bz2 |
Demux passes controller callbacks only if focused
-rw-r--r-- | not/Demultiplexer.lua | 8 |
1 files changed, 6 insertions, 2 deletions
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 |