From f2e963db46d67a081ca885f405227c122530042b Mon Sep 17 00:00:00 2001 From: EJTP Date: Sun, 12 Oct 2025 15:38:40 +0200 Subject: [PATCH] Fixed InputAction.cs --- Prowl.Runtime/InputManagement/InputAction.cs | 36 ++++++++++++-------- 1 file changed, 22 insertions(+), 14 deletions(-) diff --git a/Prowl.Runtime/InputManagement/InputAction.cs b/Prowl.Runtime/InputManagement/InputAction.cs index 4820b9c5..a868884f 100644 --- a/Prowl.Runtime/InputManagement/InputAction.cs +++ b/Prowl.Runtime/InputManagement/InputAction.cs @@ -230,9 +230,6 @@ internal void UpdateState(IInputHandler inputHandler, double currentTime) // Read the current value from bindings with interaction logic object newValue = ReadValueFromBindings(inputHandler, currentTime); - // Apply processors - newValue = ApplyProcessors(newValue); - bool valueChanged = !newValue.Equals(_currentValue); _currentValue = newValue; @@ -278,7 +275,17 @@ private object ReadValueFromBindings(IInputHandler inputHandler, double currentT { object compositeValue = composite.ReadValue(inputHandler); if (IsValueActuated(compositeValue)) + { + // Apply processors from the composite + foreach (var processor in composite.Processors) + { + if (compositeValue is float floatValue) + compositeValue = processor.Process(floatValue); + else if (compositeValue is Float2 vectorValue) + compositeValue = processor.Process(vectorValue); + } return compositeValue; + } } // Then check regular bindings with interaction logic @@ -289,6 +296,16 @@ private object ReadValueFromBindings(IInputHandler inputHandler, double currentT _interactionStates[binding] = new InteractionState(); object rawValue = ReadBinding(binding, inputHandler); + + // Apply processors from THIS binding only + foreach (var processor in binding.Processors) + { + if (rawValue is float floatValue) + rawValue = processor.Process(floatValue); + else if (rawValue is Float2 vectorValue) + rawValue = processor.Process(vectorValue); + } + bool isActuated = IsValueActuated(rawValue); // Evaluate interaction and get the result @@ -485,17 +502,8 @@ private object ReadBinding(InputBinding binding, IInputHandler inputHandler) private object ApplyProcessors(object value) { - foreach (var binding in Bindings) - { - foreach (var processor in binding.Processors) - { - if (value is float floatValue) - value = processor.Process(floatValue); - else if (value is Float2 vectorValue) - value = processor.Process(vectorValue); - } - } - + // Don't apply processors from all bindings - this is handled per-binding + // Processors should be applied in ReadValueFromBindings instead return value; }