From 8f9af7579a567372cee7985c35814bc9bba5bcd3 Mon Sep 17 00:00:00 2001 From: Kamil Jarosz Date: Sat, 13 Jul 2024 03:41:56 +0200 Subject: [PATCH] tests: Add avm2/focus_events_mixed_key_mouse test This test verifies the behavior of focus-related events when changing focus using keyboard and mouse interchangeably. --- .../avm2/focus_events_mixed_key_mouse/Test.as | 93 +++++++++++++++ .../focus_events_mixed_key_mouse/input.json | 49 ++++++++ .../input.json.py | 37 ++++++ .../focus_events_mixed_key_mouse/output.txt | 112 ++++++++++++++++++ .../focus_events_mixed_key_mouse/test.swf | Bin 0 -> 1893 bytes .../focus_events_mixed_key_mouse/test.toml | 1 + 6 files changed, 292 insertions(+) create mode 100644 tests/tests/swfs/avm2/focus_events_mixed_key_mouse/Test.as create mode 100644 tests/tests/swfs/avm2/focus_events_mixed_key_mouse/input.json create mode 100755 tests/tests/swfs/avm2/focus_events_mixed_key_mouse/input.json.py create mode 100644 tests/tests/swfs/avm2/focus_events_mixed_key_mouse/output.txt create mode 100644 tests/tests/swfs/avm2/focus_events_mixed_key_mouse/test.swf create mode 100644 tests/tests/swfs/avm2/focus_events_mixed_key_mouse/test.toml diff --git a/tests/tests/swfs/avm2/focus_events_mixed_key_mouse/Test.as b/tests/tests/swfs/avm2/focus_events_mixed_key_mouse/Test.as new file mode 100644 index 0000000000000..0fba8ef2bb6ff --- /dev/null +++ b/tests/tests/swfs/avm2/focus_events_mixed_key_mouse/Test.as @@ -0,0 +1,93 @@ +package { + +import flash.display.InteractiveObject; +import flash.display.MovieClip; +import flash.display.Sprite; +import flash.events.Event; +import flash.events.KeyboardEvent; +import flash.events.MouseEvent; + +[SWF(width="300", height="200")] +public class Test extends MovieClip { + private var sprite1: Sprite; + private var sprite2: Sprite; + private var sprite3: Sprite; + + private var logDirty: Boolean = true; + + public function Test() { + super(); + + sprite1 = newSprite(0xFF0000); + sprite1.name = "spriteA"; + sprite1.x = 0; + sprite1.y = 100; + sprite1.tabEnabled = true; + sprite1.tabIndex = 1; + sprite2 = newSprite(0x00FF00); + sprite2.name = "spriteA"; + sprite2.x = 100; + sprite2.y = 100; + sprite2.tabEnabled = true; + sprite2.tabIndex = 2; + sprite3 = newSprite(0x0000FF); + sprite3.name = "spriteA"; + sprite3.x = 200; + sprite3.y = 100; + sprite3.tabEnabled = true; + + stage.addChild(sprite1); + stage.addChild(sprite2); + stage.addChild(sprite3); + + stage.addEventListener("keyDown", function(evt:KeyboardEvent):void { + if (evt.keyCode == 27 && logDirty) { + logDirty = false; + trace("Escape pressed"); + } + if (evt.keyCode == 9) { + trace("Tab pressed"); + } + }); + + function eventListener(obj: InteractiveObject): Function { + return function(evt: Event): void { + var str; + if (evt is MouseEvent) { + str = evt.formatToString( + "MouseEvent", "type", "cancelable", "eventPhase", + "relatedObject", "ctrlKey", "altKey", "shiftKey"); + } else { + str = evt.toString(); + } + trace(" " + obj.name + ", " + evt.target.name + ": " + str); + logDirty = true; + } + } + + for each (var obj: InteractiveObject in [ + sprite1, sprite2, sprite3, + stage + ]) { + obj.addEventListener("focusIn", eventListener(obj)); + obj.addEventListener("focusOut", eventListener(obj)); + obj.addEventListener("mouseDown", eventListener(obj)); + obj.addEventListener("mouseUp", eventListener(obj)); + obj.addEventListener("click", eventListener(obj)); + obj.addEventListener("mouseFocusChange", eventListener(obj)); + obj.addEventListener("keyFocusChange", eventListener(obj)); + obj.addEventListener("rollOut", eventListener(obj)); + obj.addEventListener("rollOver", eventListener(obj)); + obj.addEventListener("mouseOver", eventListener(obj)); + } + } + + private function newSprite(color: int): Sprite { + var s:Sprite = new Sprite(); + s.graphics.beginFill(color); + s.graphics.drawRect(0, 0, 100, 100); + s.graphics.endFill(); + return s; + } +} +} diff --git a/tests/tests/swfs/avm2/focus_events_mixed_key_mouse/input.json b/tests/tests/swfs/avm2/focus_events_mixed_key_mouse/input.json new file mode 100644 index 0000000000000..32c80244a178a --- /dev/null +++ b/tests/tests/swfs/avm2/focus_events_mixed_key_mouse/input.json @@ -0,0 +1,49 @@ +[ + { "type": "KeyDown", "key_code": 9 }, + { "type": "KeyUp", "key_code": 9 }, + { "type": "KeyDown", "key_code": 9 }, + { "type": "KeyUp", "key_code": 9 }, + { "type": "KeyDown", "key_code": 27 }, + { "type": "KeyUp", "key_code": 27 }, + { "type": "MouseMove", "pos": [1, 101] }, + { "type": "MouseDown", "pos": [1, 101], "btn": "Left" }, + { "type": "MouseUp", "pos": [1, 101], "btn": "Left" }, + { "type": "KeyDown", "key_code": 9 }, + { "type": "KeyUp", "key_code": 9 }, + { "type": "KeyDown", "key_code": 27 }, + { "type": "KeyUp", "key_code": 27 }, + { "type": "MouseMove", "pos": [101, 101] }, + { "type": "MouseDown", "pos": [101, 101], "btn": "Left" }, + { "type": "MouseUp", "pos": [101, 101], "btn": "Left" }, + { "type": "KeyDown", "key_code": 9 }, + { "type": "KeyUp", "key_code": 9 }, + { "type": "KeyDown", "key_code": 27 }, + { "type": "KeyUp", "key_code": 27 }, + { "type": "KeyDown", "key_code": 9 }, + { "type": "KeyUp", "key_code": 9 }, + { "type": "MouseMove", "pos": [101, 101] }, + { "type": "MouseDown", "pos": [101, 101], "btn": "Left" }, + { "type": "MouseUp", "pos": [101, 101], "btn": "Left" }, + { "type": "KeyDown", "key_code": 27 }, + { "type": "KeyUp", "key_code": 27 }, + { "type": "MouseMove", "pos": [201, 101] }, + { "type": "MouseDown", "pos": [201, 101], "btn": "Left" }, + { "type": "MouseUp", "pos": [201, 101], "btn": "Left" }, + { "type": "KeyDown", "key_code": 9 }, + { "type": "KeyUp", "key_code": 9 }, + { "type": "KeyDown", "key_code": 27 }, + { "type": "KeyUp", "key_code": 27 }, + { "type": "MouseMove", "pos": [1, 1] }, + { "type": "MouseDown", "pos": [1, 1], "btn": "Left" }, + { "type": "MouseUp", "pos": [1, 1], "btn": "Left" }, + { "type": "KeyDown", "key_code": 9 }, + { "type": "KeyUp", "key_code": 9 }, + { "type": "KeyDown", "key_code": 27 }, + { "type": "KeyUp", "key_code": 27 }, + { "type": "MouseMove", "pos": [1, 1] }, + { "type": "MouseDown", "pos": [1, 1], "btn": "Left" }, + { "type": "MouseUp", "pos": [1, 1], "btn": "Left" }, + { "type": "KeyDown", "key_code": 27 }, + { "type": "KeyUp", "key_code": 27 }, + { "type": "FocusLost" } +] diff --git a/tests/tests/swfs/avm2/focus_events_mixed_key_mouse/input.json.py b/tests/tests/swfs/avm2/focus_events_mixed_key_mouse/input.json.py new file mode 100755 index 0000000000000..1eaf6a23d38a7 --- /dev/null +++ b/tests/tests/swfs/avm2/focus_events_mixed_key_mouse/input.json.py @@ -0,0 +1,37 @@ +#!/usr/bin/env python3 + +coord_map = { + 'void': [1, 1], + 'sprite1': [1, 101], + 'sprite2': [101, 101], + 'sprite3': [201, 101], +} + +click_seq = [ + 'tab', 'tab', 'esc', + 'sprite1', 'tab', 'esc', + 'sprite2', 'tab', 'esc', + 'tab', 'sprite2', 'esc', + 'sprite3', 'tab', 'esc', + 'void', 'tab', 'esc', + 'void', 'esc', +] + +print('[') + +for obj in click_seq: + if obj == 'esc': + print(f' {{ "type": "KeyDown", "key_code": 27 }},') + print(f' {{ "type": "KeyUp", "key_code": 27 }},') + continue + if obj == 'tab': + print(f' {{ "type": "KeyDown", "key_code": 9 }},') + print(f' {{ "type": "KeyUp", "key_code": 9 }},') + continue + pos = coord_map[obj] + print(f' {{ "type": "MouseMove", "pos": {pos} }},') + print(f' {{ "type": "MouseDown", "pos": {pos}, "btn": "Left" }},') + print(f' {{ "type": "MouseUp", "pos": {pos}, "btn": "Left" }},') + +print(f' {{ "type": "FocusLost" }}') +print(']') diff --git a/tests/tests/swfs/avm2/focus_events_mixed_key_mouse/output.txt b/tests/tests/swfs/avm2/focus_events_mixed_key_mouse/output.txt new file mode 100644 index 0000000000000..0a98cee1299d0 --- /dev/null +++ b/tests/tests/swfs/avm2/focus_events_mixed_key_mouse/output.txt @@ -0,0 +1,112 @@ +Tab pressed + null, null: [FocusEvent type="keyFocusChange" bubbles=true cancelable=true eventPhase=2 relatedObject=[object Sprite] shiftKey=false keyCode=9] + spriteA, spriteA: [FocusEvent type="focusIn" bubbles=true cancelable=false eventPhase=2 relatedObject=null shiftKey=false keyCode=0] + null, spriteA: [FocusEvent type="focusIn" bubbles=true cancelable=false eventPhase=3 relatedObject=null shiftKey=false keyCode=0] +Tab pressed + spriteA, spriteA: [FocusEvent type="keyFocusChange" bubbles=true cancelable=true eventPhase=2 relatedObject=[object Sprite] shiftKey=false keyCode=9] + null, spriteA: [FocusEvent type="keyFocusChange" bubbles=true cancelable=true eventPhase=3 relatedObject=[object Sprite] shiftKey=false keyCode=9] + spriteA, spriteA: [FocusEvent type="focusOut" bubbles=true cancelable=false eventPhase=2 relatedObject=[object Sprite] shiftKey=false keyCode=0] + null, spriteA: [FocusEvent type="focusOut" bubbles=true cancelable=false eventPhase=3 relatedObject=[object Sprite] shiftKey=false keyCode=0] + spriteA, spriteA: [FocusEvent type="focusIn" bubbles=true cancelable=false eventPhase=2 relatedObject=[object Sprite] shiftKey=false keyCode=0] + null, spriteA: [FocusEvent type="focusIn" bubbles=true cancelable=false eventPhase=3 relatedObject=[object Sprite] shiftKey=false keyCode=0] +Escape pressed + spriteA, spriteA: [MouseEvent type="rollOver" cancelable=false eventPhase=2 relatedObject=null ctrlKey=false altKey=false shiftKey=false] + spriteA, spriteA: [MouseEvent type="mouseOver" cancelable=false eventPhase=2 relatedObject=null ctrlKey=false altKey=false shiftKey=false] + null, spriteA: [MouseEvent type="mouseOver" cancelable=false eventPhase=3 relatedObject=null ctrlKey=false altKey=false shiftKey=false] + spriteA, spriteA: [FocusEvent type="mouseFocusChange" bubbles=true cancelable=true eventPhase=2 relatedObject=[object Sprite] shiftKey=false keyCode=0] + null, spriteA: [FocusEvent type="mouseFocusChange" bubbles=true cancelable=true eventPhase=3 relatedObject=[object Sprite] shiftKey=false keyCode=0] + spriteA, spriteA: [FocusEvent type="focusOut" bubbles=true cancelable=false eventPhase=2 relatedObject=[object Sprite] shiftKey=false keyCode=0] + null, spriteA: [FocusEvent type="focusOut" bubbles=true cancelable=false eventPhase=3 relatedObject=[object Sprite] shiftKey=false keyCode=0] + spriteA, spriteA: [FocusEvent type="focusIn" bubbles=true cancelable=false eventPhase=2 relatedObject=[object Sprite] shiftKey=false keyCode=0] + null, spriteA: [FocusEvent type="focusIn" bubbles=true cancelable=false eventPhase=3 relatedObject=[object Sprite] shiftKey=false keyCode=0] + spriteA, spriteA: [MouseEvent type="mouseDown" cancelable=false eventPhase=2 relatedObject=null ctrlKey=false altKey=false shiftKey=false] + null, spriteA: [MouseEvent type="mouseDown" cancelable=false eventPhase=3 relatedObject=null ctrlKey=false altKey=false shiftKey=false] + spriteA, spriteA: [MouseEvent type="mouseUp" cancelable=false eventPhase=2 relatedObject=null ctrlKey=false altKey=false shiftKey=false] + null, spriteA: [MouseEvent type="mouseUp" cancelable=false eventPhase=3 relatedObject=null ctrlKey=false altKey=false shiftKey=false] + spriteA, spriteA: [MouseEvent type="click" cancelable=false eventPhase=2 relatedObject=null ctrlKey=false altKey=false shiftKey=false] + null, spriteA: [MouseEvent type="click" cancelable=false eventPhase=3 relatedObject=null ctrlKey=false altKey=false shiftKey=false] +Tab pressed + spriteA, spriteA: [FocusEvent type="keyFocusChange" bubbles=true cancelable=true eventPhase=2 relatedObject=[object Sprite] shiftKey=false keyCode=9] + null, spriteA: [FocusEvent type="keyFocusChange" bubbles=true cancelable=true eventPhase=3 relatedObject=[object Sprite] shiftKey=false keyCode=9] + spriteA, spriteA: [FocusEvent type="focusOut" bubbles=true cancelable=false eventPhase=2 relatedObject=[object Sprite] shiftKey=false keyCode=0] + null, spriteA: [FocusEvent type="focusOut" bubbles=true cancelable=false eventPhase=3 relatedObject=[object Sprite] shiftKey=false keyCode=0] + spriteA, spriteA: [FocusEvent type="focusIn" bubbles=true cancelable=false eventPhase=2 relatedObject=[object Sprite] shiftKey=false keyCode=0] + null, spriteA: [FocusEvent type="focusIn" bubbles=true cancelable=false eventPhase=3 relatedObject=[object Sprite] shiftKey=false keyCode=0] +Escape pressed + spriteA, spriteA: [MouseEvent type="rollOut" cancelable=false eventPhase=2 relatedObject=[object Sprite] ctrlKey=false altKey=false shiftKey=false] + spriteA, spriteA: [MouseEvent type="rollOver" cancelable=false eventPhase=2 relatedObject=[object Sprite] ctrlKey=false altKey=false shiftKey=false] + spriteA, spriteA: [MouseEvent type="mouseOver" cancelable=false eventPhase=2 relatedObject=[object Sprite] ctrlKey=false altKey=false shiftKey=false] + null, spriteA: [MouseEvent type="mouseOver" cancelable=false eventPhase=3 relatedObject=[object Sprite] ctrlKey=false altKey=false shiftKey=false] + spriteA, spriteA: [MouseEvent type="mouseDown" cancelable=false eventPhase=2 relatedObject=null ctrlKey=false altKey=false shiftKey=false] + null, spriteA: [MouseEvent type="mouseDown" cancelable=false eventPhase=3 relatedObject=null ctrlKey=false altKey=false shiftKey=false] + spriteA, spriteA: [MouseEvent type="mouseUp" cancelable=false eventPhase=2 relatedObject=null ctrlKey=false altKey=false shiftKey=false] + null, spriteA: [MouseEvent type="mouseUp" cancelable=false eventPhase=3 relatedObject=null ctrlKey=false altKey=false shiftKey=false] + spriteA, spriteA: [MouseEvent type="click" cancelable=false eventPhase=2 relatedObject=null ctrlKey=false altKey=false shiftKey=false] + null, spriteA: [MouseEvent type="click" cancelable=false eventPhase=3 relatedObject=null ctrlKey=false altKey=false shiftKey=false] +Tab pressed + spriteA, spriteA: [FocusEvent type="keyFocusChange" bubbles=true cancelable=true eventPhase=2 relatedObject=[object Sprite] shiftKey=false keyCode=9] + null, spriteA: [FocusEvent type="keyFocusChange" bubbles=true cancelable=true eventPhase=3 relatedObject=[object Sprite] shiftKey=false keyCode=9] + spriteA, spriteA: [FocusEvent type="focusOut" bubbles=true cancelable=false eventPhase=2 relatedObject=[object Sprite] shiftKey=false keyCode=0] + null, spriteA: [FocusEvent type="focusOut" bubbles=true cancelable=false eventPhase=3 relatedObject=[object Sprite] shiftKey=false keyCode=0] + spriteA, spriteA: [FocusEvent type="focusIn" bubbles=true cancelable=false eventPhase=2 relatedObject=[object Sprite] shiftKey=false keyCode=0] + null, spriteA: [FocusEvent type="focusIn" bubbles=true cancelable=false eventPhase=3 relatedObject=[object Sprite] shiftKey=false keyCode=0] +Escape pressed +Tab pressed + spriteA, spriteA: [FocusEvent type="keyFocusChange" bubbles=true cancelable=true eventPhase=2 relatedObject=[object Sprite] shiftKey=false keyCode=9] + null, spriteA: [FocusEvent type="keyFocusChange" bubbles=true cancelable=true eventPhase=3 relatedObject=[object Sprite] shiftKey=false keyCode=9] + spriteA, spriteA: [FocusEvent type="focusOut" bubbles=true cancelable=false eventPhase=2 relatedObject=[object Sprite] shiftKey=false keyCode=0] + null, spriteA: [FocusEvent type="focusOut" bubbles=true cancelable=false eventPhase=3 relatedObject=[object Sprite] shiftKey=false keyCode=0] + spriteA, spriteA: [FocusEvent type="focusIn" bubbles=true cancelable=false eventPhase=2 relatedObject=[object Sprite] shiftKey=false keyCode=0] + null, spriteA: [FocusEvent type="focusIn" bubbles=true cancelable=false eventPhase=3 relatedObject=[object Sprite] shiftKey=false keyCode=0] + spriteA, spriteA: [MouseEvent type="mouseDown" cancelable=false eventPhase=2 relatedObject=null ctrlKey=false altKey=false shiftKey=false] + null, spriteA: [MouseEvent type="mouseDown" cancelable=false eventPhase=3 relatedObject=null ctrlKey=false altKey=false shiftKey=false] + spriteA, spriteA: [MouseEvent type="mouseUp" cancelable=false eventPhase=2 relatedObject=null ctrlKey=false altKey=false shiftKey=false] + null, spriteA: [MouseEvent type="mouseUp" cancelable=false eventPhase=3 relatedObject=null ctrlKey=false altKey=false shiftKey=false] + spriteA, spriteA: [MouseEvent type="click" cancelable=false eventPhase=2 relatedObject=null ctrlKey=false altKey=false shiftKey=false] + null, spriteA: [MouseEvent type="click" cancelable=false eventPhase=3 relatedObject=null ctrlKey=false altKey=false shiftKey=false] +Escape pressed + spriteA, spriteA: [MouseEvent type="rollOut" cancelable=false eventPhase=2 relatedObject=[object Sprite] ctrlKey=false altKey=false shiftKey=false] + spriteA, spriteA: [MouseEvent type="rollOver" cancelable=false eventPhase=2 relatedObject=[object Sprite] ctrlKey=false altKey=false shiftKey=false] + spriteA, spriteA: [MouseEvent type="mouseOver" cancelable=false eventPhase=2 relatedObject=[object Sprite] ctrlKey=false altKey=false shiftKey=false] + null, spriteA: [MouseEvent type="mouseOver" cancelable=false eventPhase=3 relatedObject=[object Sprite] ctrlKey=false altKey=false shiftKey=false] + spriteA, spriteA: [FocusEvent type="mouseFocusChange" bubbles=true cancelable=true eventPhase=2 relatedObject=[object Sprite] shiftKey=false keyCode=0] + null, spriteA: [FocusEvent type="mouseFocusChange" bubbles=true cancelable=true eventPhase=3 relatedObject=[object Sprite] shiftKey=false keyCode=0] + spriteA, spriteA: [FocusEvent type="focusOut" bubbles=true cancelable=false eventPhase=2 relatedObject=[object Sprite] shiftKey=false keyCode=0] + null, spriteA: [FocusEvent type="focusOut" bubbles=true cancelable=false eventPhase=3 relatedObject=[object Sprite] shiftKey=false keyCode=0] + spriteA, spriteA: [FocusEvent type="focusIn" bubbles=true cancelable=false eventPhase=2 relatedObject=[object Sprite] shiftKey=false keyCode=0] + null, spriteA: [FocusEvent type="focusIn" bubbles=true cancelable=false eventPhase=3 relatedObject=[object Sprite] shiftKey=false keyCode=0] + spriteA, spriteA: [MouseEvent type="mouseDown" cancelable=false eventPhase=2 relatedObject=null ctrlKey=false altKey=false shiftKey=false] + null, spriteA: [MouseEvent type="mouseDown" cancelable=false eventPhase=3 relatedObject=null ctrlKey=false altKey=false shiftKey=false] + spriteA, spriteA: [MouseEvent type="mouseUp" cancelable=false eventPhase=2 relatedObject=null ctrlKey=false altKey=false shiftKey=false] + null, spriteA: [MouseEvent type="mouseUp" cancelable=false eventPhase=3 relatedObject=null ctrlKey=false altKey=false shiftKey=false] + spriteA, spriteA: [MouseEvent type="click" cancelable=false eventPhase=2 relatedObject=null ctrlKey=false altKey=false shiftKey=false] + null, spriteA: [MouseEvent type="click" cancelable=false eventPhase=3 relatedObject=null ctrlKey=false altKey=false shiftKey=false] +Tab pressed + spriteA, spriteA: [FocusEvent type="keyFocusChange" bubbles=true cancelable=true eventPhase=2 relatedObject=[object Sprite] shiftKey=false keyCode=9] + null, spriteA: [FocusEvent type="keyFocusChange" bubbles=true cancelable=true eventPhase=3 relatedObject=[object Sprite] shiftKey=false keyCode=9] + spriteA, spriteA: [FocusEvent type="focusOut" bubbles=true cancelable=false eventPhase=2 relatedObject=[object Sprite] shiftKey=false keyCode=0] + null, spriteA: [FocusEvent type="focusOut" bubbles=true cancelable=false eventPhase=3 relatedObject=[object Sprite] shiftKey=false keyCode=0] + spriteA, spriteA: [FocusEvent type="focusIn" bubbles=true cancelable=false eventPhase=2 relatedObject=[object Sprite] shiftKey=false keyCode=0] + null, spriteA: [FocusEvent type="focusIn" bubbles=true cancelable=false eventPhase=3 relatedObject=[object Sprite] shiftKey=false keyCode=0] +Escape pressed + spriteA, spriteA: [MouseEvent type="rollOut" cancelable=false eventPhase=2 relatedObject=null ctrlKey=false altKey=false shiftKey=false] + spriteA, spriteA: [FocusEvent type="mouseFocusChange" bubbles=true cancelable=true eventPhase=2 relatedObject=null shiftKey=false keyCode=0] + null, spriteA: [FocusEvent type="mouseFocusChange" bubbles=true cancelable=true eventPhase=3 relatedObject=null shiftKey=false keyCode=0] + spriteA, spriteA: [FocusEvent type="focusOut" bubbles=true cancelable=false eventPhase=2 relatedObject=null shiftKey=false keyCode=0] + null, spriteA: [FocusEvent type="focusOut" bubbles=true cancelable=false eventPhase=3 relatedObject=null shiftKey=false keyCode=0] + null, null: [MouseEvent type="mouseDown" cancelable=false eventPhase=2 relatedObject=null ctrlKey=false altKey=false shiftKey=false] + null, null: [MouseEvent type="mouseUp" cancelable=false eventPhase=2 relatedObject=null ctrlKey=false altKey=false shiftKey=false] + null, null: [MouseEvent type="click" cancelable=false eventPhase=2 relatedObject=null ctrlKey=false altKey=false shiftKey=false] +Tab pressed + null, null: [FocusEvent type="keyFocusChange" bubbles=true cancelable=true eventPhase=2 relatedObject=[object Sprite] shiftKey=false keyCode=9] + spriteA, spriteA: [FocusEvent type="focusIn" bubbles=true cancelable=false eventPhase=2 relatedObject=null shiftKey=false keyCode=0] + null, spriteA: [FocusEvent type="focusIn" bubbles=true cancelable=false eventPhase=3 relatedObject=null shiftKey=false keyCode=0] +Escape pressed + spriteA, spriteA: [FocusEvent type="mouseFocusChange" bubbles=true cancelable=true eventPhase=2 relatedObject=null shiftKey=false keyCode=0] + null, spriteA: [FocusEvent type="mouseFocusChange" bubbles=true cancelable=true eventPhase=3 relatedObject=null shiftKey=false keyCode=0] + spriteA, spriteA: [FocusEvent type="focusOut" bubbles=true cancelable=false eventPhase=2 relatedObject=null shiftKey=false keyCode=0] + null, spriteA: [FocusEvent type="focusOut" bubbles=true cancelable=false eventPhase=3 relatedObject=null shiftKey=false keyCode=0] + null, null: [MouseEvent type="mouseDown" cancelable=false eventPhase=2 relatedObject=null ctrlKey=false altKey=false shiftKey=false] + null, null: [MouseEvent type="mouseUp" cancelable=false eventPhase=2 relatedObject=null ctrlKey=false altKey=false shiftKey=false] + null, null: [MouseEvent type="click" cancelable=false eventPhase=2 relatedObject=null ctrlKey=false altKey=false shiftKey=false] +Escape pressed diff --git a/tests/tests/swfs/avm2/focus_events_mixed_key_mouse/test.swf b/tests/tests/swfs/avm2/focus_events_mixed_key_mouse/test.swf new file mode 100644 index 0000000000000000000000000000000000000000..e223efc44e3d63464d29cd27fec26a2c4e9bc465 GIT binary patch literal 1893 zcmV-r2b%apS5qm13jhFk0fko0Qya?>pV^T#T77`{u)tWhWh21Y0xc5Q2HO~n5XN8d zj4^&rWU|_wMf<$$s&-cb4yjQ715&xas+6y(9COJnm-niYn{X=RUwAh*RXL_YdPjU% zyhB9IPS3CV*WJ_8vuq7T|BTSD5$eaN*mW5p^qZcaFhUP)RhxNTETwn14bz!{)uWNB z>(*v+xt*Pz@twlBWpCvsrl+TKQa+c@kAcOQvuC>U?wIKej?8igMdm2BUUPNJO#2Sy zidA*OZJC%}=a%xIRqExWUF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