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:
parent
d3f86d0275
commit
8ca439591c
1 changed files with 9 additions and 7 deletions
|
|
@ -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.
|
-- -- 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.
|
-- -- This is applied automatically after the evaluation of input expressions.
|
||||||
-- deadzone = 0.05,
|
-- deadzone = 0.05,
|
||||||
-- -- The pressed threshold: an input is considered down if above or equal to this value. 0.05 by default.
|
-- -- 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, odwn and released.
|
-- -- This is considered when determining if the input is pressed, down and released.
|
||||||
-- threshold = 0.05,
|
-- threshold = 0.1,
|
||||||
-- -- Dimension of the input (i.e. the number of values returned by this input). 1 by default.
|
-- -- Dimension of the input (i.e. the number of values returned by this input). 1 by default.
|
||||||
-- dimension = 1
|
-- dimension = 1
|
||||||
-- }
|
-- }
|
||||||
|
|
@ -371,7 +371,7 @@ input_mt = {
|
||||||
-- Cache computed directly from the input config. Recomputed by :reload().
|
-- Cache computed directly from the input config. Recomputed by :reload().
|
||||||
_dimension = 1, -- Dimension of the input.
|
_dimension = 1, -- Dimension of the input.
|
||||||
_deadzone = 0.05, -- Deadzone 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.
|
--- Update the input and its children.
|
||||||
-- Should be called every frame, typically _after_ you've done all your input handling
|
-- Should be called every frame, typically _after_ you've done all your input handling
|
||||||
|
|
@ -425,7 +425,7 @@ input_mt = {
|
||||||
-- get main options
|
-- get main options
|
||||||
self._dimension = self.config.dimension or 1
|
self._dimension = self.config.dimension or 1
|
||||||
self._deadzone = self.config.deadzone or 0.05
|
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
|
-- resize dimensions
|
||||||
if #self._value > self._dimension then
|
if #self._value > self._dimension then
|
||||||
for i=self._dimension+1, #self._value do
|
for i=self._dimension+1, #self._value do
|
||||||
|
|
@ -602,8 +602,10 @@ input_mt = {
|
||||||
new = filter(self, new, ...)
|
new = filter(self, new, ...)
|
||||||
if not new then return end -- filtered out
|
if not new then return end -- filtered out
|
||||||
end
|
end
|
||||||
|
if s.parentCache[s.lastKey] ~= new then -- filter out no-op events
|
||||||
s.parentCache[s.lastKey] = new
|
s.parentCache[s.lastKey] = new
|
||||||
self._afterFilterEvent:emit(sname, new)
|
self._afterFilterEvent:emit(sname, new)
|
||||||
|
end
|
||||||
end)
|
end)
|
||||||
end
|
end
|
||||||
self._boundSourceEvents[sname] = true
|
self._boundSourceEvents[sname] = true
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue