-
-
Notifications
You must be signed in to change notification settings - Fork 838
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
tests: Add avm2/edittext_selected_text test
- Loading branch information
1 parent
eef694e
commit 0f1c647
Showing
5 changed files
with
72 additions
and
0 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,28 @@ | ||
package { | ||
import flash.display.Sprite; | ||
import flash.events.KeyboardEvent; | ||
import flash.text.TextField; | ||
|
||
public class Test extends Sprite { | ||
private var text:TextField; | ||
|
||
public function Test() { | ||
text = new TextField(); | ||
text.border = true; | ||
text.width = 200; | ||
text.height = 40; | ||
text.type = "input"; | ||
text.multiline = true; | ||
addChild(text); | ||
|
||
stage.focus = text; | ||
stage.addEventListener(KeyboardEvent.KEY_DOWN, keyPressedDown); | ||
} | ||
|
||
private function keyPressedDown(event:KeyboardEvent):void { | ||
if (event.keyCode == 27) { | ||
trace("Selected: " + text.selectedText.replace("\r", "\n")); | ||
} | ||
} | ||
} | ||
} |
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 |
---|---|---|
@@ -0,0 +1,34 @@ | ||
[ | ||
{ "type": "KeyDown", "key_code": 27 }, | ||
{ "type": "TextInput", "codepoint": "1" }, | ||
{ "type": "TextInput", "codepoint": "2" }, | ||
{ "type": "TextInput", "codepoint": "3" }, | ||
{ "type": "TextInput", "codepoint": "4" }, | ||
{ "type": "TextInput", "codepoint": "5" }, | ||
{ "type": "TextInput", "codepoint": "6" }, | ||
{ "type": "KeyDown", "key_code": 27 }, | ||
{ "type": "TextControl", "code": "SelectAll" }, | ||
{ "type": "KeyDown", "key_code": 27 }, | ||
{ "type": "TextControl", "code": "MoveLeft" }, | ||
{ "type": "TextControl", "code": "MoveRight" }, | ||
{ "type": "TextControl", "code": "SelectRight" }, | ||
{ "type": "TextControl", "code": "SelectRight" }, | ||
{ "type": "TextControl", "code": "SelectRight" }, | ||
{ "type": "KeyDown", "key_code": 27 }, | ||
{ "type": "TextControl", "code": "MoveRight" }, | ||
{ "type": "TextControl", "code": "MoveRightDocument" }, | ||
{ "type": "TextControl", "code": "Enter" }, | ||
{ "type": "TextInput", "codepoint": "7" }, | ||
{ "type": "TextInput", "codepoint": "8" }, | ||
{ "type": "TextInput", "codepoint": "9" }, | ||
{ "type": "KeyDown", "key_code": 27 }, | ||
{ "type": "TextControl", "code": "SelectAll" }, | ||
{ "type": "KeyDown", "key_code": 27 }, | ||
{ "type": "TextControl", "code": "MoveRight" }, | ||
{ "type": "TextControl", "code": "MoveLeft" }, | ||
{ "type": "TextControl", "code": "SelectLeft" }, | ||
{ "type": "TextControl", "code": "SelectLeft" }, | ||
{ "type": "TextControl", "code": "SelectLeft" }, | ||
{ "type": "TextControl", "code": "SelectLeft" }, | ||
{ "type": "KeyDown", "key_code": 27 } | ||
] |
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 |
---|---|---|
@@ -0,0 +1,9 @@ | ||
Selected: | ||
Selected: | ||
Selected: 123456 | ||
Selected: 234 | ||
Selected: | ||
Selected: 123456 | ||
789 | ||
Selected: 6 | ||
78 |
Binary file not shown.
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 |
---|---|---|
@@ -0,0 +1 @@ | ||
num_ticks = 1 |