-
-
Notifications
You must be signed in to change notification settings - Fork 843
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
tests: Decouple input.json from Flash key codes
This refactor removes key codes from input.json aiming at moving key code mapping to core and creating a common, Flash-independent interface for input.
- Loading branch information
Showing
71 changed files
with
2,054 additions
and
1,995 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,5 +1,5 @@ | ||
mod format; | ||
mod injector; | ||
|
||
pub use format::{AutomatedEvent, MouseButton, TextControlCode}; | ||
pub use format::{AutomatedEvent, AutomatedKey, MouseButton, TextControlCode}; | ||
pub use injector::{InputInjector, MouseButtons}; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,17 +1,17 @@ | ||
[ | ||
{ "type": "KeyDown", "key_code": 65 }, | ||
{ "type": "KeyDown", "key": { "Char": "a" } }, | ||
{ "type": "TextInput", "codepoint": "a" }, | ||
{ "type": "KeyUp", "key_code": 65 }, | ||
{ "type": "KeyDown", "key_code": 66 }, | ||
{ "type": "KeyUp", "key": { "Char": "a" } }, | ||
{ "type": "KeyDown", "key": { "Char": "b" } }, | ||
{ "type": "TextInput", "codepoint": "b" }, | ||
{ "type": "KeyDown", "key_code": 65 }, | ||
{ "type": "KeyDown", "key": { "Char": "a" } }, | ||
{ "type": "TextInput", "codepoint": "a" }, | ||
{ "type": "KeyUp", "key_code": 66 }, | ||
{ "type": "KeyUp", "key_code": 65 }, | ||
{ "type": "KeyDown", "key_code": 9 }, | ||
{ "type": "KeyUp", "key": { "Char": "b" } }, | ||
{ "type": "KeyUp", "key": { "Char": "a" } }, | ||
{ "type": "KeyDown", "key": "Tab" }, | ||
{ "type": "TextInput", "codepoint": "\t" }, | ||
{ "type": "KeyUp", "key_code": 9 }, | ||
{ "type": "KeyDown", "key_code": 65 }, | ||
{ "type": "KeyUp", "key": "Tab" }, | ||
{ "type": "KeyDown", "key": { "Char": "a" } }, | ||
{ "type": "TextInput", "codepoint": "a" }, | ||
{ "type": "KeyUp", "key_code": 65 } | ||
{ "type": "KeyUp", "key": { "Char": "a" } } | ||
] |
60 changes: 30 additions & 30 deletions
60
tests/tests/swfs/avm1/button_key_events_special/input.json
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,56 +1,56 @@ | ||
[ | ||
{ "type": "KeyDown", "key_code": 37 }, | ||
{ "type": "KeyDown", "key": "ArrowLeft" }, | ||
{ "type": "TextControl", "code": "MoveLeft" }, | ||
{ "type": "KeyUp", "key_code": 37 }, | ||
{ "type": "KeyUp", "key": "ArrowLeft" }, | ||
|
||
{ "type": "KeyDown", "key_code": 39 }, | ||
{ "type": "KeyDown", "key": "ArrowRight" }, | ||
{ "type": "TextControl", "code": "MoveRight" }, | ||
{ "type": "KeyUp", "key_code": 39 }, | ||
{ "type": "KeyUp", "key": "ArrowRight" }, | ||
|
||
{ "type": "KeyDown", "key_code": 36 }, | ||
{ "type": "KeyDown", "key": "Home" }, | ||
{ "type": "TextControl", "code": "MoveLeftLine" }, | ||
{ "type": "KeyUp", "key_code": 36 }, | ||
{ "type": "KeyUp", "key": "Home" }, | ||
|
||
{ "type": "KeyDown", "key_code": 35 }, | ||
{ "type": "KeyDown", "key": "End" }, | ||
{ "type": "TextControl", "code": "MoveRightLine" }, | ||
{ "type": "KeyUp", "key_code": 35 }, | ||
{ "type": "KeyUp", "key": "End" }, | ||
|
||
{ "type": "KeyDown", "key_code": 45 }, | ||
{ "type": "KeyUp", "key_code": 45 }, | ||
{ "type": "KeyDown", "key": "Insert" }, | ||
{ "type": "KeyUp", "key": "Insert" }, | ||
|
||
{ "type": "KeyDown", "key_code": 46 }, | ||
{ "type": "KeyDown", "key": "Delete" }, | ||
{ "type": "TextControl", "code": "Delete" }, | ||
{ "type": "KeyUp", "key_code": 46 }, | ||
{ "type": "KeyUp", "key": "Delete" }, | ||
|
||
{ "type": "KeyDown", "key_code": 8 }, | ||
{ "type": "KeyDown", "key": "Backspace" }, | ||
{ "type": "TextControl", "code": "Backspace" }, | ||
{ "type": "KeyUp", "key_code": 8 }, | ||
{ "type": "KeyUp", "key": "Backspace" }, | ||
|
||
{ "type": "KeyDown", "key_code": 9 }, | ||
{ "type": "KeyDown", "key": "Tab" }, | ||
{ "type": "TextInput", "codepoint": "\t" }, | ||
{ "type": "KeyUp", "key_code": 9 }, | ||
{ "type": "KeyUp", "key": "Tab" }, | ||
|
||
{ "type": "KeyDown", "key_code": 13 }, | ||
{ "type": "KeyDown", "key": "Enter" }, | ||
{ "type": "TextControl", "code": "Enter" }, | ||
{ "type": "KeyUp", "key_code": 13 }, | ||
{ "type": "KeyUp", "key": "Enter" }, | ||
|
||
{ "type": "KeyDown", "key_code": 38 }, | ||
{ "type": "KeyUp", "key_code": 38 }, | ||
{ "type": "KeyDown", "key": "ArrowUp" }, | ||
{ "type": "KeyUp", "key": "ArrowUp" }, | ||
|
||
{ "type": "KeyDown", "key_code": 40 }, | ||
{ "type": "KeyUp", "key_code": 40 }, | ||
{ "type": "KeyDown", "key": "ArrowDown" }, | ||
{ "type": "KeyUp", "key": "ArrowDown" }, | ||
|
||
{ "type": "KeyDown", "key_code": 33 }, | ||
{ "type": "KeyUp", "key_code": 33 }, | ||
{ "type": "KeyDown", "key": "PageUp" }, | ||
{ "type": "KeyUp", "key": "PageUp" }, | ||
|
||
{ "type": "KeyDown", "key_code": 34 }, | ||
{ "type": "KeyUp", "key_code": 34 }, | ||
{ "type": "KeyDown", "key": "PageDown" }, | ||
{ "type": "KeyUp", "key": "PageDown" }, | ||
|
||
{ "type": "KeyDown", "key_code": 27 }, | ||
{ "type": "KeyDown", "key": "Escape" }, | ||
{ "type": "TextInput", "codepoint": "\u001b" }, | ||
{ "type": "KeyUp", "key_code": 27 }, | ||
{ "type": "KeyUp", "key": "Escape" }, | ||
|
||
{ "type": "KeyDown", "key_code": 32 }, | ||
{ "type": "KeyDown", "key": "Space" }, | ||
{ "type": "TextInput", "codepoint": " " }, | ||
{ "type": "KeyUp", "key_code": 32 } | ||
{ "type": "KeyUp", "key": "Space" } | ||
] |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -27,7 +27,7 @@ | |
}, | ||
{ | ||
"type": "KeyDown", | ||
"key_code": 13 | ||
"key": "Enter" | ||
}, | ||
{ | ||
"type": "Wait" | ||
|
20 changes: 10 additions & 10 deletions
20
tests/tests/swfs/avm1/button_keypress_vs_press/input.json
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,17 +1,17 @@ | ||
[ | ||
{ "type": "KeyDown", "key_code": 13 }, | ||
{ "type": "KeyDown", "key": "Enter" }, | ||
{ "type": "TextControl", "code": "Enter" }, | ||
{ "type": "KeyUp", "key_code": 13 }, | ||
{ "type": "KeyDown", "key_code": 32 }, | ||
{ "type": "KeyUp", "key": "Enter" }, | ||
{ "type": "KeyDown", "key": "Space" }, | ||
{ "type": "TextInput", "codepoint": " " }, | ||
{ "type": "KeyUp", "key_code": 32 }, | ||
{ "type": "KeyDown", "key_code": 9 }, | ||
{ "type": "KeyUp", "key": "Space" }, | ||
{ "type": "KeyDown", "key": "Tab" }, | ||
{ "type": "TextInput", "codepoint": "\t" }, | ||
{ "type": "KeyUp", "key_code": 9 }, | ||
{ "type": "KeyDown", "key_code": 13 }, | ||
{ "type": "KeyUp", "key": "Tab" }, | ||
{ "type": "KeyDown", "key": "Enter" }, | ||
{ "type": "TextControl", "code": "Enter" }, | ||
{ "type": "KeyUp", "key_code": 13 }, | ||
{ "type": "KeyDown", "key_code": 32 }, | ||
{ "type": "KeyUp", "key": "Enter" }, | ||
{ "type": "KeyDown", "key": "Space" }, | ||
{ "type": "TextInput", "codepoint": " " }, | ||
{ "type": "KeyUp", "key_code": 32 } | ||
{ "type": "KeyUp", "key": "Space" } | ||
] |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,16 +1,16 @@ | ||
[ | ||
{ "type": "KeyDown", "key_code": 9 }, | ||
{ "type": "KeyDown", "key": "Tab" }, | ||
{ "type": "TextInput", "codepoint": "\t" }, | ||
{ "type": "KeyUp", "key_code": 9 }, | ||
{ "type": "KeyDown", "key_code": 9 }, | ||
{ "type": "KeyUp", "key": "Tab" }, | ||
{ "type": "KeyDown", "key": "Tab" }, | ||
{ "type": "TextInput", "codepoint": "\t" }, | ||
{ "type": "KeyUp", "key_code": 9 }, | ||
{ "type": "KeyDown", "key_code": 27 }, | ||
{ "type": "KeyUp", "key_code": 27 }, | ||
{ "type": "KeyDown", "key_code": 9 }, | ||
{ "type": "KeyUp", "key": "Tab" }, | ||
{ "type": "KeyDown", "key": "Escape" }, | ||
{ "type": "KeyUp", "key": "Escape" }, | ||
{ "type": "KeyDown", "key": "Tab" }, | ||
{ "type": "TextInput", "codepoint": "\t" }, | ||
{ "type": "KeyUp", "key_code": 9 }, | ||
{ "type": "KeyDown", "key_code": 9 }, | ||
{ "type": "KeyUp", "key": "Tab" }, | ||
{ "type": "KeyDown", "key": "Tab" }, | ||
{ "type": "TextInput", "codepoint": "\t" }, | ||
{ "type": "KeyUp", "key_code": 9 } | ||
{ "type": "KeyUp", "key": "Tab" } | ||
] |
8 changes: 4 additions & 4 deletions
8
tests/tests/swfs/avm1/button_keypress_vs_textinput/input.json
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,8 +1,8 @@ | ||
[ | ||
{ "type": "KeyDown", "key_code": 65 }, | ||
{ "type": "KeyDown", "key": { "Char": "a" } }, | ||
{ "type": "TextInput", "codepoint": "a" }, | ||
{ "type": "KeyUp", "key_code": 65 }, | ||
{ "type": "KeyDown", "key_code": 66 }, | ||
{ "type": "KeyUp", "key": { "Char": "a" } }, | ||
{ "type": "KeyDown", "key": { "Char": "b" } }, | ||
{ "type": "TextInput", "codepoint": "b" }, | ||
{ "type": "KeyUp", "key_code": 66 } | ||
{ "type": "KeyUp", "key": { "Char": "b" } } | ||
] |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,9 +1,9 @@ | ||
[ | ||
{ "type": "SetClipboardText", "text": "test" }, | ||
{ "type": "TextControl", "code": "Paste" }, | ||
{ "type": "KeyDown", "key_code": 27 }, | ||
{ "type": "KeyDown", "key": "Escape" }, | ||
{ "type": "SetClipboardText", "text": "" }, | ||
{ "type": "TextControl", "code": "SelectAll" }, | ||
{ "type": "TextControl", "code": "Paste" }, | ||
{ "type": "KeyDown", "key_code": 27 } | ||
{ "type": "KeyDown", "key": "Escape" } | ||
] |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,11 +1,11 @@ | ||
[ | ||
{ "type": "KeyDown", "key_code": 27 }, | ||
{ "type": "KeyDown", "key": "Escape" }, | ||
{ "type": "MouseMove", "pos": [400, 10] }, | ||
{ "type": "MouseDown", "pos": [400, 10], "btn": "Left" }, | ||
{ "type": "MouseUp", "pos": [400, 10], "btn": "Left" }, | ||
{ "type": "TextInput", "codepoint": "a" }, | ||
{ "type": "TextInput", "codepoint": "s" }, | ||
{ "type": "TextInput", "codepoint": "d" }, | ||
{ "type": "TextInput", "codepoint": "f" }, | ||
{ "type": "KeyDown", "key_code": 27 } | ||
{ "type": "KeyDown", "key": "Escape" } | ||
] |
Oops, something went wrong.