avm2: Fix KeyboardEvent clone

also adds missing commandKey property.
This commit is contained in:
sleepycatcoding 2023-10-07 01:35:48 +03:00 committed by TÖRÖK Attila
parent 3a658f5dec
commit ce2862dd45
1 changed files with 10 additions and 1 deletions

View File

@ -11,6 +11,7 @@ package flash.events
private var _altKey:Boolean; private var _altKey:Boolean;
private var _shiftKey:Boolean; private var _shiftKey:Boolean;
private var _controlKey:Boolean; private var _controlKey:Boolean;
private var _commandKey:Boolean;
public function KeyboardEvent(type:String, public function KeyboardEvent(type:String,
bubbles:Boolean = true, bubbles:Boolean = true,
@ -32,6 +33,7 @@ package flash.events
this._altKey = altKeyValue; this._altKey = altKeyValue;
this._shiftKey = shiftKeyValue; this._shiftKey = shiftKeyValue;
this._controlKey = controlKeyValue; this._controlKey = controlKeyValue;
this._commandKey = commandKeyValue;
} }
public function get charCode():uint { public function get charCode():uint {
@ -83,9 +85,16 @@ package flash.events
this._controlKey = val; 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 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; public native function updateAfterEvent():void;