1
0
Fork 0
mirror of https://github.com/Reuh/ubiquitousse.git synced 2025-10-27 09:09:30 +00:00

input: tweak default deadzone

This commit is contained in:
Étienne Fildadut 2025-07-11 15:12:26 +02:00
parent d3f86d0275
commit 8ca439591c

View file

@ -306,9 +306,9 @@ input_mt = {
-- -- The deadzone for analog inputs (e.g. joystick axes): if the input absolute value is strictly below this, it will be considered as 0. 0.05 by default.
-- -- This is applied automatically after the evaluation of input expressions.
-- deadzone = 0.05,
-- -- The pressed threshold: an input is considered down if above or equal to this value. 0.05 by default.
-- -- This is considered when determining if the input is pressed, odwn and released.
-- threshold = 0.05,
-- -- The pressed threshold: an input is considered down if above or equal to this value. 0.1 by default.
-- -- This is considered when determining if the input is pressed, down and released.
-- threshold = 0.1,
-- -- Dimension of the input (i.e. the number of values returned by this input). 1 by default.
-- dimension = 1
-- }
@ -371,7 +371,7 @@ input_mt = {
-- Cache computed directly from the input config. Recomputed by :reload().
_dimension = 1, -- Dimension of the input.
_deadzone = 0.05, -- Deadzone of the input.
_threshold = 0.05, -- Threshold of the input.
_threshold = 0.1, -- Threshold of the input.
--- Update the input and its children.
-- Should be called every frame, typically _after_ you've done all your input handling
@ -425,7 +425,7 @@ input_mt = {
-- get main options
self._dimension = self.config.dimension or 1
self._deadzone = self.config.deadzone or 0.05
self._threshold = self.config.threshold or 0.05
self._threshold = self.config.threshold or 0.1
-- resize dimensions
if #self._value > self._dimension then
for i=self._dimension+1, #self._value do
@ -602,8 +602,10 @@ input_mt = {
new = filter(self, new, ...)
if not new then return end -- filtered out
end
if s.parentCache[s.lastKey] ~= new then -- filter out no-op events
s.parentCache[s.lastKey] = new
self._afterFilterEvent:emit(sname, new)
end
end)
end
self._boundSourceEvents[sname] = true