Skip to content

Commit

Permalink
suddenly requires to look into handler.mapping.input_combination
Browse files Browse the repository at this point in the history
  • Loading branch information
sezanzeb committed Feb 2, 2025
1 parent 2fc49c6 commit 8374967
Show file tree
Hide file tree
Showing 5 changed files with 1,548 additions and 1,386 deletions.
4 changes: 3 additions & 1 deletion inputremapper/configs/mapping.py
Original file line number Diff line number Diff line change
Expand Up @@ -294,10 +294,12 @@ def get_output_type_code(self) -> Optional[Tuple[int, int]]:
otherwise looks the output_symbol up in the keyboard_layout
return None for unknown symbols and macros
"""
if self.output_code and self.output_type:
if self.output_code is not None and self.output_type is not None:
return self.output_type, self.output_code

if self.output_symbol and not Parser.is_this_a_macro(self.output_symbol):
return EV_KEY, keyboard_layout.get(self.output_symbol)

return None

def get_output_name_constant(self) -> str:
Expand Down
10 changes: 5 additions & 5 deletions inputremapper/injection/mapping_handlers/hierarchy_handler.py
Original file line number Diff line number Diff line change
Expand Up @@ -79,11 +79,11 @@ def notify(
# 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)
handler.notify(
event,
source,
suppress=not handler.mapping.input_combination.defines_analog_input,
)
continue

handled = handler.notify(event, source)
Expand Down
Loading

0 comments on commit 8374967

Please sign in to comment.