From 17eb63091d36a16d0a374018975e2c3e47464275 Mon Sep 17 00:00:00 2001 From: Takayama Fumihiko Date: Thu, 21 Sep 2023 23:09:55 +0900 Subject: [PATCH] Add json/input_event_queue/mouse_basic_1.jsonc --- .../mouse_basic_1.jsonc | 13 ++++++++ .../input_event_queue/mouse_basic_1.jsonc | 30 +++++++++++++++++++ .../json/rules/mouse_basic.jsonc | 7 +++++ .../json/tests.json | 6 ++++ 4 files changed, 56 insertions(+) create mode 100644 tests/src/post_event_to_virtual_devices/json/expected_post_event_to_virtual_devices_queue/mouse_basic_1.jsonc create mode 100644 tests/src/post_event_to_virtual_devices/json/input_event_queue/mouse_basic_1.jsonc create mode 100644 tests/src/post_event_to_virtual_devices/json/rules/mouse_basic.jsonc diff --git a/tests/src/post_event_to_virtual_devices/json/expected_post_event_to_virtual_devices_queue/mouse_basic_1.jsonc b/tests/src/post_event_to_virtual_devices/json/expected_post_event_to_virtual_devices_queue/mouse_basic_1.jsonc new file mode 100644 index 000000000..28d92d1fa --- /dev/null +++ b/tests/src/post_event_to_virtual_devices/json/expected_post_event_to_virtual_devices_queue/mouse_basic_1.jsonc @@ -0,0 +1,13 @@ +[ + { + "pointing_input": { + "buttons": [], + "horizontal_wheel": 10, + "vertical_wheel": 236, + "x": 30, + "y": 40 + }, + "time_stamp": 2, + "type": "pointing_input" + } +] diff --git a/tests/src/post_event_to_virtual_devices/json/input_event_queue/mouse_basic_1.jsonc b/tests/src/post_event_to_virtual_devices/json/input_event_queue/mouse_basic_1.jsonc new file mode 100644 index 000000000..25754c845 --- /dev/null +++ b/tests/src/post_event_to_virtual_devices/json/input_event_queue/mouse_basic_1.jsonc @@ -0,0 +1,30 @@ +[ + { + "device_id": 1, + "event": { + "pointing_motion": { + "horizontal_wheel": 10, + "vertical_wheel": 20, + "x": 30, + "y": 40 + }, + "type": "pointing_motion" + }, + "event_origin": "grabbed_device", + "event_time_stamp": { + "time_stamp": 2 + }, + "event_type": "single", + "lazy": false, + "original_event": { + "pointing_motion": { + "horizontal_wheel": 10, + "vertical_wheel": 20, + "x": 30, + "y": 40 + }, + "type": "pointing_motion" + }, + "validity": true + } +] diff --git a/tests/src/post_event_to_virtual_devices/json/rules/mouse_basic.jsonc b/tests/src/post_event_to_virtual_devices/json/rules/mouse_basic.jsonc new file mode 100644 index 000000000..310ba6cc1 --- /dev/null +++ b/tests/src/post_event_to_virtual_devices/json/rules/mouse_basic.jsonc @@ -0,0 +1,7 @@ +[ + { + "description": "flip vertical_wheel", + "type": "mouse_basic", + "flip": ["vertical_wheel"] + } +] diff --git a/tests/src/post_event_to_virtual_devices/json/tests.json b/tests/src/post_event_to_virtual_devices/json/tests.json index 3acb3e932..273dc842a 100644 --- a/tests/src/post_event_to_virtual_devices/json/tests.json +++ b/tests/src/post_event_to_virtual_devices/json/tests.json @@ -802,5 +802,11 @@ "rules": ["json/rules/set_variable.jsonc"], "input_event_queue": "json/input_event_queue/set_variable_2.jsonc", "expected_post_event_to_virtual_devices_queue": "json/expected_post_event_to_virtual_devices_queue/set_variable_2.jsonc" + }, + { + "description": "mouse_basic_1", + "rules": ["json/rules/mouse_basic.jsonc"], + "input_event_queue": "json/input_event_queue/mouse_basic_1.jsonc", + "expected_post_event_to_virtual_devices_queue": "json/expected_post_event_to_virtual_devices_queue/mouse_basic_1.jsonc" } ]