1
0
Fork 0
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:
Étienne Fildadut 2022-10-07 12:37:28 +09:00
parent 8ac3ce010e
commit 879829c671

View file

@ -711,7 +711,7 @@ input_mt = {
end end
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) neutralize = function(self)
local zeros = { 0 } local zeros = { 0 }
for i=2, self._dimension do zeros[i] = 0 end for i=2, self._dimension do zeros[i] = 0 end
@ -721,6 +721,9 @@ input_mt = {
self._value[i] = 0 self._value[i] = 0
self._prevValue[i] = 0 self._prevValue[i] = 0
end end
for _, c in ipairs(self.children) do
c:neutralize()
end
end, end,
--- Set the joystick associated with this input. --- Set the joystick associated with this input.