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 000000000000..1f27ce865c9b --- /dev/null +++ b/tests/tests/swfs/avm2/focus_events_mixed_key_mouse/Test.as @@ -0,0 +1,98 @@ +package { + +import flash.display.DisplayObject; +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 = "sprite1"; + sprite1.x = 0; + sprite1.y = 100; + sprite1.tabEnabled = true; + sprite1.tabIndex = 1; + sprite2 = newSprite(0x00FF00); + sprite2.name = "sprite2"; + sprite2.x = 100; + sprite2.y = 100; + sprite2.tabEnabled = true; + sprite2.tabIndex = 2; + sprite3 = newSprite(0x0000FF); + sprite3.name = "sprite3"; + 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 + ", focus: " + objectToString(stage.focus)); + 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 objectToString(obj: DisplayObject): String { + return "" + obj + ((obj != null) ? " (" + obj.name + ")" : ""); + } + + 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 000000000000..070ac047e73c --- /dev/null +++ b/tests/tests/swfs/avm2/focus_events_mixed_key_mouse/input.json @@ -0,0 +1,42 @@ +[ + { "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": 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 000000000000..fe38df8c2213 --- /dev/null +++ b/tests/tests/swfs/avm2/focus_events_mixed_key_mouse/input.json.py @@ -0,0 +1,36 @@ +#!/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', '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 000000000000..1d5cc9242cf2 --- /dev/null +++ b/tests/tests/swfs/avm2/focus_events_mixed_key_mouse/output.txt @@ -0,0 +1,100 @@ +Tab pressed + null, null: [FocusEvent type="keyFocusChange" bubbles=true cancelable=true eventPhase=2 relatedObject=[object Sprite] shiftKey=false keyCode=9], focus: null + sprite1, sprite1: [FocusEvent type="focusIn" bubbles=true cancelable=false eventPhase=2 relatedObject=null shiftKey=false keyCode=0], focus: [object Sprite] (sprite1) + null, sprite1: [FocusEvent type="focusIn" bubbles=true cancelable=false eventPhase=3 relatedObject=null shiftKey=false keyCode=0], focus: [object Sprite] (sprite1) +Tab pressed + sprite1, sprite1: [FocusEvent type="keyFocusChange" bubbles=true cancelable=true eventPhase=2 relatedObject=[object Sprite] shiftKey=false keyCode=9], focus: [object Sprite] (sprite1) + null, sprite1: [FocusEvent type="keyFocusChange" bubbles=true cancelable=true eventPhase=3 relatedObject=[object Sprite] shiftKey=false keyCode=9], focus: [object Sprite] (sprite1) + sprite1, sprite1: [FocusEvent type="focusOut" bubbles=true cancelable=false eventPhase=2 relatedObject=[object Sprite] shiftKey=false keyCode=0], focus: [object Sprite] (sprite2) + null, sprite1: [FocusEvent type="focusOut" bubbles=true cancelable=false eventPhase=3 relatedObject=[object Sprite] shiftKey=false keyCode=0], focus: [object Sprite] (sprite2) + sprite2, sprite2: [FocusEvent type="focusIn" bubbles=true cancelable=false eventPhase=2 relatedObject=[object Sprite] shiftKey=false keyCode=0], focus: [object Sprite] (sprite2) + null, sprite2: [FocusEvent type="focusIn" bubbles=true cancelable=false eventPhase=3 relatedObject=[object Sprite] shiftKey=false keyCode=0], focus: [object Sprite] (sprite2) +Escape pressed + sprite1, sprite1: [MouseEvent type="rollOver" cancelable=false eventPhase=2 relatedObject=null ctrlKey=false altKey=false shiftKey=false], focus: [object Sprite] (sprite2) + sprite1, sprite1: [MouseEvent type="mouseOver" cancelable=false eventPhase=2 relatedObject=null ctrlKey=false altKey=false shiftKey=false], focus: [object Sprite] (sprite2) + null, sprite1: [MouseEvent type="mouseOver" cancelable=false eventPhase=3 relatedObject=null ctrlKey=false altKey=false shiftKey=false], focus: [object Sprite] (sprite2) + sprite2, sprite2: [FocusEvent type="mouseFocusChange" bubbles=true cancelable=true eventPhase=2 relatedObject=[object Sprite] shiftKey=false keyCode=0], focus: [object Sprite] (sprite2) + null, sprite2: [FocusEvent type="mouseFocusChange" bubbles=true cancelable=true eventPhase=3 relatedObject=[object Sprite] shiftKey=false keyCode=0], focus: [object Sprite] (sprite2) + sprite2, sprite2: [FocusEvent type="focusOut" bubbles=true cancelable=false eventPhase=2 relatedObject=[object Sprite] shiftKey=false keyCode=0], focus: [object Sprite] (sprite1) + null, sprite2: [FocusEvent type="focusOut" bubbles=true cancelable=false eventPhase=3 relatedObject=[object Sprite] shiftKey=false keyCode=0], focus: [object Sprite] (sprite1) + sprite1, sprite1: [FocusEvent type="focusIn" bubbles=true cancelable=false eventPhase=2 relatedObject=[object Sprite] shiftKey=false keyCode=0], focus: [object Sprite] (sprite1) + null, sprite1: [FocusEvent type="focusIn" bubbles=true cancelable=false eventPhase=3 relatedObject=[object Sprite] shiftKey=false keyCode=0], focus: [object Sprite] (sprite1) + sprite1, sprite1: [MouseEvent type="mouseDown" cancelable=false eventPhase=2 relatedObject=null ctrlKey=false altKey=false shiftKey=false], focus: [object Sprite] (sprite1) + null, sprite1: [MouseEvent type="mouseDown" cancelable=false eventPhase=3 relatedObject=null ctrlKey=false altKey=false shiftKey=false], focus: [object Sprite] (sprite1) + sprite1, sprite1: [MouseEvent type="mouseUp" cancelable=false eventPhase=2 relatedObject=null ctrlKey=false altKey=false shiftKey=false], focus: [object Sprite] (sprite1) + null, sprite1: [MouseEvent type="mouseUp" cancelable=false eventPhase=3 relatedObject=null ctrlKey=false altKey=false shiftKey=false], focus: [object Sprite] (sprite1) + sprite1, sprite1: [MouseEvent type="click" cancelable=false eventPhase=2 relatedObject=null ctrlKey=false altKey=false shiftKey=false], focus: [object Sprite] (sprite1) + null, sprite1: [MouseEvent type="click" cancelable=false eventPhase=3 relatedObject=null ctrlKey=false altKey=false shiftKey=false], focus: [object Sprite] (sprite1) +Tab pressed + sprite1, sprite1: [FocusEvent type="keyFocusChange" bubbles=true cancelable=true eventPhase=2 relatedObject=[object Sprite] shiftKey=false keyCode=9], focus: [object Sprite] (sprite1) + null, sprite1: [FocusEvent type="keyFocusChange" bubbles=true cancelable=true eventPhase=3 relatedObject=[object Sprite] shiftKey=false keyCode=9], focus: [object Sprite] (sprite1) + sprite1, sprite1: [FocusEvent type="focusOut" bubbles=true cancelable=false eventPhase=2 relatedObject=[object Sprite] shiftKey=false keyCode=0], focus: [object Sprite] (sprite2) + null, sprite1: [FocusEvent type="focusOut" bubbles=true cancelable=false eventPhase=3 relatedObject=[object Sprite] shiftKey=false keyCode=0], focus: [object Sprite] (sprite2) + sprite2, sprite2: [FocusEvent type="focusIn" bubbles=true cancelable=false eventPhase=2 relatedObject=[object Sprite] shiftKey=false keyCode=0], focus: [object Sprite] (sprite2) + null, sprite2: [FocusEvent type="focusIn" bubbles=true cancelable=false eventPhase=3 relatedObject=[object Sprite] shiftKey=false keyCode=0], focus: [object Sprite] (sprite2) +Escape pressed + sprite1, sprite1: [MouseEvent type="rollOut" cancelable=false eventPhase=2 relatedObject=[object Sprite] ctrlKey=false altKey=false shiftKey=false], focus: [object Sprite] (sprite2) + sprite2, sprite2: [MouseEvent type="rollOver" cancelable=false eventPhase=2 relatedObject=[object Sprite] ctrlKey=false altKey=false shiftKey=false], focus: [object Sprite] (sprite2) + sprite2, sprite2: [MouseEvent type="mouseOver" cancelable=false eventPhase=2 relatedObject=[object Sprite] ctrlKey=false altKey=false shiftKey=false], focus: [object Sprite] (sprite2) + null, sprite2: [MouseEvent type="mouseOver" cancelable=false eventPhase=3 relatedObject=[object Sprite] ctrlKey=false altKey=false shiftKey=false], focus: [object Sprite] (sprite2) + sprite2, sprite2: [MouseEvent type="mouseDown" cancelable=false eventPhase=2 relatedObject=null ctrlKey=false altKey=false shiftKey=false], focus: [object Sprite] (sprite2) + null, sprite2: [MouseEvent type="mouseDown" cancelable=false eventPhase=3 relatedObject=null ctrlKey=false altKey=false shiftKey=false], focus: [object Sprite] (sprite2) + sprite2, sprite2: [MouseEvent type="mouseUp" cancelable=false eventPhase=2 relatedObject=null ctrlKey=false altKey=false shiftKey=false], focus: [object Sprite] (sprite2) + null, sprite2: [MouseEvent type="mouseUp" cancelable=false eventPhase=3 relatedObject=null ctrlKey=false altKey=false shiftKey=false], focus: [object Sprite] (sprite2) + sprite2, sprite2: [MouseEvent type="click" cancelable=false eventPhase=2 relatedObject=null ctrlKey=false altKey=false shiftKey=false], focus: [object Sprite] (sprite2) + null, sprite2: [MouseEvent type="click" cancelable=false eventPhase=3 relatedObject=null ctrlKey=false altKey=false shiftKey=false], focus: [object Sprite] (sprite2) +Tab pressed + sprite2, sprite2: [FocusEvent type="keyFocusChange" bubbles=true cancelable=true eventPhase=2 relatedObject=[object Sprite] shiftKey=false keyCode=9], focus: [object Sprite] (sprite2) + null, sprite2: [FocusEvent type="keyFocusChange" bubbles=true cancelable=true eventPhase=3 relatedObject=[object Sprite] shiftKey=false keyCode=9], focus: [object Sprite] (sprite2) + sprite2, sprite2: [FocusEvent type="focusOut" bubbles=true cancelable=false eventPhase=2 relatedObject=[object Sprite] shiftKey=false keyCode=0], focus: [object Sprite] (sprite1) + null, sprite2: [FocusEvent type="focusOut" bubbles=true cancelable=false eventPhase=3 relatedObject=[object Sprite] shiftKey=false keyCode=0], focus: [object Sprite] (sprite1) + sprite1, sprite1: [FocusEvent type="focusIn" bubbles=true cancelable=false eventPhase=2 relatedObject=[object Sprite] shiftKey=false keyCode=0], focus: [object Sprite] (sprite1) + null, sprite1: [FocusEvent type="focusIn" bubbles=true cancelable=false eventPhase=3 relatedObject=[object Sprite] shiftKey=false keyCode=0], focus: [object Sprite] (sprite1) +Escape pressed +Tab pressed + sprite1, sprite1: [FocusEvent type="keyFocusChange" bubbles=true cancelable=true eventPhase=2 relatedObject=[object Sprite] shiftKey=false keyCode=9], focus: [object Sprite] (sprite1) + null, sprite1: [FocusEvent type="keyFocusChange" bubbles=true cancelable=true eventPhase=3 relatedObject=[object Sprite] shiftKey=false keyCode=9], focus: [object Sprite] (sprite1) + sprite1, sprite1: [FocusEvent type="focusOut" bubbles=true cancelable=false eventPhase=2 relatedObject=[object Sprite] shiftKey=false keyCode=0], focus: [object Sprite] (sprite2) + null, sprite1: [FocusEvent type="focusOut" bubbles=true cancelable=false eventPhase=3 relatedObject=[object Sprite] shiftKey=false keyCode=0], focus: [object Sprite] (sprite2) + sprite2, sprite2: [FocusEvent type="focusIn" bubbles=true cancelable=false eventPhase=2 relatedObject=[object Sprite] shiftKey=false keyCode=0], focus: [object Sprite] (sprite2) + null, sprite2: [FocusEvent type="focusIn" bubbles=true cancelable=false eventPhase=3 relatedObject=[object Sprite] shiftKey=false keyCode=0], focus: [object Sprite] (sprite2) + sprite2, sprite2: [MouseEvent type="mouseDown" cancelable=false eventPhase=2 relatedObject=null ctrlKey=false altKey=false shiftKey=false], focus: [object Sprite] (sprite2) + null, sprite2: [MouseEvent type="mouseDown" cancelable=false eventPhase=3 relatedObject=null ctrlKey=false altKey=false shiftKey=false], focus: [object Sprite] (sprite2) + sprite2, sprite2: [MouseEvent type="mouseUp" cancelable=false eventPhase=2 relatedObject=null ctrlKey=false altKey=false shiftKey=false], focus: [object Sprite] (sprite2) + null, sprite2: [MouseEvent type="mouseUp" cancelable=false eventPhase=3 relatedObject=null ctrlKey=false altKey=false shiftKey=false], focus: [object Sprite] (sprite2) + sprite2, sprite2: [MouseEvent type="click" cancelable=false eventPhase=2 relatedObject=null ctrlKey=false altKey=false shiftKey=false], focus: [object Sprite] (sprite2) + null, sprite2: [MouseEvent type="click" cancelable=false eventPhase=3 relatedObject=null ctrlKey=false altKey=false shiftKey=false], focus: [object Sprite] (sprite2) +Escape pressed + sprite2, sprite2: [MouseEvent type="rollOut" cancelable=false eventPhase=2 relatedObject=[object Sprite] ctrlKey=false altKey=false shiftKey=false], focus: [object Sprite] (sprite2) + sprite3, sprite3: [MouseEvent type="rollOver" cancelable=false eventPhase=2 relatedObject=[object Sprite] ctrlKey=false altKey=false shiftKey=false], focus: [object Sprite] (sprite2) + sprite3, sprite3: [MouseEvent type="mouseOver" cancelable=false eventPhase=2 relatedObject=[object Sprite] ctrlKey=false altKey=false shiftKey=false], focus: [object Sprite] (sprite2) + null, sprite3: [MouseEvent type="mouseOver" cancelable=false eventPhase=3 relatedObject=[object Sprite] ctrlKey=false altKey=false shiftKey=false], focus: [object Sprite] (sprite2) + sprite2, sprite2: [FocusEvent type="mouseFocusChange" bubbles=true cancelable=true eventPhase=2 relatedObject=[object Sprite] shiftKey=false keyCode=0], focus: [object Sprite] (sprite2) + null, sprite2: [FocusEvent type="mouseFocusChange" bubbles=true cancelable=true eventPhase=3 relatedObject=[object Sprite] shiftKey=false keyCode=0], focus: [object Sprite] (sprite2) + sprite2, sprite2: [FocusEvent type="focusOut" bubbles=true cancelable=false eventPhase=2 relatedObject=[object Sprite] shiftKey=false keyCode=0], focus: [object Sprite] (sprite3) + null, sprite2: [FocusEvent type="focusOut" bubbles=true cancelable=false eventPhase=3 relatedObject=[object Sprite] shiftKey=false keyCode=0], focus: [object Sprite] (sprite3) + sprite3, sprite3: [FocusEvent type="focusIn" bubbles=true cancelable=false eventPhase=2 relatedObject=[object Sprite] shiftKey=false keyCode=0], focus: [object Sprite] (sprite3) + null, sprite3: [FocusEvent type="focusIn" bubbles=true cancelable=false eventPhase=3 relatedObject=[object Sprite] shiftKey=false keyCode=0], focus: [object Sprite] (sprite3) + sprite3, sprite3: [MouseEvent type="mouseDown" cancelable=false eventPhase=2 relatedObject=null ctrlKey=false altKey=false shiftKey=false], focus: [object Sprite] (sprite3) + null, sprite3: [MouseEvent type="mouseDown" cancelable=false eventPhase=3 relatedObject=null ctrlKey=false altKey=false shiftKey=false], focus: [object Sprite] (sprite3) + sprite3, sprite3: [MouseEvent type="mouseUp" cancelable=false eventPhase=2 relatedObject=null ctrlKey=false altKey=false shiftKey=false], focus: [object Sprite] (sprite3) + null, sprite3: [MouseEvent type="mouseUp" cancelable=false eventPhase=3 relatedObject=null ctrlKey=false altKey=false shiftKey=false], focus: [object Sprite] (sprite3) + sprite3, sprite3: [MouseEvent type="click" cancelable=false eventPhase=2 relatedObject=null ctrlKey=false altKey=false shiftKey=false], focus: [object Sprite] (sprite3) + null, sprite3: [MouseEvent type="click" cancelable=false eventPhase=3 relatedObject=null ctrlKey=false altKey=false shiftKey=false], focus: [object Sprite] (sprite3) +Tab pressed + sprite3, sprite3: [FocusEvent type="keyFocusChange" bubbles=true cancelable=true eventPhase=2 relatedObject=[object Sprite] shiftKey=false keyCode=9], focus: [object Sprite] (sprite3) + null, sprite3: [FocusEvent type="keyFocusChange" bubbles=true cancelable=true eventPhase=3 relatedObject=[object Sprite] shiftKey=false keyCode=9], focus: [object Sprite] (sprite3) + sprite3, sprite3: [FocusEvent type="focusOut" bubbles=true cancelable=false eventPhase=2 relatedObject=[object Sprite] shiftKey=false keyCode=0], focus: [object Sprite] (sprite1) + null, sprite3: [FocusEvent type="focusOut" bubbles=true cancelable=false eventPhase=3 relatedObject=[object Sprite] shiftKey=false keyCode=0], focus: [object Sprite] (sprite1) + sprite1, sprite1: [FocusEvent type="focusIn" bubbles=true cancelable=false eventPhase=2 relatedObject=[object Sprite] shiftKey=false keyCode=0], focus: [object Sprite] (sprite1) + null, sprite1: [FocusEvent type="focusIn" bubbles=true cancelable=false eventPhase=3 relatedObject=[object Sprite] shiftKey=false keyCode=0], focus: [object Sprite] (sprite1) +Escape pressed + sprite3, sprite3: [MouseEvent type="rollOut" cancelable=false eventPhase=2 relatedObject=null ctrlKey=false altKey=false shiftKey=false], focus: [object Sprite] (sprite1) + sprite1, sprite1: [FocusEvent type="mouseFocusChange" bubbles=true cancelable=true eventPhase=2 relatedObject=null shiftKey=false keyCode=0], focus: [object Sprite] (sprite1) + null, sprite1: [FocusEvent type="mouseFocusChange" bubbles=true cancelable=true eventPhase=3 relatedObject=null shiftKey=false keyCode=0], focus: [object Sprite] (sprite1) + sprite1, sprite1: [FocusEvent type="focusOut" bubbles=true cancelable=false eventPhase=2 relatedObject=null shiftKey=false keyCode=0], focus: null + null, sprite1: [FocusEvent type="focusOut" bubbles=true cancelable=false eventPhase=3 relatedObject=null shiftKey=false keyCode=0], focus: null + null, null: [MouseEvent type="mouseDown" cancelable=false eventPhase=2 relatedObject=null ctrlKey=false altKey=false shiftKey=false], focus: null + null, null: [MouseEvent type="mouseUp" cancelable=false eventPhase=2 relatedObject=null ctrlKey=false altKey=false shiftKey=false], focus: null + null, null: [MouseEvent type="click" cancelable=false eventPhase=2 relatedObject=null ctrlKey=false altKey=false shiftKey=false], focus: null +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 000000000000..402828f1d9e3 Binary files /dev/null and b/tests/tests/swfs/avm2/focus_events_mixed_key_mouse/test.swf differ diff --git a/tests/tests/swfs/avm2/focus_events_mixed_key_mouse/test.toml b/tests/tests/swfs/avm2/focus_events_mixed_key_mouse/test.toml new file mode 100644 index 000000000000..cf6123969a1d --- /dev/null +++ b/tests/tests/swfs/avm2/focus_events_mixed_key_mouse/test.toml @@ -0,0 +1 @@ +num_ticks = 1