From 0f10d06ab6cf2843928e2c281e9cce1ade2c6154 Mon Sep 17 00:00:00 2001 From: jonasBoss Date: Thu, 15 Dec 2022 14:43:03 +0100 Subject: [PATCH] Input event with origin (#550) --- .run/All Tests.run.xml | 3 +- .run/Only Integration Tests.run.xml | 7 +- ... tests.run.xml => Only Unit Tests.run.xml} | 7 +- inputremapper/configs/input_config.py | 353 ++++++++++++ inputremapper/configs/mapping.py | 104 ++-- inputremapper/configs/migrations.py | 106 ++-- inputremapper/configs/preset.py | 116 ++-- inputremapper/event_combination.py | 163 ------ inputremapper/groups.py | 10 + inputremapper/gui/__init__.py | 6 + inputremapper/gui/autocompletion.py | 10 +- inputremapper/gui/components/common.py | 1 - inputremapper/gui/components/device_groups.py | 4 +- inputremapper/gui/components/editor.py | 77 ++- inputremapper/gui/components/main.py | 3 +- inputremapper/gui/components/presets.py | 3 - inputremapper/gui/controller.py | 125 +++-- inputremapper/gui/data_manager.py | 65 ++- inputremapper/gui/messages/message_broker.py | 11 +- inputremapper/gui/messages/message_data.py | 8 +- inputremapper/gui/reader_client.py | 37 +- inputremapper/gui/reader_service.py | 112 ++-- inputremapper/gui/user_interface.py | 11 +- inputremapper/gui/utils.py | 3 - inputremapper/injection/context.py | 24 +- inputremapper/injection/event_reader.py | 14 +- inputremapper/injection/injector.py | 182 ++++--- .../mapping_handlers/abs_to_abs_handler.py | 23 +- .../mapping_handlers/abs_to_btn_handler.py | 26 +- .../mapping_handlers/abs_to_rel_handler.py | 23 +- .../mapping_handlers/axis_switch_handler.py | 54 +- .../mapping_handlers/combination_handler.py | 55 +- .../mapping_handlers/hierarchy_handler.py | 32 +- .../injection/mapping_handlers/key_handler.py | 10 +- .../mapping_handlers/macro_handler.py | 9 +- .../mapping_handlers/mapping_handler.py | 38 +- .../mapping_handlers/mapping_parser.py | 45 +- .../mapping_handlers/null_handler.py | 10 +- .../mapping_handlers/rel_to_abs_handler.py | 25 +- .../mapping_handlers/rel_to_btn_handler.py | 28 +- .../mapping_handlers/rel_to_rel_handler.py | 25 +- inputremapper/input_event.py | 237 ++------ inputremapper/logger.py | 4 +- inputremapper/utils.py | 13 + readme/usage.md | 176 +++--- tests/integration/__init__.py | 2 +- tests/integration/test_components.py | 398 ++++++++++---- tests/integration/test_gui.py | 397 +++++++++----- tests/integration/test_user_interface.py | 9 +- tests/lib/fixtures.py | 50 +- tests/lib/pipes.py | 1 + tests/unit/test_context.py | 40 +- tests/unit/test_control.py | 2 +- tests/unit/test_controller.py | 337 +++++++----- tests/unit/test_daemon.py | 67 ++- tests/unit/test_data_manager.py | 122 +++-- tests/unit/test_event_combination.py | 204 ------- .../test_axis_transformation.py | 4 +- .../test_event_pipeline.py | 202 +++++-- .../test_mapping_handlers.py | 98 +++- tests/unit/test_event_reader.py | 70 ++- tests/unit/test_injector.py | 227 ++++++-- tests/unit/test_input_config.py | 511 ++++++++++++++++++ tests/unit/test_input_event.py | 28 +- tests/unit/test_mapping.py | 168 ++---- tests/unit/test_migrations.py | 122 +++-- tests/unit/test_preset.py | 142 +++-- tests/unit/test_reader.py | 260 ++++++++- tests/unit/test_test.py | 7 + 69 files changed, 3680 insertions(+), 2186 deletions(-) rename .run/{Only Unit tests.run.xml => Only Unit Tests.run.xml} (71%) create mode 100644 inputremapper/configs/input_config.py delete mode 100644 inputremapper/event_combination.py delete mode 100644 tests/unit/test_event_combination.py create mode 100644 tests/unit/test_input_config.py diff --git a/.run/All Tests.run.xml b/.run/All Tests.run.xml index 6f1e606a..e442be10 100644 --- a/.run/All Tests.run.xml +++ b/.run/All Tests.run.xml @@ -1,5 +1,5 @@ - +