From 51e811ec0a1e71b3a8abfacb4e311e0d13f85699 Mon Sep 17 00:00:00 2001 From: sezanzeb <28510156+sezanzeb@users.noreply.github.com> Date: Sun, 2 Feb 2025 11:14:16 +0100 Subject: [PATCH] alkjdfnhaksd --- .../mapping_handlers/hierarchy_handler.py | 27 ++++++++++--------- 1 file changed, 15 insertions(+), 12 deletions(-) diff --git a/inputremapper/injection/mapping_handlers/hierarchy_handler.py b/inputremapper/injection/mapping_handlers/hierarchy_handler.py index 29757a0f..6ec6733b 100644 --- a/inputremapper/injection/mapping_handlers/hierarchy_handler.py +++ b/inputremapper/injection/mapping_handlers/hierarchy_handler.py @@ -73,19 +73,22 @@ def notify( if event.input_match_hash != self._input_config.input_match_hash: return False - success = False + handled = False for handler in self.handlers: - # We want to be able to map EV_REL to EV_ABS, and while moving the gamepad, - # still trigger keys using EV_REL and an analog_threshold. In this case, we - # have two combinations activated at the same time. - defines_analog_input = True in [ - input_config.defines_analog_input - for input_config in handler.input_configs - ] - suppress = success and not defines_analog_input - success = handler.notify(event, source, suppress=suppress) or success - - return success + if handled: + # We want to be able to map EV_REL to EV_ABS, and while moving the + # gamepad, still trigger keys using EV_REL and an analog_threshold. + # In this case, we have two combinations activated at the same time. + defines_analog_input = True in [ + input_config.defines_analog_input + for input_config in handler.input_configs + ] + handler.notify(event, source, suppress=not defines_analog_input) + continue + + handled = handler.notify(event, source) + + return handled def reset(self) -> None: for sub_handler in self.handlers: