mirror of
https://github.com/Reuh/ubiquitousse.git
synced 2025-10-27 17:19:31 +00:00
input: neutralize also neutralize the children
This commit is contained in:
parent
8ac3ce010e
commit
879829c671
1 changed files with 4 additions and 1 deletions
|
|
@ -711,7 +711,7 @@ input_mt = {
|
|||
end
|
||||
end,
|
||||
|
||||
--- Set the state of this input to a neutral position (i.e. value = 0 for every dimension).
|
||||
--- Set the state of this input and its children to a neutral position (i.e. value = 0 for every dimension).
|
||||
neutralize = function(self)
|
||||
local zeros = { 0 }
|
||||
for i=2, self._dimension do zeros[i] = 0 end
|
||||
|
|
@ -721,6 +721,9 @@ input_mt = {
|
|||
self._value[i] = 0
|
||||
self._prevValue[i] = 0
|
||||
end
|
||||
for _, c in ipairs(self.children) do
|
||||
c:neutralize()
|
||||
end
|
||||
end,
|
||||
|
||||
--- Set the joystick associated with this input.
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue