Skip to content

Commit

Permalink
Add json/input_event_queue/halt_7.jsonc
Browse files Browse the repository at this point in the history
  • Loading branch information
tekezo committed Feb 25, 2024
1 parent fd184d6 commit da60e16
Show file tree
Hide file tree
Showing 4 changed files with 200 additions and 0 deletions.
Original file line number Diff line number Diff line change
@@ -0,0 +1,64 @@
[
{
"keyboard_input": {
"keys": [],
"modifiers": [
"left_control"
]
},
"time_stamp": 5,
"type": "keyboard_input"
},
{
"keyboard_input": {
"keys": [],
"modifiers": []
},
"time_stamp": 10,
"type": "keyboard_input"
},
{
"keyboard_input": {
"keys": [
{
"key_code": "f17"
}
],
"modifiers": []
},
"time_stamp": 15,
"type": "keyboard_input"
},
{
"keyboard_input": {
"keys": [],
"modifiers": []
},
"time_stamp": 20,
"type": "keyboard_input"
},
{
"keyboard_input": {
"keys": [],
"modifiers": [
"left_control"
]
},
"time_stamp": 25,
"type": "keyboard_input"
},
{
"keyboard_input": {
"keys": [
{
"key_code": "tab"
}
],
"modifiers": [
"left_control"
]
},
"time_stamp": 30,
"type": "keyboard_input"
}
]
Original file line number Diff line number Diff line change
@@ -0,0 +1,108 @@
[
// Send events:
// - left_control key_down
// - f16 key_down
// - f16 key_up
// - tab key_down
//
// Expected result:
// - left_control key_down
// - left_control key_up
// - f17 key_down
// - f17 key_up
// - left_control key_down
// - tab key_down

// left_control key_down
{
"device_id": 1,
"event": {
"momentary_switch_event": {
"key_code": "left_control"
},
"type": "momentary_switch_event"
},
"event_origin": "grabbed_device",
"event_time_stamp": {
"time_stamp": 2
},
"event_type": "key_down",
"lazy": false,
"original_event": {
"momentary_switch_event": {
"key_code": "left_control"
},
"type": "momentary_switch_event"
},
"validity": true
},
// f16 key_down
{
"device_id": 1,
"event": {
"momentary_switch_event": {
"key_code": "f16"
},
"type": "momentary_switch_event"
},
"event_origin": "grabbed_device",
"event_time_stamp": {
"time_stamp": 4
},
"event_type": "key_down",
"lazy": false,
"original_event": {
"momentary_switch_event": {
"key_code": "f16"
},
"type": "momentary_switch_event"
},
"validity": true
},
// f16 key_up
{
"device_id": 1,
"event": {
"momentary_switch_event": {
"key_code": "f16"
},
"type": "momentary_switch_event"
},
"event_origin": "grabbed_device",
"event_time_stamp": {
"time_stamp": 6
},
"event_type": "key_up",
"lazy": false,
"original_event": {
"momentary_switch_event": {
"key_code": "f16"
},
"type": "momentary_switch_event"
},
"validity": true
},
// tab key_down
{
"device_id": 1,
"event": {
"momentary_switch_event": {
"key_code": "tab"
},
"type": "momentary_switch_event"
},
"event_origin": "grabbed_device",
"event_time_stamp": {
"time_stamp": 8
},
"event_type": "key_down",
"lazy": false,
"original_event": {
"momentary_switch_event": {
"key_code": "tab"
},
"type": "momentary_switch_event"
},
"validity": true
}
]
22 changes: 22 additions & 0 deletions tests/src/post_event_to_virtual_devices/json/rules/halt.jsonc
Original file line number Diff line number Diff line change
Expand Up @@ -83,5 +83,27 @@
"halt": true
}
]
},
{
"description": "with from modifiers",
"type": "basic",
"from": {
"key_code": "f16",
"modifiers": {
"mandatory": ["left_control"]
}
},
"to_after_key_up": [
{
"key_code": "f18",
"modifiers": ["left_shift"]
}
],
"to_if_alone": [
{
"key_code": "f17",
"halt": true
}
]
}
]
6 changes: 6 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 @@ -779,6 +779,12 @@
"input_event_queue": "json/input_event_queue/halt_6.jsonc",
"expected_post_event_to_virtual_devices_queue": "json/expected_post_event_to_virtual_devices_queue/halt_6.json"
},
{
"description": "halt_7 (with from modifiers)",
"rules": ["json/rules/halt.jsonc"],
"input_event_queue": "json/input_event_queue/halt_7.jsonc",
"expected_post_event_to_virtual_devices_queue": "json/expected_post_event_to_virtual_devices_queue/halt_7.json"
},
{
"description": "f10 to mute (fn function keys)",
"rules": ["json/rules/fn_function_keys.json"],
Expand Down

0 comments on commit da60e16

Please sign in to comment.