Skip to content

Commit

Permalink
Update tests
Browse files Browse the repository at this point in the history
  • Loading branch information
tekezo committed Dec 11, 2024
1 parent 5b9ef5a commit 6b2f9e3
Show file tree
Hide file tree
Showing 8 changed files with 296 additions and 0 deletions.
Original file line number Diff line number Diff line change
@@ -0,0 +1,14 @@
[
{
"keyboard_input": {
"keys": [
{
"key_code": "b"
}
],
"modifiers": []
},
"time_stamp": 5,
"type": "keyboard_input"
}
]
Original file line number Diff line number Diff line change
@@ -0,0 +1,52 @@
[
{
"keyboard_input": {
"keys": [
{
"key_code": "b"
}
],
"modifiers": []
},
"time_stamp": 5,
"type": "keyboard_input"
},
{
"keyboard_input": {
"keys": [
{
"key_code": "b"
},
{
"key_code": "2"
}
],
"modifiers": []
},
"time_stamp": 10,
"type": "keyboard_input"
},
{
"keyboard_input": {
"keys": [
{
"key_code": "b"
}
],
"modifiers": []
},
"time_stamp": 15,
"type": "keyboard_input"
},
{
"consumer_input": {
"keys": [
{
"consumer_key_code": "mute"
}
]
},
"time_stamp": 20,
"type": "consumer_input"
}
]
Original file line number Diff line number Diff line change
@@ -0,0 +1,41 @@
[
{
"keyboard_input": {
"keys": [
{
"key_code": "b"
}
],
"modifiers": []
},
"time_stamp": 5,
"type": "keyboard_input"
},
{
"keyboard_input": {
"keys": [
{
"key_code": "b"
},
{
"key_code": "1"
}
],
"modifiers": []
},
"time_stamp": 10,
"type": "keyboard_input"
},
{
"keyboard_input": {
"keys": [
{
"key_code": "b"
}
],
"modifiers": []
},
"time_stamp": 15,
"type": "keyboard_input"
}
]
Original file line number Diff line number Diff line change
@@ -0,0 +1,19 @@
[
{
"device_id": 1,
"event": {
"momentary_switch_event": { "key_code": "f12" },
"type": "momentary_switch_event"
},
"event_time_stamp": {
"time_stamp": 2
},
"event_type": "key_down",
"lazy": false,
"original_event": {
"momentary_switch_event": { "key_code": "f12" },
"type": "momentary_switch_event"
},
"validity": true
}
]
Original file line number Diff line number Diff line change
@@ -0,0 +1,40 @@
[
{
"device_id": 1,
"event": {
"momentary_switch_event": { "key_code": "f12" },
"type": "momentary_switch_event"
},
"event_time_stamp": {
"time_stamp": 2
},
"event_type": "key_down",
"lazy": false,
"original_event": {
"momentary_switch_event": { "key_code": "f12" },
"type": "momentary_switch_event"
},
"validity": true
},
{
"device_id": 1,
"event": {
"momentary_switch_event": { "key_code": "f10" },
"type": "momentary_switch_event"
},
"event_time_stamp": {
"time_stamp": 4
},
"event_type": "key_down",
"lazy": false,
"original_event": {
"momentary_switch_event": { "key_code": "f10" },
"type": "momentary_switch_event"
},
"validity": true
},
{
"action": "invoke_dispatcher",
"time_stamp": 1000
}
]
Original file line number Diff line number Diff line change
@@ -0,0 +1,40 @@
[
{
"device_id": 1,
"event": {
"momentary_switch_event": { "key_code": "f12" },
"type": "momentary_switch_event"
},
"event_time_stamp": {
"time_stamp": 2
},
"event_type": "key_down",
"lazy": false,
"original_event": {
"momentary_switch_event": { "key_code": "f12" },
"type": "momentary_switch_event"
},
"validity": true
},
{
"device_id": 1,
"event": {
"momentary_switch_event": { "key_code": "f11" },
"type": "momentary_switch_event"
},
"event_time_stamp": {
"time_stamp": 4
},
"event_type": "key_down",
"lazy": false,
"original_event": {
"momentary_switch_event": { "key_code": "f11" },
"type": "momentary_switch_event"
},
"validity": true
},
{
"action": "invoke_dispatcher",
"time_stamp": 1000
}
]
Original file line number Diff line number Diff line change
@@ -0,0 +1,72 @@
[
{
"type": "basic",
"from": {
"key_code": "f11",
"modifiers": { "optional": ["any"] }
},
"to": [
{
"set_variable": {
"name": "f11_pressed",
"value": true,
"key_up_value": false
}
}
]
},
{
"type": "basic",
"from": {
"key_code": "f12",
"modifiers": { "optional": ["any"] }
},
"to": [
{
"key_code": "a",
"conditions": [
{
"type": "variable_if",
"name": "f11_pressed",
"value": true
}
]
},
{
"key_code": "b",
"conditions": [
{
"type": "variable_unless",
"name": "f11_pressed",
"value": true
}
]
}
],
"to_delayed_action": {
"to_if_invoked": [{ "key_code": "f1" }],
"to_if_canceled": [
{
"key_code": "1",
"conditions": [
{
"type": "variable_if",
"name": "f11_pressed",
"value": true
}
]
},
{
"key_code": "2",
"conditions": [
{
"type": "variable_unless",
"name": "f11_pressed",
"value": true
}
]
}
]
}
}
]
18 changes: 18 additions & 0 deletions tests/src/post_event_to_virtual_devices/json/tests.json
Original file line number Diff line number Diff line change
Expand Up @@ -383,6 +383,24 @@
"input_event_queue": "json/input_event_queue/to_if_held_down_7.json",
"expected_post_event_to_virtual_devices_queue": "json/expected_post_event_to_virtual_devices_queue/to_if_held_down_7.json"
},
{
"description": "to_conditions (no repeat)",
"rules": ["json/rules/to_conditions.json"],
"input_event_queue": "json/input_event_queue/to_conditions_1.json",
"expected_post_event_to_virtual_devices_queue": "json/expected_post_event_to_virtual_devices_queue/to_conditions_1.json"
},
{
"description": "to_conditions (f11_pressed == false)",
"rules": ["json/rules/to_conditions.json"],
"input_event_queue": "json/input_event_queue/to_conditions_2.json",
"expected_post_event_to_virtual_devices_queue": "json/expected_post_event_to_virtual_devices_queue/to_conditions_2.json"
},
{
"description": "to_conditions (f11_pressed == true)",
"rules": ["json/rules/to_conditions.json"],
"input_event_queue": "json/input_event_queue/to_conditions_3.json",
"expected_post_event_to_virtual_devices_queue": "json/expected_post_event_to_virtual_devices_queue/to_conditions_3.json"
},
{
"description": "to_delayed_action (no invoke, no cancel)",
"rules": ["json/rules/to_delayed_action.json"],
Expand Down

0 comments on commit 6b2f9e3

Please sign in to comment.