From ce2862dd451f3ac2dbb79da7f924037984ba339c Mon Sep 17 00:00:00 2001 From: sleepycatcoding <131554884+sleepycatcoding@users.noreply.github.com> Date: Sat, 7 Oct 2023 01:35:48 +0300 Subject: [PATCH] avm2: Fix KeyboardEvent clone also adds missing commandKey property. --- core/src/avm2/globals/flash/events/KeyboardEvent.as | 11 ++++++++++- 1 file changed, 10 insertions(+), 1 deletion(-) diff --git a/core/src/avm2/globals/flash/events/KeyboardEvent.as b/core/src/avm2/globals/flash/events/KeyboardEvent.as index 8475b7fd8..1b55f7139 100644 --- a/core/src/avm2/globals/flash/events/KeyboardEvent.as +++ b/core/src/avm2/globals/flash/events/KeyboardEvent.as @@ -11,6 +11,7 @@ package flash.events private var _altKey:Boolean; private var _shiftKey:Boolean; private var _controlKey:Boolean; + private var _commandKey:Boolean; public function KeyboardEvent(type:String, bubbles:Boolean = true, @@ -32,6 +33,7 @@ package flash.events this._altKey = altKeyValue; this._shiftKey = shiftKeyValue; this._controlKey = controlKeyValue; + this._commandKey = commandKeyValue; } public function get charCode():uint { @@ -83,9 +85,16 @@ package flash.events this._controlKey = val; } + public function get commandKey():Boolean { + return this._commandKey; + } + public function set commandKey(val:Boolean) { + this._commandKey = val; + } + override public function clone() : Event { - return new KeyboardEvent(this.type,this.bubbles,this.cancelable); + return new KeyboardEvent(this.type,this.bubbles,this.cancelable,this._charCode,this._keyCode,this._keyLocation,this._ctrlKey,this._altKey,this._shiftKey,this._controlKey,this._commandKey); } public native function updateAfterEvent():void;