summaryrefslogtreecommitdiffhomepage
path: root/not
diff options
context:
space:
mode:
authorAki <nthirtyone@gmail.com>2017-09-04 03:51:16 +0200
committerAki <nthirtyone@gmail.com>2017-09-04 03:51:16 +0200
commitea71f94e6c7f4727393063d1324b70d7bbf4922f (patch)
tree3f59b802624207cfad3537168b1c4942f4d8f1ef /not
parent7afcf7efbead72263d97da376de802e553bfb7eb (diff)
downloadroflnauts-ea71f94e6c7f4727393063d1324b70d7bbf4922f.zip
roflnauts-ea71f94e6c7f4727393063d1324b70d7bbf4922f.tar.gz
roflnauts-ea71f94e6c7f4727393063d1324b70d7bbf4922f.tar.bz2
Demux passes controller callbacks only if focused
Diffstat (limited to 'not')
-rw-r--r--not/Demultiplexer.lua8
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